SQL> recover database until cancel; ORA-00279: 更改 984722 (在 09/16/2015 16:04:43 生成) 對於線程 1 是必需的 ORA-00289: 建議: /app/archivelog/orcl_1_1_890582670.dbf ORA-00280: 更改 984722 (用於線程 1) 在序列 #1 中 指定日志: {<RET>=suggested | filename | AUTO | CANCEL} AUTO ORA-00308: cannot open archived log '/app/archivelog/orcl_1_1_890582670.dbf' ORA-27037: unable to obtain file status Linux-x86_64 Error: 2: No such file or directory Additional information: 3 ORA-00308: cannot open archived log '/app/archivelog/orcl_1_1_890582670.dbf' ORA-27037: unable to obtain file status Linux-x86_64 Error: 2: No such file or directory Additional information: 3 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: '/app/oradata/orcl/system01.dbf' SQL> recover database until cancel ORA-00279: 更改 984722 (在 09/16/2015 16:04:43 生成) 對於線程 1 是必需的 ORA-00289: 建議: /app/archivelog/orcl_1_1_890582670.dbf ORA-00280: 更改 984722 (用於線程 1) 在序列 #1 中 指定日志: {<RET>=suggested | filename | AUTO | CANCEL} 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: '/app/oradata/orcl/system01.dbf' ORA-01112: 未啟動介質恢復 SQL> alter database open resetlogs; alter database open resetlogs * 第 1 行出現錯誤: ORA-01194: 文件 1 需要更多的恢復來保持一致性 ORA-01110: 數據文件 1: '/app/oradata/orcl/system01.dbf'
但是我們發現,不完全恢復是失敗的,這個時候通過 resetlogs打開數據庫也是不可能的,那麼我們只能通過應用隱含參數,通過隱含參數使狀態不一致的數據庫打開,如下: SQL> create pfile='/home/oracle/p2.ora' from spfile; 在pfile裡面增加*._allow_resetlogs_corruption=TRUE echo "*._allow_resetlogs_corruption=TRUE">>p2.ora 然後通過我們新建的pfile打開數據庫到mount狀態: SQL> startup mount pfile='/home/oracle/p2.ora' ORACLE 例程已經啟動。 Total System Global Area 334036992 bytes Fixed Size 2253024 bytes Variable Size 171970336 bytes Database Buffers 155189248 bytes Redo Buffers 4624384 bytes 數據庫裝載完畢。 然後通過 resetlogs的方法打開數據庫 SQL> alter database open resetlogs; 數據庫已更改。 因為我們是用我們臨時生成的pfile進行啟動的,所以還要完成最後一步,重啟數據庫即可好了,數據庫打開了,但是因為我們的數據庫從異常情況下恢復過來,可能是會有問題的,所以建議做好備份,以防數據丟失。