【備份恢復】 恢復重做日誌組成員
恢復重做日誌組成員
1) 檢視當前 redo 日誌組情況,從結果看是有 3 個日誌組,每個日誌組有 1 個成員, 1 號日誌組為當前正在使用的日誌組
SQL> conn / as sysdba
Connected.
SQL>
SQL> select group#,members,status from v$log;
GROUP# MEMBERS STATUS
---------- ---------- ----------------
1 1 CURRENT
2 1 UNUSED
3 1 UNUSED
SQL> select group#,member from v$logfile order by 1,2;
GROUP# MEMBER
---------- --------------------------------------------------
1 /u01/app/oracle/oradata/ORA11GR2/redo01.log
2 /u01/app/oracle/oradata/ORA11GR2/redo02.log
3 /u01/app/oracle/oradata/ORA11GR2/redo03.log
前期準備:增加日誌組成員
SQL> alter database add logfile member '/u01/app/oracle/oradata/ORA11GR2/redo01_a.log' to group 1;
Database altered.
SQL> alter database add logfile member '/u01/app/oracle/oradata/ORA11GR2/redo02_a.log' to group 2;
Database altered.
SQL> alter database add logfile member '/u01/app/oracle/oradata/ORA11GR2/redo03_a.log' to group 3;
Database altered.
驗證:
SQL> select group#,members,status from v$log;
GROUP# MEMBERS STATUS
---------- ---------- ----------------
1 2 CURRENT
2 2 UNUSED
3 2 UNUSED
SQL> select group#,member from v$logfile order by 1,2;
GROUP# MEMBER
---------- --------------------------------------------------
1 /u01/app/oracle/oradata/ORA11GR2/redo01.log
1 /u01/app/oracle/oradata/ORA11GR2/redo01_a.log
2 /u01/app/oracle/oradata/ORA11GR2/redo02.log
2 /u01/app/oracle/oradata/ORA11GR2/redo02_a.log
3 /u01/app/oracle/oradata/ORA11GR2/redo03.log
3 /u01/app/oracle/oradata/ORA11GR2/redo03_a.log
6 rows selected.
2) 刪除當前正在使用的第一組 redo 的其中一個成員
[oracle@wang backup]$ cd $ORACLE_BASE
[oracle@wang oracle]$ cd oradata/ORA11GR2/
[oracle@wang ORA11GR2]$ ls redo*
redo01_a.log redo02_a.log redo03_a.log
redo01.log redo02.log redo03.log
[oracle@wang ORA11GR2]$
[oracle@wang ORA11GR2]$ rm redo01_a.log
[oracle@wang ORA11GR2]$
[oracle@wang ORA11GR2]$ ls redo*
redo01.log redo02_a.log redo02.log redo03_a.log redo03.log
[oracle@wang ORA11GR2]$
1) 此時資料庫在使用上是沒有問題的,我們一致性關閉資料庫,並重啟,看看有沒有異常
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL> startup
ORACLE instance started.
Total System Global Area 830930944 bytes
Fixed Size 2257800 bytes
Variable Size 503319672 bytes
Database Buffers 322961408 bytes
Redo Buffers 2392064 bytes
Database mounted.
Database opened.
2) 資料庫重啟的步驟沒有異常(也就是說,丟失一個 redo 成員並未影響使用),只是在 alert 日誌中有如下錯誤
[oracle@wang trace]$ pwd
/u01/app/oracle/diag/rdbms/ora11gr2/ORA11GR2/trace
[oracle@wang trace]$ tail -100f alert_ORA11GR2.log
------------------------------------------------------------------------------------------------------------
ALTER DATABASE OPEN
LGWR: STARTING ARCH PROCESSES
Fri Sep 23 07:58:23 2016
ARC0 started with pid=20, OS id=7827
ARC0: Archival started
LGWR: STARTING ARCH PROCESSES COMPLETE
ARC0: STARTING ARCH PROCESSES
Errors in file /u01/app/oracle/diag/rdbms/ora11gr2/ORA11GR2/trace/ORA11GR2_lgwr_7736.trc:
ORA-00313: open failed for members of log group 1 of thread 1
Errors in file /u01/app/oracle/diag/rdbms/ora11gr2/ORA11GR2/trace/ORA11GR2_lgwr_7736.trc:
ORA-00313: open failed for members of log group 2 of thread 1
Errors in file /u01/app/oracle/diag/rdbms/ora11gr2/ORA11GR2/trace/ORA11GR2_lgwr_7736.trc:
ORA-00313: open failed for members of log group 3 of thread 1
Errors in file /u01/app/oracle/diag/rdbms/ora11gr2/ORA11GR2/trace/ORA11GR2_lgwr_7736.trc:
ORA-00313: open failed for members of log group 1 of thread 1
Thread 1 opened at log sequence 1
Current log# 1 seq# 1 mem# 0: /u01/app/oracle/oradata/ORA11GR2/redo01.log
Successful open of redo thread 1
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
SMON: enabling cache recovery
Fri Sep 23 07:58:24 2016
ARC1 started with pid=21, OS id=7839
Fri Sep 23 07:58:24 2016
Errors in file /u01/app/oracle/diag/rdbms/ora11gr2/ORA11GR2/trace/ORA11GR2_m000_7843.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/ORA11GR2/redo01_a.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/ora11gr2/ORA11GR2/trace/ORA11GR2_m000_7843.trc:
Errors in file /u01/app/oracle/diag/rdbms/ora11gr2/ORA11GR2/trace/ORA11GR2_m000_7843.trc:
Fri Sep 23 07:58:24 2016
ARC2 started with pid=23, OS id=7847
Checker run found 1 new persistent data failures
ARC1: Archival started
ARC2: Archival started
ARC1: Becoming the 'no FAL' ARCH
ARC1: Becoming the 'no SRL' ARCH
ARC2: Becoming the heartbeat ARCH
Fri Sep 23 07:58:24 2016
ARC3 started with pid=22, OS id=7855
[7823] Successfully onlined Undo Tablespace 2.
Undo initialization finished serial:0 start:125398924 end:125399034 diff:110 (1 seconds)
Verifying file header compatibility for 11g tablespace encryption..
Verifying 11g file header compatibility for tablespace encryption completed
SMON: enabling tx recovery
Database Characterset is AL32UTF8
No Resource Manager plan active
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process QMNC
Fri Sep 23 07:58:25 2016
QMNC started with pid=24, OS id=7859
ARC3: Archival started
ARC0: STARTING ARCH PROCESSES COMPLETE
Completed: ALTER DATABASE OPEN
Starting background process CJQ0
Fri Sep 23 07:58:26 2016
CJQ0 started with pid=28, OS id=7887
5)修復這個問題也是很簡單的,因為 redo 的成員也是互為映象的,我們首先一致性關閉資料庫
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
3) 複製第一組 redo 成員
[oracle@wang ORA11GR2]$ ls redo*
redo01.log redo02_a.log redo02.log redo03_a.log redo03.log
[oracle@wang ORA11GR2]$
[oracle@wang ORA11GR2]$ cp redo01.log redo01_a.log
[oracle@wang ORA11GR2]$
[oracle@wang ORA11GR2]$ ls redo*
redo01_a.log redo02_a.log redo03_a.log
redo01.log redo02.log redo03.log
[oracle@wang ORA11GR2]$
4) 啟動資料庫,恢復完成
SQL> startup
ORACLE instance started.
Total System Global Area 830930944 bytes
Fixed Size 2257800 bytes
Variable Size 503319672 bytes
Database Buffers 322961408 bytes
Redo Buffers 2392064 bytes
Database mounted.
Database opened.
檢視alert日誌也沒有報錯資訊了!!!!!!!!!!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31397003/viewspace-2126763/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 備份恢復之redo日誌組member成員丟失
- 【備份恢復】恢復 丟失已歸檔重做日誌檔案
- 恢復重做日誌
- 【備份與恢復】重建受損的聯機重做日誌檔案成員
- 重做日誌的恢復
- oracle 恢復重做日誌Oracle
- 【備份與恢復】恢復受損的複用聯機重做日誌檔案
- rman恢復--丟失聯機重做日誌的恢復
- 備份與恢復--從備份的歸檔日誌中恢復資料
- MySQL日誌管理,備份和恢復MySql
- MySQL 日誌管理、備份與恢復MySql
- 【備份恢復】恢復inactive狀態的日誌檔案
- 【備份恢復】set newname切換日誌
- 冷備份+歸檔日誌的恢復
- MySQL重做日誌恢復資料的流程MySql
- 聯機重做日誌丟失的恢復
- 聯機重做日誌檔案的恢復
- 丟失所有重做日誌檔案的恢復例子丟失所有重做日誌檔案的恢復例子如下:
- Oracle備份恢復之熱備份恢復及異機恢復Oracle
- 【備份恢復】從備份恢復資料庫資料庫
- 【管理篇備份恢復】備份恢復基礎
- Oracle Redo(重做日誌) 模擬故障和恢復Oracle Redo
- 備份與恢復:用user模式基於日誌序列的不完全恢復模式
- 備份與恢復:用rman方式基於日誌序列的不完全恢復
- 為oracle新增重做日誌組及重做日誌成員Oracle
- 丟失聯機重做日誌檔案的恢復
- 【備份恢復】資料恢復指導資料恢復
- MySQL備份與恢復——基於Xtrabackup物理備份恢復MySql
- 備份與恢復--利用備份的控制檔案恢復
- Oracle使用備份檔案集恢復歸檔日誌Oracle
- RMAN備份及恢復歸檔日誌的語法
- 老虎是如何從備份集中恢復歸檔日誌
- Mysql備份恢復MySql
- Postgresql 備份恢復SQL
- redis備份恢復Redis
- mysql 備份恢復MySql
- 備份和恢復
- 單例項備份恢復成RAC單例