非歸檔模式下,丟失日誌檔案的一次恢復過程
場景描述:
Oracle Database11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
非歸檔模式下,備份控制檔案後,切換日誌檔案,並執行完全檢查點操作。並模擬資料庫斷電關閉。然後刪除現有控制檔案後,還原備份的控制檔案,然後開啟庫。
曲折過程如下:
SQL>alter database backup controlfile to '/u01/controlfile.bak';
SQL> alter system switch logfile;
System altered.
SQL> /
System altered.
SQL> /
System altered.
SQL>alter system checkpoint;
System altered.
SQL> shutdown abort;
ORACLE instance shut down.
[oracle@RAC1 ~]$rm /u01/app/oracle/oradata/wailon/control*.ctl
刪除原控制檔案後,用備份的控制檔案還原:
[oracle@RAC1 ~]$cp/u01/controlfile.bak /u01/app/oracle/oradata/wailon/control01.ctl
[oracle@RAC1 ~]$cp/u01/controlfile.bak /u01/app/oracle/oradata/wailon/control02.ctl
開啟資料庫報錯:
SQL> alterdatabase open resetlogs;
alter databaseopen resetlogs
*
ERROR at line 1:
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: datafile 1: '/u01/app/oracle/oradata/wailon/system01.dbf'
使用備份的控制檔案恢復:
SQL> recover database using backup controlfile;
ORA-00279: change1074079 generated at 06/05/2013 16:31:21 needed for thread 1
ORA-00289:suggestion : /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_8_817166132.dbf
ORA-00280: change1074079 for thread 1 is in sequence #8
Specify log:{<RET>=suggested | filename | AUTO | CANCEL}
auto
ORA-00308: '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_8_817166132.dbf'
ORA-27037: ??
Linux-x86_64Error: 2: No such file or directory
Additionalinformation: 3
由於資料庫處於非歸檔狀態,找不到對應的歸檔日誌檔案,恢復未成功
嘗試不完全恢復,無效:
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 1074079 generated at 06/05/2013 16:31:21 needed for thread 1
ORA-00289:suggestion : /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_8_817166132.dbf
ORA-00280: change 1074079 for thread 1 is in sequence #8
Specify log:{<RET>=suggested | filename | AUTO | CANCEL}
cancel
ORA-01547: :RECOVER PEN RESETLOGS
ORA-01194: 1 ?
ORA-01110: 1:'/u01/app/oracle/oradata/wailon/system01.dbf'
ORA-01112: media recovery not started
alert 日誌檔案資訊:
Wed Jun 0519:28:59 2013
--非法關閉資料庫
WARNING!Recovering data file 1 from a fuzzy file. If not the current file
it might be anonline backup taken without entering the begin backup command.
WARNING!Recovering data file 2 from a fuzzy file. If not the current file
it might be anonline backup taken without entering the begin backup command.
WARNING!Recovering data file 3 from a fuzzy file. If not the current file
it might be anonline backup taken without entering the begin backup command.
WARNING!Recovering data file 4 from a fuzzy file. If not the current file
it might be anonline backup taken without entering the begin backup command.
WARNING!Recovering data file 5 from a fuzzy file. If not the current file
it might be anonline backup taken without entering the begin backup command.
Parallel MediaRecovery started with 2 slaves
ORA-279 signalledduring: alter database recover if needed
start until cancel using backup controlfile
...
alter databaserecover cancel
Errors in file/u01/app/oracle/diag/rdbms/wailon/wailon/trace/wailon_pr00_3857.trc:
ORA-01547: : RECOVER OPEN RESETLOGS
ORA-01194: 1 ?
ORA-01110: 1:'/u01/app/oracle/oradata/wailon/system01.dbf'
Slave exiting withORA-1547 exception
Errors in file/u01/app/oracle/diag/rdbms/wailon/wailon/trace/wailon_pr00_3857.trc:
ORA-01547: :RECOVER OPEN RESETLOGS
ORA-01194: 1 ?
ORA-01110: 1:'/u01/app/oracle/oradata/wailon/system01.dbf'
ORA-1547 signalledduring: alter database recover cancel...
Wed Jun 0519:29:14 2013
alter databaseopen
Errors in file/u01/app/oracle/diag/rdbms/wailon/wailon/trace/wailon_ora_3851.trc:
ORA-01589: mustuse RESETLOGS or NORESETLOGS option for database open
ORA-1589 signalledduring: alter database open...
Wed Jun 0519:29:24 2013
alter databaseopen resetlogs
--資料檔案一致性檢查未透過
ORA-1194 signalled during: alter database openresetlogs...
透過資料檔案及重做日誌檔案重建控制檔案,還是跟上面的錯誤一樣。後來一不小心把所有重做日誌檔案刪除了,之後就是以下的情況
修改init.ora 新增以下語句,跳過一致性檢查
*._allow_resetlogs_corruption=TRUE
再次嘗試啟動
SQL> startup mount pfile='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/init.ora'
ORACLE instance started.
Total System Global Area 417546240 bytes
Fixed Size 2228944 bytes
Variable Size 276827440 bytes
Database Buffers 130023424 bytes
Redo Buffers 8466432 bytes
Database mounted.
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL> alter database open resetlogs;
Database altered.
alert 日誌檔案資訊:
alter database open resetlogs
RESETLOGS is being done without consistancy checks. This may result in a corrupted database. Thedatabase should be recreated.
RESETLOGS after incomplete recovery UNTIL CHANGE 1074079
Errors in file/u01/app/oracle/diag/rdbms/wailon/wailon/trace/wailon_ora_4673.trc:
ORA-00313: openfailed for members of log group 1 of thread 1
ORA-00312:online log 1 thread 1: '/u01/app/oracle/oradata/wailon/redo01.log'
ORA-27037: unableto obtain file status
Linux-x86_64Error: 2: No such file or directory
Additionalinformation: 3
Clearing online redo logfile 1 /u01/app/oracle/oradata/wailon/redo01.log
Clearing onlinelog 1 of thread 1 sequence number 7
Errors in file/u01/app/oracle/diag/rdbms/wailon/wailon/trace/wailon_ora_4673.trc:
ORA-00313: openfailed for members of log group 1 of thread 1
ORA-00312: onlinelog 1 thread 1: '/u01/app/oracle/oradata/wailon/redo01.log'
ORA-27037: unableto obtain file status
Linux-x86_64Error: 2: No such file or directory
Additionalinformation: 3
Errors in file/u01/app/oracle/diag/rdbms/wailon/wailon/trace/wailon_ora_4673.trc:
ORA-00313: openfailed for members of log group 1 of thread 1
ORA-00312: onlinelog 1 thread 1: '/u01/app/oracle/oradata/wailon/redo01.log'
ORA-27037: unableto obtain file status
Linux-x86_64Error: 2: No such file or directory
Additionalinformation: 3
Clearing online redo logfile 1 complete
Errors in file/u01/app/oracle/diag/rdbms/wailon/wailon/trace/wailon_ora_4673.trc:
ORA-00313: openfailed for members of log group 2 of thread 1
ORA-00312:online log 2 thread 1: '/u01/app/oracle/oradata/wailon/redo02.log'
ORA-27037: unableto obtain file status
Linux-x86_64Error: 2: No such file or directory
Additionalinformation: 3
Clearing online redo logfile 2 /u01/app/oracle/oradata/wailon/redo02.log
Clearing onlinelog 2 of thread 1 sequence number 8
Errors in file/u01/app/oracle/diag/rdbms/wailon/wailon/trace/wailon_ora_4673.trc:
ORA-00313: openfailed for members of log group 2 of thread 1
ORA-00312: onlinelog 2 thread 1: '/u01/app/oracle/oradata/wailon/redo02.log'
ORA-27037: unableto obtain file status
Linux-x86_64Error: 2: No such file or directory
Additionalinformation: 3
Errors in file/u01/app/oracle/diag/rdbms/wailon/wailon/trace/wailon_ora_4673.trc:
ORA-00313: openfailed for members of log group 2 of thread 1
ORA-00312: onlinelog 2 thread 1: '/u01/app/oracle/oradata/wailon/redo02.log'
ORA-27037: unableto obtain file status
Linux-x86_64Error: 2: No such file or directory
Additionalinformation: 3
Clearing online redo logfile 2 complete
Errors in file/u01/app/oracle/diag/rdbms/wailon/wailon/trace/wailon_ora_4673.trc:
ORA-00313: openfailed for members of log group 3 of thread 1
ORA-00312:online log 3 thread 1: '/u01/app/oracle/oradata/wailon/redo03.log'
ORA-27037: unableto obtain file status
Linux-x86_64Error: 2: No such file or directory
Additionalinformation: 3
Clearing online redo logfile 3 /u01/app/oracle/oradata/wailon/redo03.log
Clearing onlinelog 3 of thread 1 sequence number 6
Errors in file/u01/app/oracle/diag/rdbms/wailon/wailon/trace/wailon_ora_4673.trc:
ORA-00313: openfailed for members of log group 3 of thread 1
ORA-00312: onlinelog 3 thread 1: '/u01/app/oracle/oradata/wailon/redo03.log'
ORA-27037: unableto obtain file status
Linux-x86_64Error: 2: No such file or directory
Additionalinformation: 3
Errors in file/u01/app/oracle/diag/rdbms/wailon/wailon/trace/wailon_ora_4673.trc:
ORA-00313: openfailed for members of log group 3 of thread 1
ORA-00312: onlinelog 3 thread 1: '/u01/app/oracle/oradata/wailon/redo03.log'
ORA-27037: unableto obtain file status
Linux-x86_64Error: 2: No such file or directory
Additionalinformation: 3
Clearing online redo logfile 3 complete
Resettingresetlogs activation ID 2746928689 (0xa3bace31)
Online log/u01/app/oracle/oradata/wailon/redo01.log: Thread 1 Group 1 was previouslycleared
Online log/u01/app/oracle/oradata/wailon/redo02.log: Thread 1 Group 2 was previouslycleared
Online log/u01/app/oracle/oradata/wailon/redo03.log: Thread 1 Group 3 was previouslycleared
Thu Jun 0600:13:34 2013
Setting recoverytarget incarnation to 3
Thu Jun 0600:13:34 2013
Assigningactivation ID 2747175177 (0xa3be9109)
Thread 1 opened at log sequence 1
Current log# 1 seq# 1 mem# 0:/u01/app/oracle/oradata/wailon/redo01.log
Successful open ofredo thread 1
MTTR advisory isdisabled because FAST_START_MTTR_TARGET is not set
Thu Jun 0600:13:34 2013
SMON: enablingcache recovery
[4673]Successfully onlined Undo Tablespace 2.
Undoinitialization finished serial:0 start:32944304 end:32944694 diff:390 (3seconds)
Dictionary checkbeginning
Dictionary checkcomplete
Verifying fileheader compatibility for 11g tablespace encryption..
Verifying 11g fileheader compatibility for tablespace encryption completed
SMON: enabling txrecovery
DatabaseCharacterset is ZHS16GBK
No ResourceManager plan active
Thu Jun 0600:13:37 2013
replication_dependency_trackingturned off (no async multimaster replication found)
Startingbackground process QMNC
Thu Jun 0600:13:38 2013
QMNC started withpid=20, OS id=4681
LOGSTDBY:Validating controlfile with logical metadata
LOGSTDBY:Validation complete
Completed:alter database open resetlogs
至此,資料庫正常開啟。
小插曲:
期間若出現ORA-00600: internal error code, arguments: [2662], [0], [1096111], [0], [1096312], [4194432], [],[], [], [], [], []
Trace file/u01/app/oracle/diag/rdbms/wailon/wailon/trace/wailon_ora_5779.trc
Oracle Database11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With thePartitioning, OLAP, Data Mining and Real Application Testing options
ORACLE_HOME =/u01/app/oracle/product/11.2.0/dbhome_1
System name: Linux
Node name: RAC1
Release: 2.6.39-200.24.1.el6uek.x86_64
Version: #1 SMP Sat Jun 23 02:39:07 EDT 2012
Machine: x86_64
Instance name:wailon
Redo threadmounted by this instance: 1
Oracle processnumber: 19
Unix process pid:5779, image: oracle@RAC1 (TNS V1-V3)
*** 2013-06-0601:16:22.327
*** SESSIONID:(125.5) 2013-06-06 01:16:22.327
*** CLIENT ID:()2013-06-06 01:16:22.327
*** SERVICENAME:() 2013-06-06 01:16:22.327
*** MODULENAME:(sqlplus@RAC1 (TNS V1-V3)) 2013-06-06 01:16:22.327
*** ACTION NAME:()2013-06-06 01:16:22.327
*** 2013-06-0601:16:22.324 5402 dbsdrv.c
*** 2013-06-0601:16:40.327
Successfully allocated 2 recovery slaves
Using 67 overflowbuffers per recovery slave
Thread 1checkpoint: logseq 1, block 2, scn 1076101
on-disk rba: logseq 1, block 3, scn 1076103
start recovery at logseq 1, block 3, scn1076103
*** 2013-06-0601:16:40.367
Started writing zero blks thread 1 seq 1 blocks 3-10
*** 2013-06-0601:16:40.401
Completed writing zero blks thread 1 seq 1
==== Redo read statistics for thread 1 ====
Total physical reads (from disk and memory): 4096Kb
-- Redo read_disk statistics --
Read rate (ASYNC):0Kb in 0.06s => 0.00 Mb/sec
----------------------------------------------
----- Recovery Hash Table Statistics ---------
Hash table buckets= 262144
Longest hash chain= 0
Average hash chain= 0/0 = 0.0
Max compares perlookup = 0
Avg compares perlookup = 0/0 = 0.0
----------------------------------------------
*** 2013-06-0601:16:40.403
KCRA: startrecovery claims for 0 data blocks
*** 2013-06-0601:16:40.404
KCRA: blocksprocessed = 0/0, claimed = 0, eliminated = 0
*** 2013-06-06 01:16:40.405
Recovery of OnlineRedo Log: Thread 1 Group 1 Seq 1 Reading mem 0
*** 2013-06-0601:16:40.406
Completed redoapplication of 0.00MB
*** 2013-06-0601:16:40.406
Completed recoverycheckpoint
----- RecoveryHash Table Statistics ---------
Hash table buckets= 262144
Longest hash chain= 0
Average hash chain= 0/0 = 0.0
Max compares perlookup = 0
Avg compares perlookup = 0/0 = 0.0
----------------------------------------------
Recovery sets nabof thread 1 seq 1 to 3 with 8 zeroblks
*** 2013-06-0601:16:40.829
Incident 36153created, dump file:/u01/app/oracle/diag/rdbms/wailon/wailon/incident/incdir_36153/wailon_ora_5779_i36153.
trc
ORA-00600:internal error code, arguments: [2662], [0], [1096111], [0], [1096312],[4194432], [], [], [], [], [], []
ORA-00600:internal error code, arguments: [2662], [0], [1096111], [0], [1096312],[4194432], [], [], [], [], [], []
ORA-00600:internal error code, arguments: [2662], [0], [1096111], [0], [1096312],[4194432], [], [], [], [], [], []
*** 2013-06-0601:16:41.963
USER (ospid:5779): terminating the instance due to error 600
下次啟動時不要使用*._allow_resetlogs_corruption=TRUE此引數即可。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24930246/viewspace-2145405/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 測試在丟失歸檔日誌的情況下,跳過部分歸檔日誌進行資料恢復資料恢復
- 【BBED】丟失歸檔檔案情況下的恢復
- Oracle使用備份檔案集恢復歸檔日誌Oracle
- DG歸檔日誌缺失恢復
- 對歸檔模式下CLEAR 未歸檔日誌後恢復資料庫的一點看法模式資料庫
- 剪下的檔案還能恢復嗎,恢復剪貼丟失的檔案
- Oracle DataGuard歸檔日誌丟失處理方法Oracle
- dg丟失歸檔,使用rman增量備份恢復
- oracle dg 歸檔日誌恢復情況Oracle
- 丟失的隨身碟檔案如何恢復?
- 電腦檔案丟失資料恢復資料恢復
- 【資料庫資料恢復】Sql Server資料庫檔案丟失的資料恢復過程資料庫資料恢復SQLServer
- rac歸檔模式/非歸檔模式下檔案建至本地儲存修復方法-ORA-01157模式
- Sql Server資料庫檔案丟失的恢復方法SQLServer資料庫
- RMAN-ERROR:因為找不到過期和丟失的歸檔日誌而備份失敗Error
- Sqlserver系統資料庫和使用者資料庫日誌檔案全部丟失的恢復SQLServer資料庫
- DATA GUARD主庫丟失資料檔案的恢復(3)
- DATA GUARD主庫丟失資料檔案的恢復(1)
- DATA GUARD主庫丟失資料檔案的恢復(2)
- OGG整合抽取模式丟失歸檔處理模式
- Vsan分散式儲存架構虛擬機器磁碟檔案丟失資料恢復過程分散式架構虛擬機資料恢復
- macOS Big Sur系統如何恢復丟失的資料檔案?Mac
- 【Oracle】歸檔日誌管理-設定歸檔日誌路徑以及歸檔日誌冗餘Oracle
- Oracle歸檔檔案丟失導致OGG不用啟動Oracle
- oracle控制檔案的損壞或完全丟失的恢復辦法Oracle
- 存放在電腦中的檔案丟失了怎麼恢復
- oracle 刪除過期的歸檔日誌Oracle
- PostgreSQL 歸檔日誌SQL
- 歸檔日誌挖掘
- oracle歸檔日誌Oracle
- win10 ppt檔案丟失怎麼恢復_win10 ppt文件丟失如何找回Win10
- Linux下日誌檔案過大解決方案Linux
- Rman在run命令塊裡臨時設定歸檔目錄,歸檔日誌能否恢復主要看預設的歸檔路徑
- 2.7.10 恢復丟失或損壞的伺服器引數檔案(SPFILE)伺服器
- 檔案丟失不用怕:超實用的Mac資料恢復軟體!Mac資料恢復
- 【資料庫資料恢復】mdb_catalog.wt檔案丟失的MongoDB資料恢復案例資料庫資料恢復MongoDB
- 【伺服器資料恢復】xfs檔案系統資料丟失的資料恢復案例伺服器資料恢復
- 【北亞資料恢復】MongoDB資料遷移檔案丟失的MongoDB資料恢復案例資料恢復MongoDB
- 教你自動恢復MySQL資料庫的日誌檔案(binlog)MySql資料庫