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

djb1008發表於2011-06-07

1.3 場景二:使用全備份時產生的控制檔案進行備份恢復

1.3.1 模擬災難發生

[oracle@restoretest ~]$ sqlplus / as sysdba

SQL> shutdown abort;

$ cd /oradata/gcwz_web/

[oracle@restoretest gcwz_web]$ rm *

[@more@]

1.3.2 恢復控制檔案

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

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.3.3 登記最新的rman備份資訊

RMAN> sql 'alter database mount';

RMAN> catalog start with '/rman/';

List of Cataloged Files

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

File Name: /oracle/flash_recovery_area/GCWZ_WEB/autobackup/2010_02_01/o1_mf_s_709838623_5pf7dzy9_.bkp

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/full_72_709900586_1

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/full_72_709900586_1

File Name: /rman/control_73

RMAN> catalog start with '/archivelog/';

searching for all files that match the pattern /archivelog/

List of Files Unknown to the Database

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

File Name: /archivelog/1_60_690800133.dbf

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

cataloging files...

cataloging done

List of Cataloged Files

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

File Name: /archivelog/1_60_690800133.dbf

1.3.4 資料庫restorerecover

RMAN> restore database;

Starting restore at 02-FEB-10

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backupset restore

channel ORA_DISK_1: specifying datafile(s) to restore from backup set

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

[oracle@restoretest gcwz_web]$ sqlplus / as sysdba

SQL> recover database using backup controlfile ;

ORA-00279: change 1129995 generated at 02/02/2010 10:36:19 needed for thread 1

ORA-00289: suggestion : /archivelog/1_60_690800133.dbf

ORA-00280: change 1129995 for thread 1 is in sequence #60

Specify log: {=suggested | filename | AUTO | CANCEL}

ORA-00279: change 1130034 generated at 02/02/2010 10:37:21 needed for thread 1

ORA-00289: suggestion : /archivelog/1_61_690800133.dbf

ORA-00280: change 1130034 for thread 1 is in sequence #61

ORA-00278: log file '/archivelog/1_60_690800133.dbf' no longer needed for this

recovery

Specify log: {=suggested | filename | AUTO | CANCEL}

cancel

Media recovery cancelled.

SQL> alter database open resetlogs;

Database altered.

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

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

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

相關文章