环境: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-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
邮箱: [email protected]