手工恢復控制檔案
1、 備份控制檔案;
SQL> alter database backup controlfile to '/u01/backup/ctl_03301534.bk';
Database altered.
2、 切換日誌組,並確認控制檔案路徑
SQL> select * from v$logfile;
SQL> select * from v$log;
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> select NAME from v$controlfile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/orcl/control01.ctl
/u01/app/oracle/flash_recovery_area/orcl/control02.ctls
3、 模擬刪除控制檔案,並重啟資料庫
SQL> !rm -rf /u01/app/oracle/oradata/orcl/control01.ctl
SQL> !ls -l /u01/app/oracle/oradata/orcl/control01.ctl
ls: /u01/app/oracle/oradata/orcl/control01.ctl: No such file or directory
SQL> startup force
ORACLE instance started.
Total System Global Area 313860096 bytes
Fixed Size 1336232 bytes
Variable Size 234884184 bytes
Database Buffers 71303168 bytes
Redo Buffers 6336512 bytes
ORA-00205: error in identifying control file, check alert log for more info
4、 還原檔案,並裝載資料庫
SQL> !cp /u01/backup/ctl_03301534.bk /u01/app/oracle/oradata/orcl/control01.ctl
SQL> !cp /u01/backup/ctl_03301534.bk /u01/app/oracle/flash_recovery_area/orcl/control02.ctl
SQL> alter database mount;
Database altered.
5、 使用備份的控制檔案進行恢復
SQL> recover database using backup controlfile;
ORA-00279: change 1005918 generated at 03/30/2013 13:52:50 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/1_23_794102915.dbf
ORA-00280: change 1005918 for thread 1 is in sequence #23
Specify log: {
SQL> recover database using backup controlfile;
ORA-00279: change 1005918 generated at 03/30/2013 13:52:50 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/1_23_794102915.dbf
ORA-00280: change 1005918 for thread 1 is in sequence #23
Specify log: {
/u01/app/oracle/oradata/orcl/redo01.log
ORA-00326: log begins at change 1006363, need earlier change 1005918
ORA-00334: archived log: '/u01/app/oracle/oradata/orcl/redo01.log'
SQL> /u01/app/oracle/oradata/orcl/redo01.log
SP2-0734: unknown command beginning "/u01/app/o..." - rest of line ignored.
SQL> recover database using backup controlfile;
ORA-00279: change 1005918 generated at 03/30/2013 13:52:50 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/1_23_794102915.dbf
ORA-00280: change 1005918 for thread 1 is in sequence #23
Specify log: {
/u01/app/oracle/oradata/orcl/redo01.log
ORA-00326: log begins at change 1006363, need earlier change 1005918
ORA-00334: archived log: '/u01/app/oracle/oradata/orcl/redo01.log'
SQL> /u01/app/oracle/oradata/orcl/redo01.log
SP2-0734: unknown command beginning "/u01/app/o..." - rest of line ignored.
SQL> recover database using backup controlfile;
ORA-00279: change 1005918 generated at 03/30/2013 13:52:50 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/1_23_794102915.dbf
ORA-00280: change 1005918 for thread 1 is in sequence #23
Specify log: {
/u01/app/oracle/oradata/orcl/redo01.log
ORA-00326: log begins at change 1006363, need earlier change 1005918
ORA-00334: archived log: '/u01/app/oracle/oradata/orcl/redo01.log'
透過歸檔日誌路徑找到歸檔日誌,傳送未歸檔日誌都是不需要的,則需要去歸檔日誌路徑下獲取檔案。
SQL> show parameter archive
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
archive_lag_target integer 0
log_archive_config string
log_archive_dest string
log_archive_dest_1 string location=/u01/app/oracle/arch
log_archive_dest_10 string
log_archive_dest_11 string
log_archive_dest_12 string
log_archive_dest_13 string
log_archive_dest_14 string
log_archive_dest_15 string
log_archive_dest_16 string
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_17 string
log_archive_dest_18 string
log_archive_dest_19 string
log_archive_dest_2 string
log_archive_dest_20 string
log_archive_dest_21 string
log_archive_dest_22 string
log_archive_dest_23 string
log_archive_dest_24 string
log_archive_dest_25 string
log_archive_dest_26 string
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_27 string
log_archive_dest_28 string
log_archive_dest_29 string
log_archive_dest_3 string
log_archive_dest_30 string
log_archive_dest_31 string
log_archive_dest_4 string
log_archive_dest_5 string
log_archive_dest_6 string
log_archive_dest_7 string
log_archive_dest_8 string
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_9 string
log_archive_dest_state_1 string enable
log_archive_dest_state_10 string enable
log_archive_dest_state_11 string enable
log_archive_dest_state_12 string enable
log_archive_dest_state_13 string enable
log_archive_dest_state_14 string enable
log_archive_dest_state_15 string enable
log_archive_dest_state_16 string enable
log_archive_dest_state_17 string enable
log_archive_dest_state_18 string enable
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_state_19 string enable
log_archive_dest_state_2 string enable
log_archive_dest_state_20 string enable
log_archive_dest_state_21 string enable
log_archive_dest_state_22 string enable
log_archive_dest_state_23 string enable
log_archive_dest_state_24 string enable
log_archive_dest_state_25 string enable
log_archive_dest_state_26 string enable
log_archive_dest_state_27 string enable
log_archive_dest_state_28 string enable
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_state_29 string enable
log_archive_dest_state_3 string enable
log_archive_dest_state_30 string enable
log_archive_dest_state_31 string enable
log_archive_dest_state_4 string enable
log_archive_dest_state_5 string enable
log_archive_dest_state_6 string enable
log_archive_dest_state_7 string enable
log_archive_dest_state_8 string enable
log_archive_dest_state_9 string enable
log_archive_duplex_dest string
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_format string %t_%s_%r.dbf
log_archive_local_first boolean TRUE
log_archive_max_processes integer 4
log_archive_min_succeed_dest integer 1
log_archive_start boolean FALSE
log_archive_trace integer 0
standby_archive_dest string ?/dbs/arch
SQL> !ls -lrt /u01/app/oracle/arch
total 22124
-rw-r----- 1 oracle oinstall 14071808 Oct 14 11:58 1_20_794102915.dbf
-rw-r----- 1 oracle oinstall 391168 Oct 14 12:33 1_21_794102915.dbf
-rw-r----- 1 oracle oinstall 733184 Mar 30 13:52 1_22_794102915.dbf
-rw-r----- 1 oracle oinstall 7396352 Mar 30 15:56 1_23_794102915.dbf
-rw-r----- 1 oracle oinstall 1024 Mar 30 15:56 1_24_794102915.dbf
-rw-r----- 1 oracle oinstall 8704 Mar 30 15:57 1_25_794102915.dbf
SQL> recover database using backup controlfile;
ORA-00279: change 1005918 generated at 03/30/2013 13:52:50 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/1_23_794102915.dbf
ORA-00280: change 1005918 for thread 1 is in sequence #23
Specify log: {
/u01/app/oracle/arch/1_23_794102915.dbf
ORA-00279: change 1006360 generated at 03/30/2013 15:56:21 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/1_24_794102915.dbf
ORA-00280: change 1006360 for thread 1 is in sequence #24
ORA-00278: log file '/u01/app/oracle/arch/1_23_794102915.dbf' no longer needed
for this recovery
Specify log: {
/u01/app/oracle/arch/1_24_794102915.dbf
ORA-00279: change 1006363 generated at 03/30/2013 15:56:23 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/1_25_794102915.dbf
ORA-00280: change 1006363 for thread 1 is in sequence #25
ORA-00278: log file '/u01/app/oracle/arch/1_24_794102915.dbf' no longer needed
for this recovery
Specify log: {
/u01/app/oracle/arch/1_25_794102915.dbf
ORA-00279: change 1006379 generated at 03/30/2013 15:57:04 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/1_26_794102915.dbf
ORA-00280: change 1006379 for thread 1 is in sequence #26
ORA-00278: log file '/u01/app/oracle/arch/1_25_794102915.dbf' no longer needed
for this recovery
Specify log: {
/u01/app/oracle/oradata/orcl/redo01.log
ORA-00310: archived log contains sequence 25; sequence 26 required
ORA-00334: archived log: '/u01/app/oracle/oradata/orcl/redo01.log'
SQL> recover database using backup controlfile;
ORA-00279: change 1006379 generated at 03/30/2013 15:57:04 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/1_26_794102915.dbf
ORA-00280: change 1006379 for thread 1 is in sequence #26
Specify log: {
/u01/app/oracle/oradata/orcl/redo03.log
ORA-00310: archived log contains sequence 24; sequence 26 required
ORA-00334: archived log: '/u01/app/oracle/oradata/orcl/redo03.log'
SQL> recover database using backup controlfile;
ORA-00279: change 1006379 generated at 03/30/2013 15:57:04 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/1_26_794102915.dbf
ORA-00280: change 1006379 for thread 1 is in sequence #26
Specify log: {
/u01/app/oracle/oradata/orcl/redo02.log
Log applied.
Media recovery complete.
SQL>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/438414/viewspace-757467/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 與控制檔案有關的恢復
- 【RMAN】如果控制檔案損壞那麼如何恢復?恢復控制檔案的方式有哪幾種?
- 與控制檔案有關的恢復(二)
- [20210225]控制檔案序列號滿的恢復.txt
- RAC控制檔案恢復(三種不同情況)
- 同名檔案替換怎麼恢復,恢復同名檔案
- 【/proc/檔案淺析】另類辦法恢復資料檔案和控制檔案
- rman恢復控制檔案的一個小錯誤
- 檔案替換後怎麼恢復,恢復被覆蓋的檔案
- word怎麼恢復儲存前的檔案,word檔案恢復
- 檔案中勒索恢復
- word自動儲存的檔案怎麼恢復,word檔案恢復
- 剪下後的檔案可以恢復嗎?恢復剪下檔案怎麼辦?
- 剪下的檔案還能恢復嗎,恢復剪貼丟失的檔案
- eclipse 恢復誤刪檔案Eclipse
- 360粉碎檔案可以恢復嗎,如何恢復360強力刪除的檔案
- qq檔案失效怎麼恢復 qq已失效的檔案能不能恢復
- Linux恢復檔案雙手鐧Linux
- mysql 透過idb 恢復檔案MySql
- uninstall 後的檔案如何恢復
- 電腦檔案恢復軟體
- Git恢復刪除的檔案Git
- Oracle-無備份情況下,如何手動恢復控制檔案Oracle
- oracle控制檔案的損壞或完全丟失的恢復辦法Oracle
- U盤檔案被隱藏怎麼恢復 U盤檔案恢復隱藏的方法
- 行動硬碟刪除的檔案能恢復嗎,怎麼恢復硬碟刪除的檔案硬碟
- Oracle 檔案意外刪除恢復(Linux)OracleLinux
- 達夢資料庫手工恢復相關命令資料庫
- u盤檔案變成快捷方式怎麼恢復,恢復U盤檔案的五種方法
- 隨身碟檔案被隱藏怎麼恢復 隨身碟檔案恢復隱藏的方法
- XFS檔案系統的備份、恢復、修復
- Oracle為什麼使用備份的控制檔案恢復後一定要resetlogsOracle
- 【伺服器資料恢復】StorNext檔案系統資料恢復案例伺服器資料恢復
- ps檔案沒儲存怎麼恢復,一鍵恢復看這裡
- 資料恢復新姿勢——通過ibd和frm檔案恢復資料資料恢復
- 電腦檔案丟失資料恢復資料恢復
- Shift + Delete刪除的檔案如何恢復?delete
- 被誤刪的檔案快速恢復方法
- git恢復誤刪未提交的檔案Git