Clone a Database

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博客 ” ,链接:http://blog.itpub.net/11118/viewspace-928697/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/11118/viewspace-928697/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值