ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 使用_allow_resetlogs_corruption打开无归档日志rman备份库

使用_allow_resetlogs_corruption打开无归档日志rman备份库

原创 Linux操作系统 作者:yhj20041128001 时间:2012-11-29 08:54:01 0 删除 编辑
1 今天做HRMS Clone工作,需要更改数据库名。改了数据库名发现,数据库打不开。报错
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/opt/oracle/oradata/chf/system01.dbf'
 
2 查看相关SCN
SQL> select file#,to_char(checkpoint_change#,'999999999999') from v$datafile;
SQL> select file#,online_status,to_char(change#,'999999999999') from v$recover_file;
SQL> select file#,to_char(checkpoint_change#,'999999999999') from v$datafile_header;
--发现数据文件scn和控制文件不一致,重建控制文件,然后查询相关scn
SQL> select file#,to_char(checkpoint_change#,'999999999999') from v$datafile;
SQL> select file#,online_status,to_char(change#,'999999999999') from v$recover_file;
SQL> select file#,to_char(checkpoint_change#,'999999999999') from v$datafile_header;
3.尝试打开数据库
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/opt/oracle/oradata/chf/system01.dbf'
4.使用隐含参数打开数据库
SQL> create pfile='/tmp/pfile' from spfile;
  
File created.
  
-------/tmp/pfile中加上----------
_allow_resetlogs_corruption= TRUE
---------------------------------
  
SQL> startup mount pfile='/tmp/pfile' force
ORACLE instance started.
  
Total System Global Area  622149632 bytes
Fixed Size                  2230912 bytes
Variable Size             419431808 bytes
Database Buffers          192937984 bytes
Redo Buffers                7548928 bytes
Database mounted.
SQL> alter database open resetlogs;
  
Database altered.
  
SQL> select open_mode from v$database;
  
OPEN_MODE
--------------------
READ WRITE
小结:数据文件的SCN大于数据文件头的SCN,可以尝试使用隐含参数打开数据库。
 

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

请登录后发表评论 登录
全部评论

注册时间:2010-09-17

  • 博文量
    174
  • 访问量
    390263