恢復丟失的控制檔案
1.刪除所有控制檔案
-bash-3.2$ cd
-bash-3.2$ cd oradata
-bash-3.2$ ls
mydb
-bash-3.2$ cd mydb
-bash-3.2$ ls
cat01.dbf control01.ctl redo01.log redo02.log redo03.log sysaux01.dbf system01.dbf temp01.dbf test01.dbf undotbs01.dbf users01.dbf
-bash-3.2$ rm control*
-bash-3.2$ ls
cat01.dbf redo01.log redo02.log redo03.log sysaux01.dbf system01.dbf temp01.dbf test01.dbf undotbs01.dbf users01.dbf
-bash-3.2$
-bash-3.2$ cd
-bash-3.2$ cd oradata
-bash-3.2$ ls
mydb
-bash-3.2$ cd mydb
-bash-3.2$ ls
cat01.dbf control01.ctl redo01.log redo02.log redo03.log sysaux01.dbf system01.dbf temp01.dbf test01.dbf undotbs01.dbf users01.dbf
-bash-3.2$ rm control*
-bash-3.2$ ls
cat01.dbf redo01.log redo02.log redo03.log sysaux01.dbf system01.dbf temp01.dbf test01.dbf undotbs01.dbf users01.dbf
-bash-3.2$
-bash-3.2$ cd fast_recovery_area/
-bash-3.2$ ls
mydb
-bash-3.2$ cd mydb
-bash-3.2$ ls
control02.ctl
-bash-3.2$ mv control02.ctl /opt/oracle/control01.ctl
-bash-3.2$ ls
-bash-3.2$ sqlplus /nolog
-bash-3.2$ ls
mydb
-bash-3.2$ cd mydb
-bash-3.2$ ls
control02.ctl
-bash-3.2$ mv control02.ctl /opt/oracle/control01.ctl
-bash-3.2$ ls
-bash-3.2$ sqlplus /nolog
SQL*Plus: Release 11.2.0.3.0 Production on Mon Oct 21 16:53:48 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
SQL> connect / as sysdba
Connected.
SQL> select instance_name from v$instance;
Connected.
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
mydb
----------------
mydb
SQL> shutdown immediate;
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/opt/oracle/oradata/mydb/control01.ctl'
ORA-27041: unable to open file
Linux Error: 2: No such file or directory
Additional information: 3
SQL> shutdown abort
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/opt/oracle/oradata/mydb/control01.ctl'
ORA-27041: unable to open file
Linux Error: 2: No such file or directory
Additional information: 3
SQL> shutdown abort
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 627732480 bytes
Fixed Size 1346756 bytes
Variable Size 415236924 bytes
Database Buffers 201326592 bytes
Redo Buffers 9822208 bytes
ORA-00205: error in identifying control file, check alert log for more info
Fixed Size 1346756 bytes
Variable Size 415236924 bytes
Database Buffers 201326592 bytes
Redo Buffers 9822208 bytes
ORA-00205: error in identifying control file, check alert log for more info
2.恢復過程
-bash-3.2$ rman
Recovery Manager: Release 11.2.0.3.0 - Production on Mon Oct 21 16:55:10 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
RMAN> connect target /
connected to target database: mydb (not mounted)
RMAN> restore controlfile from autobackup;
Starting restore at 21-OCT-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
recovery area destination: /opt/oracle/fast_recovery_area
database name (or database unique name) used for search: mydb
channel ORA_DISK_1: AUTOBACKUP /opt/oracle/fast_recovery_area/mydb/autobackup/2013_10_21/o1_mf_s_829409774_969pcgrx_.bkp found in the recovery area
AUTOBACKUP search with format "%F" not attempted because DBID was not set
channel ORA_DISK_1: restoring control file from AUTOBACKUP /opt/oracle/fast_recovery_area/mydb/autobackup/2013_10_21/o1_mf_s_829409774_969pcgrx_.bkp
channel ORA_DISK_1: control file restore from AUTOBACKUP complete
output file name=/opt/oracle/oradata/mydb/control01.ctl
output file name=/opt/oracle/fast_recovery_area/mydb/control02.ctl
Finished restore at 21-OCT-13
database name (or database unique name) used for search: mydb
channel ORA_DISK_1: AUTOBACKUP /opt/oracle/fast_recovery_area/mydb/autobackup/2013_10_21/o1_mf_s_829409774_969pcgrx_.bkp found in the recovery area
AUTOBACKUP search with format "%F" not attempted because DBID was not set
channel ORA_DISK_1: restoring control file from AUTOBACKUP /opt/oracle/fast_recovery_area/mydb/autobackup/2013_10_21/o1_mf_s_829409774_969pcgrx_.bkp
channel ORA_DISK_1: control file restore from AUTOBACKUP complete
output file name=/opt/oracle/oradata/mydb/control01.ctl
output file name=/opt/oracle/fast_recovery_area/mydb/control02.ctl
Finished restore at 21-OCT-13
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
released channel: ORA_DISK_1
RMAN> alter database open resetlogs;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 10/21/2013 16:56:55
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/opt/oracle/oradata/mydb/system01.dbf'
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 10/21/2013 16:56:55
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/opt/oracle/oradata/mydb/system01.dbf'
RMAN> recover database;
Starting recover at 21-OCT-13
Starting implicit crosscheck backup at 21-OCT-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
Crosschecked 9 objects
Finished implicit crosscheck backup at 21-OCT-13
Starting implicit crosscheck backup at 21-OCT-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
Crosschecked 9 objects
Finished implicit crosscheck backup at 21-OCT-13
Starting implicit crosscheck copy at 21-OCT-13
using channel ORA_DISK_1
Crosschecked 1 objects
Finished implicit crosscheck copy at 21-OCT-13
using channel ORA_DISK_1
Crosschecked 1 objects
Finished implicit crosscheck copy at 21-OCT-13
searching for all files in the recovery area
cataloging files...
cataloging done
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /opt/oracle/fast_recovery_area/mydb/autobackup/2013_10_21/o1_mf_s_829409774_969pcgrx_.bkp
=======================
File Name: /opt/oracle/fast_recovery_area/mydb/autobackup/2013_10_21/o1_mf_s_829409774_969pcgrx_.bkp
using channel ORA_DISK_1
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=12 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: WARNING: Oracle Test Disk API
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=12 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: WARNING: Oracle Test Disk API
starting media recovery
archived log for thread 1 with sequence 20 is already on disk as file /opt/oracle/oradata/mydb/redo02.log
archived log file name=/opt/oracle/oradata/mydb/redo02.log thread=1 sequence=20
media recovery complete, elapsed time: 00:00:01
Finished recover at 21-OCT-13
archived log file name=/opt/oracle/oradata/mydb/redo02.log thread=1 sequence=20
media recovery complete, elapsed time: 00:00:01
Finished recover at 21-OCT-13
RMAN> alter database open resetlogs;
database opened
RMAN> backup database;
Starting backup at 21-OCT-13
released channel: ORA_SBT_TAPE_1
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/opt/oracle/oradata/mydb/system01.dbf
input datafile file number=00002 name=/opt/oracle/oradata/mydb/sysaux01.dbf
input datafile file number=00005 name=/opt/oracle/oradata/mydb/cat01.dbf
input datafile file number=00003 name=/opt/oracle/oradata/mydb/undotbs01.dbf
input datafile file number=00006 name=/opt/oracle/oradata/mydb/test01.dbf
input datafile file number=00004 name=/opt/oracle/oradata/mydb/users01.dbf
channel ORA_DISK_1: starting piece 1 at 21-OCT-13
channel ORA_DISK_1: finished piece 1 at 21-OCT-13
piece handle=/opt/oracle/fast_recovery_area/mydb/backupset/2013_10_21/o1_mf_nnndf_TAG20131021T165748_969v4djs_.bkp tag=TAG20131021T165748 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
Finished backup at 21-OCT-13
released channel: ORA_SBT_TAPE_1
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/opt/oracle/oradata/mydb/system01.dbf
input datafile file number=00002 name=/opt/oracle/oradata/mydb/sysaux01.dbf
input datafile file number=00005 name=/opt/oracle/oradata/mydb/cat01.dbf
input datafile file number=00003 name=/opt/oracle/oradata/mydb/undotbs01.dbf
input datafile file number=00006 name=/opt/oracle/oradata/mydb/test01.dbf
input datafile file number=00004 name=/opt/oracle/oradata/mydb/users01.dbf
channel ORA_DISK_1: starting piece 1 at 21-OCT-13
channel ORA_DISK_1: finished piece 1 at 21-OCT-13
piece handle=/opt/oracle/fast_recovery_area/mydb/backupset/2013_10_21/o1_mf_nnndf_TAG20131021T165748_969v4djs_.bkp tag=TAG20131021T165748 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
Finished backup at 21-OCT-13
Starting Control File and SPFILE Autobackup at 21-OCT-13
piece handle=/opt/oracle/fast_recovery_area/mydb/autobackup/2013_10_21/o1_mf_s_829414693_969v55wl_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 21-OCT-13
piece handle=/opt/oracle/fast_recovery_area/mydb/autobackup/2013_10_21/o1_mf_s_829414693_969v55wl_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 21-OCT-13
RMAN> delete noprompt obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 2
using channel ORA_DISK_1
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=12 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: WARNING: Oracle Test Disk API
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set 6 16-OCT-13
Backup Piece 6 16-OCT-13 07omie6a_1_1
Backup Set 7 16-OCT-13
Backup Piece 7 16-OCT-13 c-599395733-20131016-02
RMAN retention policy is set to redundancy 2
using channel ORA_DISK_1
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=12 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: WARNING: Oracle Test Disk API
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set 6 16-OCT-13
Backup Piece 6 16-OCT-13 07omie6a_1_1
Backup Set 7 16-OCT-13
Backup Piece 7 16-OCT-13 c-599395733-20131016-02
RMAN-06207: WARNING: 2 objects could not be deleted for SBT_TAPE channel(s) due
RMAN-06208: to mismatched status. Use CROSSCHECK command to fix status
RMAN-06210: List of Mismatched objects
RMAN-06211: ==========================
RMAN-06212: Object Type Filename/Handle
RMAN-06213: --------------- ---------------------------------------------------
RMAN-06214: Backup Piece 07omie6a_1_1
RMAN-06214: Backup Piece c-599395733-20131016-02
RMAN-06208: to mismatched status. Use CROSSCHECK command to fix status
RMAN-06210: List of Mismatched objects
RMAN-06211: ==========================
RMAN-06212: Object Type Filename/Handle
RMAN-06213: --------------- ---------------------------------------------------
RMAN-06214: Backup Piece 07omie6a_1_1
RMAN-06214: Backup Piece c-599395733-20131016-02
RMAN> crosscheck backupset;
using channel ORA_DISK_1
using channel ORA_SBT_TAPE_1
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/opt/oracle/backup/mydb_09omus2q_1_1.dbf RECID=8 STAMP=829386842
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/opt/oracle/fast_recovery_area/mydb/autobackup/2013_10_21/o1_mf_s_829414653_969v3xg9_.bkp RECID=12 STAMP=829414653
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/opt/oracle/fast_recovery_area/mydb/backupset/2013_10_21/o1_mf_nnndf_TAG20131021T165748_969v4djs_.bkp RECID=13 STAMP=829414668
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/opt/oracle/fast_recovery_area/mydb/autobackup/2013_10_21/o1_mf_s_829414693_969v55wl_.bkp RECID=14 STAMP=829414693
Crosschecked 4 objects
using channel ORA_SBT_TAPE_1
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/opt/oracle/backup/mydb_09omus2q_1_1.dbf RECID=8 STAMP=829386842
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/opt/oracle/fast_recovery_area/mydb/autobackup/2013_10_21/o1_mf_s_829414653_969v3xg9_.bkp RECID=12 STAMP=829414653
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/opt/oracle/fast_recovery_area/mydb/backupset/2013_10_21/o1_mf_nnndf_TAG20131021T165748_969v4djs_.bkp RECID=13 STAMP=829414668
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/opt/oracle/fast_recovery_area/mydb/autobackup/2013_10_21/o1_mf_s_829414693_969v55wl_.bkp RECID=14 STAMP=829414693
Crosschecked 4 objects
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=07omie6a_1_1 RECID=6 STAMP=828979402
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=c-599395733-20131016-02 RECID=7 STAMP=828979403
Crosschecked 2 objects
backup piece handle=07omie6a_1_1 RECID=6 STAMP=828979402
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=c-599395733-20131016-02 RECID=7 STAMP=828979403
Crosschecked 2 objects
RMAN> delete noprompt obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 2
using channel ORA_DISK_1
using channel ORA_SBT_TAPE_1
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set 6 16-OCT-13
Backup Piece 6 16-OCT-13 07omie6a_1_1
Backup Set 7 16-OCT-13
Backup Piece 7 16-OCT-13 c-599395733-20131016-02
deleted backup piece
backup piece handle=07omie6a_1_1 RECID=6 STAMP=828979402
deleted backup piece
backup piece handle=c-599395733-20131016-02 RECID=7 STAMP=828979403
Deleted 2 objects
RMAN retention policy is set to redundancy 2
using channel ORA_DISK_1
using channel ORA_SBT_TAPE_1
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set 6 16-OCT-13
Backup Piece 6 16-OCT-13 07omie6a_1_1
Backup Set 7 16-OCT-13
Backup Piece 7 16-OCT-13 c-599395733-20131016-02
deleted backup piece
backup piece handle=07omie6a_1_1 RECID=6 STAMP=828979402
deleted backup piece
backup piece handle=c-599395733-20131016-02 RECID=7 STAMP=828979403
Deleted 2 objects
RMAN> exit
Recovery Manager complete.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26870952/viewspace-774770/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 剪下的檔案還能恢復嗎,恢復剪貼丟失的檔案
- oracle控制檔案的損壞或完全丟失的恢復辦法Oracle
- 丟失的隨身碟檔案如何恢復?
- 電腦檔案丟失資料恢復資料恢復
- Sql Server資料庫檔案丟失的恢復方法SQLServer資料庫
- DATA GUARD主庫丟失資料檔案的恢復(3)
- DATA GUARD主庫丟失資料檔案的恢復(1)
- DATA GUARD主庫丟失資料檔案的恢復(2)
- 【BBED】丟失歸檔檔案情況下的恢復
- macOS Big Sur系統如何恢復丟失的資料檔案?Mac
- 存放在電腦中的檔案丟失了怎麼恢復
- win10 ppt檔案丟失怎麼恢復_win10 ppt文件丟失如何找回Win10
- 【北亞資料恢復】MongoDB資料遷移檔案丟失的MongoDB資料恢復案例資料恢復MongoDB
- 【資料庫資料恢復】mdb_catalog.wt檔案丟失的MongoDB資料恢復案例資料庫資料恢復MongoDB
- 【伺服器資料恢復】xfs檔案系統資料丟失的資料恢復案例伺服器資料恢復
- 2.7.10 恢復丟失或損壞的伺服器引數檔案(SPFILE)伺服器
- 檔案丟失不用怕:超實用的Mac資料恢復軟體!Mac資料恢復
- 【資料庫資料恢復】Sql Server資料庫檔案丟失的資料恢復過程資料庫資料恢復SQLServer
- Oracle Redo丟失恢復方案Oracle
- 伺服器資料丟失了怎麼恢復/分割槽丟失恢復教程伺服器
- dg丟失歸檔,使用rman增量備份恢復
- 與控制檔案有關的恢復
- 新建的表空間(或資料檔案)丟失以及控制檔案丟失,有新建表空間(或資料檔案)前的控制文
- 【虛擬機器資料恢復】Hyper-V虛擬化檔案丟失的資料恢復案例虛擬機資料恢復
- 【RMAN】如果控制檔案損壞那麼如何恢復?恢復控制檔案的方式有哪幾種?
- 硬碟資料丟失如何恢復?硬碟
- 分割槽丟失資料恢復資料恢復
- 資料庫資料恢復—MongoDB資料庫檔案丟失,啟動報錯的資料恢復案例資料庫資料恢復MongoDB
- 與控制檔案有關的恢復(二)
- chkdsk 後資料丟失的恢復方法
- MongoDB資料庫報錯,資料庫檔案丟失資料恢復案例MongoDB資料庫資料恢復
- wps檔案丟失如何恢復?找回只需要用到一招
- 伺服器資料恢復—重灌系統導致XFS檔案系統分割槽丟失的資料恢復案例伺服器資料恢復
- 【Vsan資料恢復】斷電導致Vsan分散式儲存虛擬磁碟檔案丟失的資料恢復案例資料恢復分散式
- 【伺服器資料恢復】虛擬機器檔案丟失導致Hyper-V癱瘓的資料恢復伺服器資料恢復虛擬機
- [20210225]控制檔案序列號滿的恢復.txt
- 【伺服器資料恢復】XFS檔案系統分割槽分割槽丟失無法訪問的資料恢復案例伺服器資料恢復
- 【伺服器資料恢復】SAN LUN對映出錯導致檔案系統資料丟失的資料恢復案例伺服器資料恢復
- 伺服器RAID資料丟失恢復伺服器AI