1、 SYSTEM資料表空間資料檔案丟失恢複
注意:以下的所有實驗,都是基於上面的全庫備份來做的恢複。
3.1 刪除system資料表空間的所有資料檔案。
[Oracle@wwldb WWL]$ rm -rf syste*
[oracle@wwldb WWL]$ exit
3.2 再次啟動資料庫報錯。
SQL> startup force
ORACLE instance started.
Total System GlobalArea 285212672 bytes
Fixed Size 1218968 bytes
Variable Size 104859240 bytes
Database Buffers 171966464 bytes
Redo Buffers 7168000 bytes
Database mounted.
ORA-01157: cannotidentify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1:'/DBData/WWL/system01.dbf'
3.3 檢查追蹤檔案,分析錯誤。
Errors in file /DBSoft/admin/WWL/bdump/wwl_dbw0_4600.trc:
ORA-01157: Message 1157 not found; No message file for product=RDBMS,facility=ORA; arguments: [1]
ORA-01110: Message 1110 not found; No message file for product=RDBMS,facility=ORA; arguments: [1] [/DBData/WWL/system01.dbf]
ORA-27037: Message 27037 not found; No message file for product=RDBMS,facility=ORA
Linux Error: 2: No such file or directory
Additional information: 3
ORA-1157 signalled during: ALTER DATABASE OPEN...
由如上記錄檔我們得出是由於/DBData/WWL/system01.dbf檔案丟失,而且這個檔案同時又是system資料表空間的的資料檔案,因為system資料表空間存放了資料字典資訊,所以該資料檔案是不可以採用離線的方式實現線上的的恢複。
3.4恢複system資料表空間資料檔案
開始執行恢複分為五個步驟
1、強制啟動資料庫到mount狀態
SQL> startup force mount;
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218968 bytes
Variable Size 104859240 bytes
Database Buffers 171966464 bytes
Redo Buffers 7168000 bytes
Database mounted.
SQL>
2、Restore出來system資料表空間的資料檔案
RMAN> restore datafile 1;
Starting restore at 22-JUN-12
using target database control file instead of recoverycatalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
channel ORA_DISK_1: starting datafile backupsetrestore
channel ORA_DISK_1: specifying datafile(s) to restorefrom backup set
restoring datafile 00001 to /DBData/WWL/system01.dbf
channel ORA_DISK_1: reading from backup piece/DBBak/bak_WWL_06_22_0vne4ph6_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/DBBak/bak_WWL_06_22_0vne4ph6_1_1tag=TAG20120622T010021
channel ORA_DISK_1: restore complete, elapsed time:00:01:06
Finished restore at 22-JUN-12
3、執行system資料表空間資料恢複。
RMAN> recover datafile 1;
Starting recover at 22-JUN-12
using channel ORA_DISK_1
starting media recovery
archive log thread 1 sequence 20 is already on diskas file/DBData/flash_recovery_area/WWL/archivelog/2012_06_22/o1_mf_1_20_7y804kwr_.arc
archive log thread 1 sequence 21 is already on diskas file/DBData/flash_recovery_area/WWL/archivelog/2012_06_22/o1_mf_1_21_7y80zjqx_.arc
archive log thread 1 sequence 22 is already on diskas file /DBData/flash_recovery_area/WWL/archivelog/2012_06_22/o1_mf_1_22_7y8y7l70_.arc
archive log thread 1 sequence 23 is already on diskas file/DBData/flash_recovery_area/WWL/archivelog/2012_06_22/o1_mf_1_23_7y903v17_.arc
archive logfilename=/DBData/flash_recovery_area/WWL/archivelog/2012_06_22/o1_mf_1_20_7y804kwr_.arcthread=1 sequence=20
archive logfilename=/DBData/flash_recovery_area/WWL/archivelog/2012_06_22/o1_mf_1_21_7y80zjqx_.arcthread=1 sequence=21
media recovery complete, elapsed time: 00:00:02
Finished recover at 22-JUN-12
4、Open資料庫
SQL> alter database open;
Database altered.
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
WWL OPEN
SQL>
相關閱讀:
探索Oracle之RMAN_01概念
探索Oracle之RMAN_02基本使用
探索Oracle之RMAN_03非一致性備份
探索Oracle之RMAN_04非一致性備份
探索Oracle之RMAN_05增量備份
探索Oracle之RMAN_06備份策略
探索Oracle之RMAN_07單個資料檔案丟失恢複
探索Oracle之RMAN_07整個業務資料表空間丟失恢複
探索Oracle之RMAN_07 磁碟損壞資料丟失恢複
探索Oracle之RMAN_07 資料庫所有檔案全部丟失恢複
探索Oracle之RMAN_07 重做日誌redu檔案丟失恢複
探索Oracle之RMAN_07 參數檔案丟失恢複
探索Oracle之RMAN_07控制檔案丟失恢複
探索Oracle之RMAN_07 system資料表空間丟失恢複