RMAN 恢復之控制檔案篇(4/5)

djb1008發表於2011-06-07

1.4 場景三:使用全備份後產生的控制檔案進行備份恢復

1.4.1 模擬災難發生

SQL> shutdown abort;

[oracle@restoretest gcwz_web]$ rm *

[@more@]

1.4.2 恢復控制檔案

[oracle@restoretest gcwz_web]$ sqlplus / as sysdba

SQL> startup nomount

[oracle@restoretest gcwz_web]$ rman target /

RMAN> restore controlfile from '/rman/control_73';

output filename=/oradata/gcwz_web/control01.ctl

output filename=/oradata/gcwz_web/control02.ctl

output filename=/oradata/gcwz_web/control03.ctl

Finished restore at 02-FEB-10

1.4.3 登記最新的rman備份資訊

RMAN> sql 'alter database mount';

RMAN> catalog start with '/rman/';

searching for all files that match the pattern /rman/

List of Files Unknown to the Database

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

File Name: /rman/cntrl_69_1_709899322

File Name: /rman/control_73

Do you really want to catalog the above files (enter YES or NO)? yes

cataloging files...

cataloging done

List of Cataloged Files

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

File Name: /rman/cntrl_69_1_709899322

File Name: /rman/control_73

RMAN> catalog start with '/archivelog/';

searching for all files that match the pattern /archivelog/

no files found to be unknown to the database

RMAN> list archivelog all;

List of Archived Log Copies

Key Thrd Seq S Low Time Name

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

40 1 58 A 01-FEB-10 /archivelog/1_58_690800133.dbf

41 1 59 A 01-FEB-10 /archivelog/1_59_690800133.dbf

42 1 60 A 02-FEB-10 /archivelog/1_60_690800133.dbf

1.4.4 資料庫resotrerecover

RMAN> restore database;

restoring datafile 00001 to /oradata/gcwz_web/system01.dbf

restoring datafile 00002 to /oradata/gcwz_web/undotbs01.dbf

restoring datafile 00003 to /oradata/gcwz_web/sysaux01.dbf

restoring datafile 00004 to /oradata/gcwz_web/users01.dbf

restoring datafile 00005 to /oradata/gcwz_web/test01.dbf

channel ORA_DISK_1: reading from backup piece /rman/full_71_709900579_1

channel ORA_DISK_1: restored backup piece 1

piece handle=/rman/full_71_709900579_1 tag=TAG20100202T103618

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

Finished restore at 02-FEB-10

RMAN> recover database;

archive log thread 1 sequence 60 is already on disk as file /archivelog/1_60_690800133.dbf

archive log filename=/archivelog/1_60_690800133.dbf thread=1 sequence=60

unable to find archive log

archive log thread=1 sequence=61

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of recover command at 02/02/2010 17:35:25

RMAN-06054: media recovery requesting unknown log: thread 1 seq 61 lowscn 1130034

RMAN> sql 'alter database open resetlogs';

sql statement: alter database open resetlogs

SQL> select open_mode,name from v$database;

OPEN_MODE NAME

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

READ WRITE GCWZ_WEB

上一篇: RMAN 恢復之控制檔案篇(3/5)

下一篇: RMAN 恢復之控制檔案篇(5/5)

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

相關文章