修改dbid后出现一系列问题

环境:OEL+Oracle11.2.0.3

问题描述:由于做备份恢复测试需要,根据eygle的bloghttp://www.eygle.com/archives/2008/05/dbms_backup_restore_dbid.html,更改了测试数据库的dbid,看似事情已然圆满结束,然后事实并非那么简单,更改dbid后出现了一系列的问题。

先是startup database时出现ORA-01589 ,接着resetlogs时又是ORA-01194等等,下面容在下慢慢道来:

更改完dbid后,查询dbid:

SQL> select dbid from v$database;

      DBID
----------
1234567890

重新启动数据库,确保修改被确认,遭遇ORA-01589,

ORA-01589 must use resetlogs or nosetlogs option for database open

SQL>alter database open resetlogs;

ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/oradata/orcl2/system01.dbf'

SQL> recover database using backup controlfile until cancel;


ORA-01547:warning: RECOVER succeeded but OPEN RESETLOGS would get error below

ORA-01194: file 1 needs more recovery to be consistent

ORA-01110: data file 1: '/oradata/orcl2/system01.dbf'

(这边需要提示一下,由于更改了dbid,之前的备份集无法使用,所以rman无法利用之前的备份集恢复数据文件)
解决方面是尝试修改隐含参数 _allow_resetlogs_corruption=true
先是shutdown immediate数据库,创建pfile,修改pfile,重建spfile,
OK!
SQL> create pfile from spfile;
File created.
修改initorcl2.ora,添加隐含参数_allow_resetlogs_corruption=true
通过pfile创建spfile:
SQL> create spfile from pfile;
File created.
启动数据库:
SQL> startup
ORACLE instance started.

Total System Global Area  418484224 bytes
Fixed Size                  1336932 bytes
Variable Size             331352476 bytes
Database Buffers           79691776 bytes
Redo Buffers                6103040 bytes
Database mounted.
Database opened.
OK!正常
SQL> select dbid from v$database;

      DBID
----------
1234567890

由于更改了dbid导致之前的rman备份集无法使用,重新备份下数据库,包括逻辑备份:

逻辑备份数据库时又遭遇ORA-01187和ORA-01110

About to export the entire database ...

. exporting tablespace definitions
EXP-00008: ORACLE error 1187 encountered
ORA-01187: cannot read from file  because it failed verification tests
ORA-01110: data file 202: '/oradata/orcl2/temp02.dbf'
EXP-00000: Export terminated unsuccessfully


检查temp临时表空间:

SQL> select file_name,tablespace_name from dba_temp_files;
select file_name,tablespace_name from dba_temp_files
                                      *
ERROR at line 1:
ORA-01187: cannot read from file  because it failed verification tests
ORA-01110: data file 201: '/oradata/orcl2/temp01.dbf'

我的解决方法是重建temp表空间:

SQL> alter database tempfile '/oradata/orcl2/temp01.dbf' drop;

Database altered.

SQL> alter database tempfile '/oradata/orcl2/temp02.dbf' drop;

Database altered.

SQL> select * from v$tempfile;

no rows selected

SQL> alter tablespace temp add tempfile '/oradata/orcl2/temp01.dbf' size 50m;
Tablespace altered.


select file_name,tablespace_name,status from dba_temp_files;

FILE_NAME                 TABLESPACE_NAME                STATUS
------------------------- ------------------------------ -------
/oradata/orcl2/temp01.dbf TEMP                           ONLINE

重新发起逻辑备份;OK!正常了

但是这样的库还是极其不稳定,建议还是重建库吧,不建议在生产库上对dbid进行修改;





--------------------------------------------------------------------------------------------

版权所有,转载请注明作者及原文链接,否则追究法律责任!

QQ:      584307876

作者:    Seven

原文链接:  http://blog.csdn.net/sunjiapeng/article/details/8899858

邮箱:     seven_ginna@foxmail.com

转载于:https://www.cnblogs.com/seven-dba/archive/2013/05/08/4354916.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值