RMAN恢復 執行重要檔案RMAN恢復

dbhelper發表於2014-11-27

 

如果丟失資料檔案在system和undo表空間,就視為重要資料檔案,必須停掉資料庫進行恢復

 

步驟:

1、如果資料庫仍處於開啟狀態,shutdown abort

2、startup mount

3、restore

4、recover

5、open

 

 

模擬刪除sysaux.dbf

mv /home/oracle/app/oracle/oradata/sap/sysaux01.dbf /home/oracle/app/oracle/oradata/sap/sysaux01.dbf_del

測試資料庫暫時仍可用

 

使用shutdown immediate仍可以

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

 

 

啟動報錯

SQL> startup

ORACLE instance started.

Total System Global Area 830930944 bytes

Fixed Size                 2217912 bytes

Variable Size                 503318600 bytes

Database Buffers         318767104 bytes

Redo Buffers                 6627328 bytes

Database mounted.

ORA-01157: cannot identify/lock data file 2 - see DBWR trace file

ORA-01110: data file 2: '/home/oracle/app/oracle/oradata/sap/sysaux01.dbf'

 

 

RMAN> list failure

2> ;

List of Database Failures

=========================

Failure ID Priority Status Time Detected Summary

---------- -------- --------- ------------- -------

1062 HIGH OPEN 03-MAR-14 One or more non-system datafiles are missing

1088 HIGH OPEN 03-MAR-14 Tablespace 4: 'USERS' is offline

 

 

RMAN> restore tablespace sysaux;

Starting restore at 03-MAR-14

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=129 device type=DISK

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 00002 to /home/oracle/app/oracle/oradata/sap/sysaux01.dbf

channel ORA_DISK_1: reading from backup piece /rman_bak/1dp27q4q_1_1

channel ORA_DISK_1: piece handle=/rman_bak/1dp27q4q_1_1 tag=LZTESTARCH

channel ORA_DISK_1: restored backup piece 1

channel ORA_DISK_1: restore complete, elapsed time: 00:00:45

Finished restore at 03-MAR-14

 

 

RMAN> recover tablespace sysaux;

Starting recover at 03-MAR-14

using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 12 is already on disk as file /home/oracle/app/oracle/flash_recovery_area/SAP/archivelog/2014_03_03/o1_mf_1_12_9k94tm0c_.arc

archived log for thread 1 with sequence 13 is already on disk as file /home/oracle/app/oracle/flash_recovery_area/SAP/archivelog/2014_03_03/o1_mf_1_13_9kbhlkwh_.arc

archived log for thread 1 with sequence 14 is already on disk as file /home/oracle/app/oracle/flash_recovery_area/SAP/archivelog/2014_03_03/o1_mf_1_14_9kbhm25o_.arc

archived log for thread 1 with sequence 15 is already on disk as file /home/oracle/app/oracle/flash_recovery_area/SAP/archivelog/2014_03_03/o1_mf_1_15_9kbhmfx5_.arc

archived log for thread 1 with sequence 16 is already on disk as file /home/oracle/app/oracle/flash_recovery_area/SAP/archivelog/2014_03_03/o1_mf_1_16_9kbhmsw5_.arc

archived log for thread 1 with sequence 17 is already on disk as file /home/oracle/app/oracle/flash_recovery_area/SAP/archivelog/2014_03_03/o1_mf_1_17_9kbhn87m_.arc

archived log for thread 1 with sequence 18 is already on disk as file /home/oracle/app/oracle/flash_recovery_area/SAP/archivelog/2014_03_03/o1_mf_1_18_9kbhtkfl_.arc

archived log for thread 1 with sequence 19 is already on disk as file /home/oracle/app/oracle/flash_recovery_area/SAP/archivelog/2014_03_03/o1_mf_1_19_9kbhvogj_.arc

archived log for thread 1 with sequence 20 is already on disk as file /home/oracle/app/oracle/flash_recovery_area/SAP/archivelog/2014_03_03/o1_mf_1_20_9kbhwctk_.arc

archived log for thread 1 with sequence 21 is already on disk as file /home/oracle/app/oracle/flash_recovery_area/SAP/archivelog/2014_03_03/o1_mf_1_21_9kbhxcrg_.arc

archived log for thread 1 with sequence 22 is already on disk as file /home/oracle/app/oracle/flash_recovery_area/SAP/archivelog/2014_03_03/o1_mf_1_22_9kbhy5nw_.arc

archived log file name=/home/oracle/app/oracle/flash_recovery_area/SAP/archivelog/2014_03_03/o1_mf_1_12_9k94tm0c_.arc thread=1 sequence=12

archived log file name=/home/oracle/app/oracle/flash_recovery_area/SAP/archivelog/2014_03_03/o1_mf_1_13_9kbhlkwh_.arc thread=1 sequence=13

archived log file name=/home/oracle/app/oracle/flash_recovery_area/SAP/archivelog/2014_03_03/o1_mf_1_14_9kbhm25o_.arc thread=1 sequence=14

archived log file name=/home/oracle/app/oracle/flash_recovery_area/SAP/archivelog/2014_03_03/o1_mf_1_15_9kbhmfx5_.arc thread=1 sequence=15

archived log file name=/home/oracle/app/oracle/flash_recovery_area/SAP/archivelog/2014_03_03/o1_mf_1_16_9kbhmsw5_.arc thread=1 sequence=16

archived log file name=/home/oracle/app/oracle/flash_recovery_area/SAP/archivelog/2014_03_03/o1_mf_1_17_9kbhn87m_.arc thread=1 sequence=17

archived log file name=/home/oracle/app/oracle/flash_recovery_area/SAP/archivelog/2014_03_03/o1_mf_1_18_9kbhtkfl_.arc thread=1 sequence=18

archived log file name=/home/oracle/app/oracle/flash_recovery_area/SAP/archivelog/2014_03_03/o1_mf_1_19_9kbhvogj_.arc thread=1 sequence=19

archived log file name=/home/oracle/app/oracle/flash_recovery_area/SAP/archivelog/2014_03_03/o1_mf_1_20_9kbhwctk_.arc thread=1 sequence=20

media recovery complete, elapsed time: 00:00:09

Finished recover at 03-MAR-14

 

 

SQL> alter database open;

Database altered.

 

恢復 完成

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8494287/viewspace-1349474/,如需轉載,請註明出處,否則將追究法律責任。

相關文章