1, generate txt control file;
2,edit the txt control file with the new name;
3,edit init.ora file with the new name;
4,update env variable with the new name;
5,update data dictionary,etc.
[@more@]A database can be renamed by recreating the control files. You may want to rename a database after you have made a copy of a database from one system to another, for example, when refreshing a development database from production.
- Connect to Server Manager, i.e., "svrmgrl":
- CONNECT INTERNAL
- ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
- SHUTDOWN IMMEDIATE
- STARTUP
- SHUTDOWN NORMAL
- EXIT
- Create a file to create the new controlfile using the trace file, for example, /oramsp11008/tsvt_trace/udump/ora_37628_tsvt.trc, that was created using the command above. The file should contain only the "CREATE CONTROLFILE" command from the trace file with the following changes:
- Change REUSE to SET
- Change the current database name to the new database name
- Change NORESETLOGS to RESETLOGS
- Edit the init.ora file with the new database name changes. At a minimum, the DB_NAME must match the name in the "CREATE CONTROLFILE" command.
- If necessary, change the database name in /etc/oratab, update the ORACLE_SID environment variable, rename the init.ora file and symbolic link in $ORACLE_HOME/dbs, and rename the trace directories.
- Move each of the existing control files indicated by the "CONTROL_FILES" parameter in the init.ora file to "control_file_name".old.
- Connect to Server Manager, i.e., "svrmgrl":
- CONNECT INTERNAL
- STARTUP NOMOUNT
- create the control file using the script prepared above
- ALTER DATABASE OPEN RESETLOGS;
- SELECT * FROM SYS.DUAL;
- If necessary, UPDATE SYS.DUAL SET DUMMY = NEW_DB_NAME; (for example, GENLD)
- SELECT * FROM GLOBAL_NAME;
- If necessary, ALTER DATABASE RENAME GLOBAL_NAME TO NEW DATABASE SID.DOMAIN (for example, GENLD.DEVL.CORP.MEDTRONIC.COM)
- EXIT
- Edit the "SERVER_lbackup.dat" file in the arc directory and remove all lines containing the instance name, so that the reset archive logs will be backed up by oraarchive. For example, grep -v genld MSPR1_lbackup.dat >> temp.dat; mv temp.dat MSPR1_lbackup.dat will remove genld line items.
- Schedule a cold backup (613 job) with operations.
- Make any necessary Names Server changes using Network Manager.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11118/viewspace-928697/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/11118/viewspace-928697/