ITPub博客

首页 > Linux操作系统 > Linux操作系统 > change db name by recreating control file

change db name by recreating control file

原创 Linux操作系统 作者:xin2v 时间:2009-03-19 14:29:52 0 删除 编辑

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/,如需转载,请注明出处,否则将追究法律责任。

上一篇: Solaris OS常见问题
请登录后发表评论 登录
全部评论

注册时间:2009-03-19

  • 博文量
    45
  • 访问量
    64650