Oracle資料庫聯機日誌檔案丟失處理方法(5)
試驗五:丟失當前日誌組的成員1、SQL>; select * from v$logfile;
GROUP# STATUS TYPE
---------- ------- -------
MEMBER
--------------------------------------------------------------------------------
3 ONLINE /T3/ORACLE/oradata/ORA9/redo03.log
2 ONLINE /T3/ORACLE/oradata/ORA9/redo02.log
1 ONLINE /T3/ORACLE/oradata/ORA9/redo01.log
GROUP# STATUS TYPE
---------- ------- -------
MEMBER
--------------------------------------------------------------------------------
1 ONLINE /T3/ORACLE/oradata/ORA9/redo01a.log
2 ONLINE /T3/ORACLE/oradata/ORA9/redo02a.log
3 ONLINE /T3/ORACLE/oradata/ORA9/redo03a.log
SQL>; select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIME
------------- ----------
1 1 2 104857600 2 YES INACTIVE 554599 02-9月 -05
2 1 3 104857600 2 YES INACTIVE 554601 02-9月 -05
3 1 4 104857600 2 NO CURRENT 554603 02-9月 -05 SQL>;3、 模擬插入資料SQL>; conn test/test Connected. SQL>; select * from test;
TEL
----------
1 2 3 4
SQL>; insert into test values(5);
1 row created.
SQL>; commit 2 ;
Commit complete. 4、shutdown db,模擬刪除一個當前日誌成員$ cd oradata/ORA9 $ ls redo03* redo03.log redo03a.log $ rm redo03a.log 5、啟動db,表面沒有錯誤SQL>; startup ORACLE instance started.
Total System Global Area 353862792 bytes Fixed Size 730248 bytes Variable Size 285212672 bytes Database Buffers 67108864 bytes Redo Buffers 811008 bytes Database mounted. Database opened. SQL>;6、 檢視日至成員SQL>; select * from v$logfile;
GROUP# STATUS TYPE
---------- ------- -------
MEMBER
--------------------------------------------------------------------------------
3 ONLINE /T3/ORACLE/oradata/ORA9/redo03.log
2 ONLINE /T3/ORACLE/oradata/ORA9/redo02.log
1 ONLINE /T3/ORACLE/oradata/ORA9/redo01.log
GROUP# STATUS TYPE
---------- ------- -------
MEMBER
--------------------------------------------------------------------------------
1 ONLINE /T3/ORACLE/oradata/ORA9/redo01a.log
2 ONLINE /T3/ORACLE/oradata/ORA9/redo02a.log
3 INVALID ONLINE /T3/ORACLE/oradata/ORA9/redo03a.log 7、刪除出問題的聯機日誌檔案SQL>; alter database drop logfile member '/T3/ORACLE/oradata/ORA9/redo03a.log';alter database drop logfile member '/T3/ORACLE/oradata/ORA9/redo03a.log' * ERROR at line 1:ORA-01609: log 3 is the current log for thread 1 - cannot drop members ORA-00312: online log 3 thread 1: '/T3/ORACLE/oradata/ORA9/redo03.log' ORA-00312: online log 3 thread 1: '/T3/ORACLE/oradata/ORA9/redo03a.log'
SQL>;看來當前日誌成員是不允許刪除的SQL>; alter system switch logfile;
System altered.
SQL>; select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIME
------------- ----------
1 1 5 104857600 2 NO CURRENT 557687 02-9月 -05
2 1 3 104857600 2 YES INACTIVE 554601 02-9月 -05
3 1 4 104857600 2 YES ACTIVE 554603 02-9月 -05
SQL>; alter database drop logfile member '/T3/ORACLE/oradata/ORA9/redo03a.log';
Database altered.
SQL>; alter database add logfile member '/T3/ORACLE/oradata/ORA9/redo03a.log' to group 3;
Database altered. SQL>; select * from v$logfile;
GROUP# STATUS TYPE
---------- ------- -------
MEMBER
--------------------------------------------------------------------------------
3 ONLINE /T3/ORACLE/oradata/ORA9/redo03.log
2 ONLINE /T3/ORACLE/oradata/ORA9/redo02.log
1 ONLINE /T3/ORACLE/oradata/ORA9/redo01.log
GROUP# STATUS TYPE
---------- ------- -------
MEMBER
--------------------------------------------------------------------------------
1 ONLINE /T3/ORACLE/oradata/ORA9/redo01a.log
2 ONLINE /T3/ORACLE/oradata/ORA9/redo02a.log
3 INVALID ONLINE /T3/ORACLE/oradata/ORA9/redo03a.log看來還得切換一下日至SQL>; alter system switch logfile;
System altered. SQL>; select * from v$logfile;
GROUP# STATUS TYPE
---------- ------- -------
MEMBER
--------------------------------------------------------------------------------
3 ONLINE /T3/ORACLE/oradata/ORA9/redo03.log
2 ONLINE /T3/ORACLE/oradata/ORA9/redo02.log
1 ONLINE /T3/ORACLE/oradata/ORA9/redo01.log
GROUP# STATUS TYPE
---------- ------- -------
MEMBER
--------------------------------------------------------------------------------
1 ONLINE /T3/ORACLE/oradata/ORA9/redo01a.log
2 ONLINE /T3/ORACLE/oradata/ORA9/redo02a.log
3 ONLINE /T3/ORACLE/oradata/ORA9/redo03a.log
至此,大功告成……………。
結論:
只要日誌組的member不是一個,出現前面的4種可能性是非常小的,即使出現了也有相應的恢復方法,所以不必驚慌;如果memer多於1個,即使壞了其中的幾個,也不會 影響資料庫的正常啟動,啟動後,再進行相應的操作即可, 所以這個時候每天察看alert.log就顯得非常重要了。[@more@]
GROUP# STATUS TYPE
---------- ------- -------
MEMBER
--------------------------------------------------------------------------------
3 ONLINE /T3/ORACLE/oradata/ORA9/redo03.log
2 ONLINE /T3/ORACLE/oradata/ORA9/redo02.log
1 ONLINE /T3/ORACLE/oradata/ORA9/redo01.log
GROUP# STATUS TYPE
---------- ------- -------
MEMBER
--------------------------------------------------------------------------------
1 ONLINE /T3/ORACLE/oradata/ORA9/redo01a.log
2 ONLINE /T3/ORACLE/oradata/ORA9/redo02a.log
3 ONLINE /T3/ORACLE/oradata/ORA9/redo03a.log
SQL>; select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIME
------------- ----------
1 1 2 104857600 2 YES INACTIVE 554599 02-9月 -05
2 1 3 104857600 2 YES INACTIVE 554601 02-9月 -05
3 1 4 104857600 2 NO CURRENT 554603 02-9月 -05 SQL>;3、 模擬插入資料SQL>; conn test/test Connected. SQL>; select * from test;
TEL
----------
1 2 3 4
SQL>; insert into test values(5);
1 row created.
SQL>; commit 2 ;
Commit complete. 4、shutdown db,模擬刪除一個當前日誌成員$ cd oradata/ORA9 $ ls redo03* redo03.log redo03a.log $ rm redo03a.log 5、啟動db,表面沒有錯誤SQL>; startup ORACLE instance started.
Total System Global Area 353862792 bytes Fixed Size 730248 bytes Variable Size 285212672 bytes Database Buffers 67108864 bytes Redo Buffers 811008 bytes Database mounted. Database opened. SQL>;6、 檢視日至成員SQL>; select * from v$logfile;
GROUP# STATUS TYPE
---------- ------- -------
MEMBER
--------------------------------------------------------------------------------
3 ONLINE /T3/ORACLE/oradata/ORA9/redo03.log
2 ONLINE /T3/ORACLE/oradata/ORA9/redo02.log
1 ONLINE /T3/ORACLE/oradata/ORA9/redo01.log
GROUP# STATUS TYPE
---------- ------- -------
MEMBER
--------------------------------------------------------------------------------
1 ONLINE /T3/ORACLE/oradata/ORA9/redo01a.log
2 ONLINE /T3/ORACLE/oradata/ORA9/redo02a.log
3 INVALID ONLINE /T3/ORACLE/oradata/ORA9/redo03a.log 7、刪除出問題的聯機日誌檔案SQL>; alter database drop logfile member '/T3/ORACLE/oradata/ORA9/redo03a.log';alter database drop logfile member '/T3/ORACLE/oradata/ORA9/redo03a.log' * ERROR at line 1:ORA-01609: log 3 is the current log for thread 1 - cannot drop members ORA-00312: online log 3 thread 1: '/T3/ORACLE/oradata/ORA9/redo03.log' ORA-00312: online log 3 thread 1: '/T3/ORACLE/oradata/ORA9/redo03a.log'
SQL>;看來當前日誌成員是不允許刪除的SQL>; alter system switch logfile;
System altered.
SQL>; select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIME
------------- ----------
1 1 5 104857600 2 NO CURRENT 557687 02-9月 -05
2 1 3 104857600 2 YES INACTIVE 554601 02-9月 -05
3 1 4 104857600 2 YES ACTIVE 554603 02-9月 -05
SQL>; alter database drop logfile member '/T3/ORACLE/oradata/ORA9/redo03a.log';
Database altered.
SQL>; alter database add logfile member '/T3/ORACLE/oradata/ORA9/redo03a.log' to group 3;
Database altered. SQL>; select * from v$logfile;
GROUP# STATUS TYPE
---------- ------- -------
MEMBER
--------------------------------------------------------------------------------
3 ONLINE /T3/ORACLE/oradata/ORA9/redo03.log
2 ONLINE /T3/ORACLE/oradata/ORA9/redo02.log
1 ONLINE /T3/ORACLE/oradata/ORA9/redo01.log
GROUP# STATUS TYPE
---------- ------- -------
MEMBER
--------------------------------------------------------------------------------
1 ONLINE /T3/ORACLE/oradata/ORA9/redo01a.log
2 ONLINE /T3/ORACLE/oradata/ORA9/redo02a.log
3 INVALID ONLINE /T3/ORACLE/oradata/ORA9/redo03a.log看來還得切換一下日至SQL>; alter system switch logfile;
System altered. SQL>; select * from v$logfile;
GROUP# STATUS TYPE
---------- ------- -------
MEMBER
--------------------------------------------------------------------------------
3 ONLINE /T3/ORACLE/oradata/ORA9/redo03.log
2 ONLINE /T3/ORACLE/oradata/ORA9/redo02.log
1 ONLINE /T3/ORACLE/oradata/ORA9/redo01.log
GROUP# STATUS TYPE
---------- ------- -------
MEMBER
--------------------------------------------------------------------------------
1 ONLINE /T3/ORACLE/oradata/ORA9/redo01a.log
2 ONLINE /T3/ORACLE/oradata/ORA9/redo02a.log
3 ONLINE /T3/ORACLE/oradata/ORA9/redo03a.log
至此,大功告成……………。
結論:
只要日誌組的member不是一個,出現前面的4種可能性是非常小的,即使出現了也有相應的恢復方法,所以不必驚慌;如果memer多於1個,即使壞了其中的幾個,也不會 影響資料庫的正常啟動,啟動後,再進行相應的操作即可, 所以這個時候每天察看alert.log就顯得非常重要了。[@more@]
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/18921899/viewspace-1017277/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle資料庫聯機日誌檔案丟失處理方法(1)Oracle資料庫
- Oracle資料庫聯機日誌檔案丟失處理方法(3)Oracle資料庫
- Oracle資料庫聯機日誌檔案丟失處理方法(2)Oracle資料庫
- Oracle資料庫聯機日誌檔案丟失處理方法(4)Oracle資料庫
- Oracle資料庫聯機日誌檔案丟失處理方法(總結)!Oracle資料庫
- Oracle資料庫聯機日誌檔案丟失處理方法(總結)(轉)Oracle資料庫
- [原創] Oracle資料庫聯機日誌檔案丟失處理方法(總結)!Oracle資料庫
- Oracle聯機日誌檔案丟失或損壞的處理方法Oracle
- ORACLE聯機日誌檔案丟失或損壞的處理方法(轉)Oracle
- Oracle聯機日誌檔案丟失或損壞的處理方法 (轉)Oracle
- Oracle DataGuard歸檔日誌丟失處理方法Oracle
- 記一次Oracle 聯機日誌檔案丟失的處理方案Oracle
- 聯機日誌檔案丟失解決方法
- 聯機日誌檔案丟失解決方法(二)
- 聯機日誌檔案丟失解決方法(一)
- Oracle聯機日誌檔案丟失解決方法一例Oracle
- Oracle恢復例項之一:資料檔案、控制檔案、聯機日誌丟失Oracle
- rman恢復:資料檔案丟失,控制檔案丟失,聯機日誌檔案丟失(非當前使用與當前使用)
- 丟失聯機重做日誌檔案的恢復
- 解決Oracle資料庫日誌檔案丟失恢復問題Oracle資料庫
- 控制檔案丟失處理方法
- 丟失已歸檔日誌檔案下恢復資料庫資料庫
- oracle歸檔日誌丟失後的資料庫恢復Oracle資料庫
- 非歸檔下日誌檔案丟失的處理辦法
- Oracle恢復例項之二:Inactive聯機日誌檔案丟失Oracle
- Oracle恢復例項之三:active或current聯機日誌檔案丟失Oracle
- 【redo】日誌檔案的丟失解決方法
- oracle丟失日誌檔案的恢復( 轉)Oracle
- 丟失當前current重做日誌檔案下恢復資料庫資料庫
- oracle 聯機重做日誌檔案Oracle
- 【Oracle】 Oracle11gR2 擴充套件資料庫聯機日誌檔案Oracle套件資料庫
- 聯機重做日誌丟失的恢復
- UNDO表空間資料檔案丟失處理(二)正常關閉資料庫資料庫
- oracle 案例-控制檔案丟失故障處理過程Oracle
- 歸檔模式下的日誌檔案丟失的解決方法模式
- ORACLE 回滾段表空間資料檔案丟失或損壞處理方法(1) (轉)Oracle
- Sqlserver系統資料庫和使用者資料庫日誌檔案全部丟失的恢復SQLServer資料庫
- 分析Oracle資料庫日誌檔案(1)Oracle資料庫