oracle备份之rman_恢复控制文件

测试环境:redhat 5.5  oracle 11g

RMAN> backup database;


Starting backup at 21-DEC-17
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00008 name=/opt/oracle/oradata/ORCL2/users03.dbf
input datafile file number=00001 name=/opt/oracle/oradata/ORCL/system01.dbf
input datafile file number=00002 name=/opt/oracle/oradata/ORCL/sysaux01.dbf
input datafile file number=00004 name=/opt/oracle/oradata/ORCL/users01.dbf
input datafile file number=00005 name=/opt/oracle/oradata/ORCL/data161123.dbf
input datafile file number=00011 name=/opt/oracle/oradata/ORCL2/undotbs03.dbf
channel ORA_DISK_1: starting piece 1 at 21-DEC-17
channel ORA_DISK_1: finished piece 1 at 21-DEC-17
piece handle=/opt/oracle/oradata/ORCL2/1csmlsoe_1_1_ORCL tag=TAG20171221T101230 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:12
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00003 name=/opt/oracle/oradata/ORCL2/users02.dbf
input datafile file number=00006 name=/opt/oracle/oradata/ORCL2/km0711.dbf
input datafile file number=00007 name=/opt/oracle/oradata/ORCL2/km0628.dbf
channel ORA_DISK_1: starting piece 1 at 21-DEC-17
channel ORA_DISK_1: finished piece 1 at 21-DEC-17
piece handle=/opt/oracle/oradata/ORCL2/1dsmlsoq_1_1_ORCL tag=TAG20171221T101230 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 21-DEC-17


Starting Control File and SPFILE Autobackup at 21-DEC-17
piece handle=/opt/oracle/flash_recovery_area/ORCL/autobackup/2017_12_21/o1_mf_s_963310363_f3p64ww2_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 21-DEC-17


RMAN> shutdown immediate;

database closed
database dismounted
Oracle instance shut down


此时,故意把:/opt/oracle/oradata/ORCL/control01.ctl   改成  control01.ctl_1221


RMAN> startup;


connected to target database (not started)
Oracle instance started
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 12/21/2017 10:16:09
ORA-00205: error in identifying control file, check alert log for more info


RMAN> startup nomount;

database is already started


RMAN> RESTORE CONTROLFILE FROM '/opt/oracle/flash_recovery_area/ORCL/autobackup/2017_12_21/o1_mf_s_963310363_f3p64ww2_.bkp';


Starting restore at 21-DEC-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=193 device type=DISK


channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/opt/oracle/oradata/ORCL/control01.ctl
output file name=/opt/oracle/flash_recovery_area/ORCL/control02.ctl
Finished restore at 21-DEC-17


RMAN> alter database mount;


database mounted
released channel: ORA_DISK_1


RMAN> recover database;


Starting recover at 21-DEC-17
Starting implicit crosscheck backup at 21-DEC-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=193 device type=DISK
Crosschecked 18 objects
Finished implicit crosscheck backup at 21-DEC-17


Starting implicit crosscheck copy at 21-DEC-17
using channel ORA_DISK_1
Crosschecked 4 objects
Finished implicit crosscheck copy at 21-DEC-17


searching for all files in the recovery area
cataloging files...
cataloging done


List of Cataloged Files
=======================
File Name: /opt/oracle/flash_recovery_area/ORCL/autobackup/2017_12_21/o1_mf_s_963310363_f3p64ww2_.bkp


using channel ORA_DISK_1


starting media recovery


archived log for thread 1 with sequence 8793 is already on disk as file /opt/oracle/oradata/ORCL/redo02.log
archived log file name=/opt/oracle/oradata/ORCL/redo02.log thread=1 sequence=8793
media recovery complete, elapsed time: 00:00:00
Finished recover at 21-DEC-17


RMAN> ALTER DATABASE OPEN;


RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 12/21/2017 10:20:28
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


RMAN> ALTER DATABASE OPEN RESETLOGS;


database opened


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值