RMAN - "丟失控制檔案的恢復"
OS:
Oracle Linux Server release 5.7
DB:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
1.
如何獲取資料庫的DBID
由於DBID在控制檔案和資料檔案都存在記錄,所以如果能夠mount資料庫就可以查詢v$database檢視獲得
SQL> select dbid from v$database;
DBID
----------
675362528
SQL>
2.
在nomount狀態時
[root@yoon ~]# cd /u01/archivelog/
[root@yoon archivelog]# ls -lr
total 19872
-rw-r----- 1 oracle oinstall 10158080 Sep 15 12:47 c-675362528-20130915-01
-rw-r----- 1 oracle oinstall 10158080 Sep 11 16:20 c-675362528-20130911-01
[root@yoon archivelog]#
這裡的675362528就是DBID
3.
連線到RMAN
[oracle@yoon ~]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Sun Sep 15 12:56:09 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates.All rights reserved.
connected to target database (not started)
RMAN>
4.
關閉資料庫
RMAN> shutdown immediate
database closed
database dismounted
Oracle instance shut down
RMAN>
5.delete controlfile
RMAN> host;
[oracle@yoon ~]$ cd /u01/oracle/oradata/yoon/
[oracle@yoon yoon]$ rm -rf control01.ctl
[oracle@yoon yoon]$
6.由於目標資料庫控制檔案丟失,在此處必須指定dbid
RMAN> startup nomount
connected to target database (not started)
Oracle instance started
Total System Global Area1653518336 bytes
Fixed Size2228904 bytes
Variable Size956304728 bytes
Database Buffers687865856 bytes
Redo Buffers7118848 bytes
RMAN>
RMAN> set dbid 675362528
executing command: SET DBID
RMAN> restore controlfile from '/u01/archivelog/c-675362528-20130915-01';
Starting restore at 15-SEP-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/oracle/oradata/yoon/control01.ctl
output file name=/u01/oracle/fast_recovery_area/yoon/control02.ctl
Finished restore at 15-SEP-13
RMAN>
RMAN> sql 'alter database mount';
sql statement: alter database mount
released channel: ORA_DISK_1
RMAN>
RMAN> restore database;
Starting restore at 15-SEP-13
Starting implicit crosscheck backup at 15-SEP-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
Crosschecked 1 objects
Finished implicit crosscheck backup at 15-SEP-13
Starting implicit crosscheck copy at 15-SEP-13
using channel ORA_DISK_1
Finished implicit crosscheck copy at 15-SEP-13
searching for all files in the recovery area
cataloging files...
no files cataloged
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/oracle/oradata/yoon/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /u01/oracle/oradata/yoon/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/oracle/oradata/yoon/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/oracle/oradata/yoon/users01.dbf
channel ORA_DISK_1: reading from backup piece /u01/oracle/fast_recovery_area/YOON/backupset/2013_09_15/o1_mf_nnndf_TAG20130915T124630_93bgx6qx_.bkp
channel ORA_DISK_1: piece handle=/u01/oracle/fast_recovery_area/YOON/backupset/2013_09_15/o1_mf_nnndf_TAG20130915T124630_93bgx6qx_.bkp tag=TAG20130915T124630
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:05
Finished restore at 15-SEP-13
RMAN>
RMAN> recover database;
Starting recover at 15-SEP-13
using channel ORA_DISK_1
starting media recovery
archived log for thread 1 with sequence 1 is already on disk as file /u01/oracle/oradata/yoon/redo01.log
archived log file name=/u01/oracle/oradata/yoon/redo01.log thread=1 sequence=1
media recovery complete, elapsed time: 00:00:00
Finished recover at 15-SEP-13
RMAN>
RMAN> sql 'alter database open resetlogs';
sql statement: alter database open resetlogs
RMAN>
注意:because of‘resetlogs',建議立即對資料庫進行一次全備
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28939273/viewspace-1061484/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 控制檔案丟失的RMAN恢復
- rman恢復--丟失控制檔案的恢復
- 控制檔案丟失恢復
- 【控制檔案丟失恢復】
- 恢復丟失的控制檔案
- 只有rman備份集,控制檔案丟失的恢復
- 控制檔案全部丟失的恢復
- 控制檔案部分丟失的恢復
- 控制檔案丟失恢復(二)
- 控制檔案全部丟失恢復
- 探索ORACLE之RMAN_07 控制檔案丟失恢復Oracle
- RMAN恢復案例:無恢復目錄,丟失全部資料檔案、控制檔案、日誌檔案恢復
- RMAN恢復案例:丟失全部資料檔案恢復
- RMAN完全恢復丟失的資料檔案
- rman備份丟失控制檔案恢復
- 丟失全部控制檔案後從RMAN備份集中恢復示例
- 當前控制檔案全部丟失恢復
- rman恢復:資料檔案丟失,控制檔案丟失,聯機日誌檔案丟失(非當前使用與當前使用)
- RMAN恢復案例:丟失非系統資料檔案恢復
- rman恢復--歸檔模式有備份,丟失資料檔案的恢復模式
- rman恢復--歸檔模式無備份,丟失資料檔案的恢復模式
- rman 恢復---歸檔丟失and資料檔案損壞
- 全部控制檔案丟失後的完全恢復(轉)
- 【rman 備份與恢復】恢復丟失所有的控制檔案
- 模擬控制檔案丟失進行恢復。
- 恢復案例:無歸檔,掉電,控制檔案全部丟失恢復
- 恢復之丟失全部控制檔案以及備份中的控制檔案
- 恢復案例:無歸檔,丟失全部控制檔案、日誌檔案恢復案例
- 【備份恢復】 丟失一個控制檔案 之恢復操作
- RMAN恢復控制檔案
- 引數檔案控制檔案和資料檔案丟失的恢復
- 利用rman做資料檔案丟失的恢復實驗
- 【恢復】Redo日誌檔案丟失的恢復
- 資料檔案丟失的恢復
- Oracle Password檔案丟失的恢復Oracle
- 非歸檔無備份下控制檔案丟失的恢復
- RMAN基於備份控制檔案恢復失敗
- 【備份恢復】丟失所有控制檔案,利用RMAN進行恢復操作