非歸檔丟失日誌檔案的恢復

zuoluo2003發表於2014-07-08
rhel5+oracle11gr2  

SQL> alter database clear logfile group 1; (inactive)
SQL> alter database clear unarchived logfile group 1; (active
線上日誌為current時,稍微麻煩點。
shutdown immedaite 時
SQL> startup mount;
SQL> recover database until cancel;
SQL> alter database open resetlogs;
shutdown abort 時
SQL> startup mount;
SQL> recover database until cancel;
SQL> alter database open resetlogs;
如果在 alter database open resetlogs;提示    
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/orcl/system01.dbf'
比較一下他們的值:
select checkpoint_change# from v$database;
select checkpoint_change# from v$datafile;
select checkpoint_change# from v$datafile_header;
如果一樣(不管一樣不一樣
alter system set "_allow_resetlogs_corruption"=TRUE scope=spfile;
然後重啟資料庫。
當全部online redo log都丟失了,可以按照上面的辦法恢復。
1、startup mount;
2、恢復非current狀態的日誌
3、
recover database until cancel;
4、
alter database open resetlogs;
比較一下他們的值:
select checkpoint_change# from v$database;
select checkpoint_change# from v$datafile;
select checkpoint_change# from v$datafile_header;
如果一樣(不管一樣不一樣)
alter system set "_allow_resetlogs_corruption"=TRUE scope=spfile;
然後重啟資料庫。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/76103/viewspace-1212566/,如需轉載,請註明出處,否則將追究法律責任。

相關文章