ITPub博客

首页 > 数据库 > 数据库开发技术 > Clone a Database

Clone a Database

原创 数据库开发技术 作者:kenchendz 时间:2007-07-28 06:27:57 0 删除 编辑

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.

  1. Connect to Server Manager, i.e., "svrmgrl":
    1. CONNECT INTERNAL
    2. ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
    3. SHUTDOWN IMMEDIATE
    4. STARTUP
    5. SHUTDOWN NORMAL
    6. EXIT
  2. 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:
    1. Change REUSE to SET
    2. Change the current database name to the new database name
    3. Change NORESETLOGS to RESETLOGS
  3. 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.
  4. 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.
  5. Move each of the existing control files indicated by the "CONTROL_FILES" parameter in the init.ora file to "control_file_name".old.
  6. Connect to Server Manager, i.e., "svrmgrl":
    1. CONNECT INTERNAL
    2. STARTUP NOMOUNT
    3. create the control file using the script prepared above
    4. ALTER DATABASE OPEN RESETLOGS;
    5. SELECT * FROM SYS.DUAL;
    6. If necessary, UPDATE SYS.DUAL SET DUMMY = NEW_DB_NAME; (for example, GENLD)
    7. SELECT * FROM GLOBAL_NAME;
    8. If necessary, ALTER DATABASE RENAME GLOBAL_NAME TO NEW DATABASE SID.DOMAIN (for example, GENLD.DEVL.CORP.MEDTRONIC.COM)
    9. EXIT
  7. 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.
  8. Schedule a cold backup (613 job) with operations.
  9. Make any necessary Names Server changes using Network Manager.

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/11118/viewspace-928697/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: ORA-12705 - Solutions
下一篇: Imp/Exp-Basic rules
请登录后发表评论 登录
全部评论
  • 博文量
    25
  • 访问量
    270145