change db name by recreating control file

1.Use SQL "alter database backup controlfile to trace" to backup the controlfile-created script.
2.shutdown database
3.backup all datafile/controlfile/redofile to a new place in order to prevent the option from mistake.
4.Delete the old controlfile,open tracefile created in step 1 ,update the scripts,I met the 2 errors as the following:

---------------OldName:PROD, New DB Name: TEST ------------------

ERROR 1.CREATE CONTROLFILE reuse DATABASE "TEST" NORESETLOGS  NOARCHIVELOG==>error
ERROR 2.CREATE CONTROLFILE set DATABASE "TEST" NORESETLOGS  NOARCHIVELOG ==>error
RECOVER DATABASE
# Database can now be opened normally.
ALTER DATABASE OPEN;

Right One is:

CREATE CONTROLFILE set DATABASE "TEST" RESETLOGS  NOARCHIVELOG /*Attention point 1*/
RECOVER DATABASE USING BACKUP CONTROLFILE  /*Attention point 2*/
# Database can now be opened zeroing the online logs./*Attention point 3*/
ALTER DATABASE OPEN RESETLOGS;/*Attention point 4*/

Following is the detail:

SQL >  RECOVER  DATABASE
ORA
- 00283 : recovery session canceled due  to  errors
ORA
- 01610 : recovery using the  BACKUP  CONTROLFILE  option  must be done


SQL
>  RECOVER  DATABASE  using  backup  controlfile until cancel;
ORA
- 00279 : change  9747475574288  generated at  12 / 14 / 2007   00 : 19 : 43  needed  for
thread 
1
ORA
- 00289 : suggestion :  /home/ oracle / 9.2 . 0 / dbs / arch / arch_1_2.arc
ORA
- 00280 : change  9747475574288   for  thread  1   is   in  sequence # 2


Specify 
log : { < RET >= suggested  |  filename  |  AUTO  |  CANCEL}
/disk1/oradata/prod/ log01b.dbf
Log  applied.
Media recovery complete.
SQL
>   alter   database   open  resetlogs; 

Database  Altered;

5.You can restart use the PLSQL"show parameter db_name" to confirm the actions.

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

转载于:http://blog.itpub.net/10325341/viewspace-573094/

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值