Wednesday, April 22, 2009

Renaming a database

1. Cerate a create controlfile script with the command 'alter database backup controlfile to trace;'
2. Move the database to the new sid in /u02/oradata.
3. Move the admin directory and all relevant $ORACLE_HOME/dbs files.
4. Edit the control file so it contains the following command (change reuse to set):

CREATE CONTROLFILE SET DATABASE "TSTOLTP" RESETLOGS ARCHIVELOG

5. Receate the controlfile and simply run 'alter database open resetlogs;'.
6. Recreate the temporary tablespace.

No comments: