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


猜你喜欢

转载自blog.csdn.net/der322/article/details/78860566