ITPub博客

首页 > 数据库 > Oracle > RMAN 恢复之控制文件篇(3/5)

RMAN 恢复之控制文件篇(3/5)

原创 Oracle 作者:djb1008 时间:2011-06-07 11:27:42 0 删除 编辑

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 数据库restore和recover

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博客 ” ,链接:https://blog.itpub.net/32980/viewspace-1050880/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-07-27

  • 博文量
    175
  • 访问量
    778869