RMAN catalog的还原与恢复

来源:互联网 发布:js中window对象 编辑:程序博客网 时间:2024/05/17 01:29

试验环境是基于RMAN catalog的创建和基本使用和RMAN catalog自动备份脚本设计


检查备份集是否有效

RMAN> crosscheck backupset;allocated channel: ORA_DISK_1channel ORA_DISK_1: sid=139 devtype=DISKcrosschecked backup piece: found to be 'AVAILABLE'backup piece handle=/orabackup/inc0_ZHONG_1dn70dii_1_1 recid=40 stamp=779105874crosschecked backup piece: found to be 'AVAILABLE'backup piece handle=/orabackup/inc0_ZHONG_1en70djb_1_1 recid=41 stamp=779105899crosschecked backup piece: found to be 'AVAILABLE'backup piece handle=/orabackup/arch_ZHONG_1fn70djf_1_1 recid=42 stamp=779105904crosschecked backup piece: found to be 'AVAILABLE'backup piece handle=/orabackup/inc1_ZHONG_1hn70dke_1_1 recid=44 stamp=779105934crosschecked backup piece: found to be 'AVAILABLE'backup piece handle=/orabackup/inc1_ZHONG_1in70dkh_1_1 recid=45 stamp=779105938crosschecked backup piece: found to be 'AVAILABLE'backup piece handle=/orabackup/arch_ZHONG_1jn70dkm_1_1 recid=46 stamp=779105943crosschecked backup piece: found to be 'AVAILABLE'backup piece handle=/orabackup/inc2_ZHONG_1ln70dlm_1_1 recid=48 stamp=779105974crosschecked backup piece: found to be 'AVAILABLE'backup piece handle=/orabackup/inc2_ZHONG_1mn70dlp_1_1 recid=49 stamp=779105978crosschecked backup piece: found to be 'AVAILABLE'backup piece handle=/orabackup/arch_ZHONG_1nn70dlu_1_1 recid=50 stamp=779105983crosschecked backup piece: found to be 'AVAILABLE'backup piece handle=/orabackup/backupctl.ctl recid=51 stamp=779105986Crosschecked 10 objects
RMAN> validate backupset 1783,1784,1812,1839,1840,1869,1896,1897,1926,1938;using channel ORA_DISK_1channel ORA_DISK_1: starting validation of datafile backupsetchannel ORA_DISK_1: reading from backup piece /orabackup/inc0_ZHONG_1dn70dii_1_1channel ORA_DISK_1: restored backup piece 1piece handle=/orabackup/inc0_ZHONG_1dn70dii_1_1 tag=INC0channel ORA_DISK_1: validation complete, elapsed time: 00:00:25channel ORA_DISK_1: starting validation of datafile backupsetchannel ORA_DISK_1: reading from backup piece /orabackup/inc0_ZHONG_1en70djb_1_1channel ORA_DISK_1: restored backup piece 1piece handle=/orabackup/inc0_ZHONG_1en70djb_1_1 tag=INC0channel ORA_DISK_1: validation complete, elapsed time: 00:00:01channel ORA_DISK_1: starting validation of archive log backupsetchannel ORA_DISK_1: reading from backup piece /orabackup/arch_ZHONG_1fn70djf_1_1channel ORA_DISK_1: restored backup piece 1piece handle=/orabackup/arch_ZHONG_1fn70djf_1_1 tag=BKARCHchannel ORA_DISK_1: validation complete, elapsed time: 00:00:00channel ORA_DISK_1: starting validation of datafile backupsetchannel ORA_DISK_1: reading from backup piece /orabackup/inc1_ZHONG_1hn70dke_1_1channel ORA_DISK_1: restored backup piece 1piece handle=/orabackup/inc1_ZHONG_1hn70dke_1_1 tag=INC1channel ORA_DISK_1: validation complete, elapsed time: 00:00:00channel ORA_DISK_1: starting validation of datafile backupsetchannel ORA_DISK_1: reading from backup piece /orabackup/inc1_ZHONG_1in70dkh_1_1channel ORA_DISK_1: restored backup piece 1piece handle=/orabackup/inc1_ZHONG_1in70dkh_1_1 tag=INC1channel ORA_DISK_1: validation complete, elapsed time: 00:00:01channel ORA_DISK_1: starting validation of archive log backupsetchannel ORA_DISK_1: reading from backup piece /orabackup/arch_ZHONG_1jn70dkm_1_1channel ORA_DISK_1: restored backup piece 1piece handle=/orabackup/arch_ZHONG_1jn70dkm_1_1 tag=BKARCHchannel ORA_DISK_1: validation complete, elapsed time: 00:00:00channel ORA_DISK_1: starting validation of datafile backupsetchannel ORA_DISK_1: reading from backup piece /orabackup/inc2_ZHONG_1ln70dlm_1_1channel ORA_DISK_1: restored backup piece 1piece handle=/orabackup/inc2_ZHONG_1ln70dlm_1_1 tag=INC2channel ORA_DISK_1: validation complete, elapsed time: 00:00:00channel ORA_DISK_1: starting validation of datafile backupsetchannel ORA_DISK_1: reading from backup piece /orabackup/inc2_ZHONG_1mn70dlp_1_1channel ORA_DISK_1: restored backup piece 1piece handle=/orabackup/inc2_ZHONG_1mn70dlp_1_1 tag=INC2channel ORA_DISK_1: validation complete, elapsed time: 00:00:01channel ORA_DISK_1: starting validation of archive log backupsetchannel ORA_DISK_1: reading from backup piece /orabackup/arch_ZHONG_1nn70dlu_1_1channel ORA_DISK_1: restored backup piece 1piece handle=/orabackup/arch_ZHONG_1nn70dlu_1_1 tag=BKARCHchannel ORA_DISK_1: validation complete, elapsed time: 00:00:00channel ORA_DISK_1: starting validation of datafile backupsetchannel ORA_DISK_1: reading from backup piece /orabackup/backupctl.ctlchannel ORA_DISK_1: restored backup piece 1piece handle=/orabackup/backupctl.ctl tag=BKCTLchannel ORA_DISK_1: validation complete, elapsed time: 00:00:02RMAN>
RMAN> validate backupset 1783,1784,1812,1839,1840,1869,1896,1897,1926,1938 check logical;using channel ORA_DISK_1channel ORA_DISK_1: starting validation of datafile backupsetchannel ORA_DISK_1: reading from backup piece /orabackup/inc0_ZHONG_1dn70dii_1_1channel ORA_DISK_1: restored backup piece 1piece handle=/orabackup/inc0_ZHONG_1dn70dii_1_1 tag=INC0channel ORA_DISK_1: validation complete, elapsed time: 00:00:25channel ORA_DISK_1: starting validation of datafile backupsetchannel ORA_DISK_1: reading from backup piece /orabackup/inc0_ZHONG_1en70djb_1_1channel ORA_DISK_1: restored backup piece 1piece handle=/orabackup/inc0_ZHONG_1en70djb_1_1 tag=INC0channel ORA_DISK_1: validation complete, elapsed time: 00:00:01channel ORA_DISK_1: starting validation of archive log backupsetchannel ORA_DISK_1: reading from backup piece /orabackup/arch_ZHONG_1fn70djf_1_1channel ORA_DISK_1: restored backup piece 1piece handle=/orabackup/arch_ZHONG_1fn70djf_1_1 tag=BKARCHchannel ORA_DISK_1: validation complete, elapsed time: 00:00:00channel ORA_DISK_1: starting validation of datafile backupsetchannel ORA_DISK_1: reading from backup piece /orabackup/inc1_ZHONG_1hn70dke_1_1channel ORA_DISK_1: restored backup piece 1piece handle=/orabackup/inc1_ZHONG_1hn70dke_1_1 tag=INC1channel ORA_DISK_1: validation complete, elapsed time: 00:00:00channel ORA_DISK_1: starting validation of datafile backupsetchannel ORA_DISK_1: reading from backup piece /orabackup/inc1_ZHONG_1in70dkh_1_1channel ORA_DISK_1: restored backup piece 1piece handle=/orabackup/inc1_ZHONG_1in70dkh_1_1 tag=INC1channel ORA_DISK_1: validation complete, elapsed time: 00:00:01channel ORA_DISK_1: starting validation of archive log backupsetchannel ORA_DISK_1: reading from backup piece /orabackup/arch_ZHONG_1jn70dkm_1_1channel ORA_DISK_1: restored backup piece 1piece handle=/orabackup/arch_ZHONG_1jn70dkm_1_1 tag=BKARCHchannel ORA_DISK_1: validation complete, elapsed time: 00:00:00channel ORA_DISK_1: starting validation of datafile backupsetchannel ORA_DISK_1: reading from backup piece /orabackup/inc2_ZHONG_1ln70dlm_1_1channel ORA_DISK_1: restored backup piece 1piece handle=/orabackup/inc2_ZHONG_1ln70dlm_1_1 tag=INC2channel ORA_DISK_1: validation complete, elapsed time: 00:00:00channel ORA_DISK_1: starting validation of datafile backupsetchannel ORA_DISK_1: reading from backup piece /orabackup/inc2_ZHONG_1mn70dlp_1_1channel ORA_DISK_1: restored backup piece 1piece handle=/orabackup/inc2_ZHONG_1mn70dlp_1_1 tag=INC2channel ORA_DISK_1: validation complete, elapsed time: 00:00:01channel ORA_DISK_1: starting validation of archive log backupsetchannel ORA_DISK_1: reading from backup piece /orabackup/arch_ZHONG_1nn70dlu_1_1channel ORA_DISK_1: restored backup piece 1piece handle=/orabackup/arch_ZHONG_1nn70dlu_1_1 tag=BKARCHchannel ORA_DISK_1: validation complete, elapsed time: 00:00:00channel ORA_DISK_1: starting validation of datafile backupsetchannel ORA_DISK_1: reading from backup piece /orabackup/backupctl.ctlchannel ORA_DISK_1: restored backup piece 1piece handle=/orabackup/backupctl.ctl tag=BKCTLchannel ORA_DISK_1: validation complete, elapsed time: 00:00:01RMAN>

恢复非系统表空间

[oracle@zhong zhong]$ rm -rf example01.dbf
SYS@zhong:~>alter database datafile 5 online;alter database datafile 5 online*ERROR at line 1:ORA-01116: error in opening database file 5ORA-01110: data file 5: '/u01/app/oracle/oradata/zhong/example01.dbf'ORA-27041: unable to open fileLinux Error: 2: No such file or directoryAdditional information: 3

恢复datafile5
RMAN> run{2> allocate channel c1 device type disk;3> sql 'alter database datafile 5 offline';4> restore datafile 5;5> recover datafile 5;6> sql 'alter database datafile 5 online';7> release channel c1;8> }released channel: ORA_DISK_1allocated channel: c1channel c1: sid=139 devtype=DISKsql statement: alter database datafile 5 offlineStarting restore at 28-MAR-12channel c1: starting datafile backupset restorechannel c1: specifying datafile(s) to restore from backup setrestoring datafile 00005 to /u01/app/oracle/oradata/zhong/example01.dbfchannel c1: reading from backup piece /orabackup/inc0_ZHONG_1dn70dii_1_1channel c1: restored backup piece 1piece handle=/orabackup/inc0_ZHONG_1dn70dii_1_1 tag=INC0channel c1: restore complete, elapsed time: 00:00:08Finished restore at 28-MAR-12Starting recover at 28-MAR-12channel c1: starting incremental datafile backupset restorechannel c1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00005: /u01/app/oracle/oradata/zhong/example01.dbfchannel c1: reading from backup piece /orabackup/inc1_ZHONG_1hn70dke_1_1channel c1: restored backup piece 1piece handle=/orabackup/inc1_ZHONG_1hn70dke_1_1 tag=INC1channel c1: restore complete, elapsed time: 00:00:01channel c1: starting incremental datafile backupset restorechannel c1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00005: /u01/app/oracle/oradata/zhong/example01.dbfchannel c1: reading from backup piece /orabackup/inc2_ZHONG_1ln70dlm_1_1channel c1: restored backup piece 1piece handle=/orabackup/inc2_ZHONG_1ln70dlm_1_1 tag=INC2channel c1: restore complete, elapsed time: 00:00:01starting media recoverymedia recovery complete, elapsed time: 00:00:00Finished recover at 28-MAR-12sql statement: alter database datafile 5 onlinereleased channel: c1RMAN>
SYS@zhong:~>select status from v$datafile;STATUS-------SYSTEMONLINEONLINEONLINEONLINESYS@zhong:~>create table hr.emp tablespace example as select * from hr.employees;Table created.SYS@zhong:~>

UNDO表空间恢复

[oracle@zhong zhong]$ rm -rf undotbs01.dbf
RMAN> run {2> allocate channel c1 device type disk;3> restore datafile 2;4> recover datafile 2;5> release channel c2;6> }allocated channel: c1channel c1: sid=139 devtype=DISKStarting restore at 28-MAR-12channel c1: starting datafile backupset restorechannel c1: specifying datafile(s) to restore from backup setrestoring datafile 00002 to /u01/app/oracle/oradata/zhong/undotbs01.dbfchannel c1: reading from backup piece /orabackup/inc0_ZHONG_1dn70dii_1_1channel c1: restored backup piece 1piece handle=/orabackup/inc0_ZHONG_1dn70dii_1_1 tag=INC0channel c1: restore complete, elapsed time: 00:00:08Finished restore at 28-MAR-12Starting recover at 28-MAR-12channel c1: starting incremental datafile backupset restorechannel c1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00002: /u01/app/oracle/oradata/zhong/undotbs01.dbfchannel c1: reading from backup piece /orabackup/inc1_ZHONG_1hn70dke_1_1channel c1: restored backup piece 1piece handle=/orabackup/inc1_ZHONG_1hn70dke_1_1 tag=INC1channel c1: restore complete, elapsed time: 00:00:01channel c1: starting incremental datafile backupset restorechannel c1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00002: /u01/app/oracle/oradata/zhong/undotbs01.dbfchannel c1: reading from backup piece /orabackup/inc2_ZHONG_1ln70dlm_1_1channel c1: restored backup piece 1piece handle=/orabackup/inc2_ZHONG_1ln70dlm_1_1 tag=INC2channel c1: restore complete, elapsed time: 00:00:01starting media recoverymedia recovery failedRMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================ORA-03114: not connected to ORACLERMAN-03002: failure of recover command at 03/28/2012 11:14:43RMAN-11003: failure during parse/execution of SQL statement: alter database recover datafile list clearORA-00603: ORACLE server session terminated by fatal errorRMAN>
restore成功了,recover的时候报错session被中断,sqlplus登陆到目标数据库

[oracle@zhong ~]$ sqlplus / as sysdbaSQL*Plus: Release 10.2.0.1.0 - Production on Wed Mar 28 11:13:52 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining optionsSYS@zhong:~>select status from v$datafile;STATUS-------SYSTEMRECOVERONLINEONLINEONLINESYS@zhong:~>recover datafile 2;ORA-00603: ORACLE server session terminated by fatal errorSYS@zhong:~>exitDisconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining options[oracle@zhong ~]$ sqlplus / as sysdbaSQL*Plus: Release 10.2.0.1.0 - Production on Wed Mar 28 11:18:36 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining optionsSYS@zhong:~>select status from v$datafile;STATUS-------SYSTEMOFFLINEONLINEONLINEONLINESYS@zhong:~>alter database datafile 2 online;Database altered.SYS@zhong:~>select status from v$datafile;STATUS-------SYSTEMONLINEONLINEONLINEONLINESYS@zhong:~>

系统表空间恢复

[oracle@zhong zhong]$ rm -rf system01.dbf
将目标数据库启动到mount状态之后恢复

SYS@zhong:~>startup mount forceORACLE instance started.Total System Global Area 285212672 bytesFixed Size 1218992 bytesVariable Size 100664912 bytesDatabase Buffers 180355072 bytesRedo Buffers 2973696 bytesDatabase mounted.SYS@zhong:~>
[oracle@catalog scripts]$ rman catalog cataloguser/cataloguser target sys/oracle@zhongRecovery Manager: Release 10.2.0.1.0 - Production on Wed Mar 28 11:26:30 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.connected to target database: ZHONG (DBID=1447686871, not open)connected to recovery catalog databaseRMAN> run {2> allocate channel c1 device type disk;3> restore datafile 1;4> recover datafile 1;5> sql 'alter database open';6> release channel c1;7> }allocated channel: c1channel c1: sid=155 devtype=DISKStarting restore at 28-MAR-12channel c1: starting datafile backupset restorechannel c1: specifying datafile(s) to restore from backup setrestoring datafile 00001 to /u01/app/oracle/oradata/zhong/system01.dbfchannel c1: reading from backup piece /orabackup/inc0_ZHONG_1dn70dii_1_1channel c1: restored backup piece 1piece handle=/orabackup/inc0_ZHONG_1dn70dii_1_1 tag=INC0channel c1: restore complete, elapsed time: 00:00:25Finished restore at 28-MAR-12Starting recover at 28-MAR-12channel c1: starting incremental datafile backupset restorechannel c1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00001: /u01/app/oracle/oradata/zhong/system01.dbfchannel c1: reading from backup piece /orabackup/inc1_ZHONG_1hn70dke_1_1channel c1: restored backup piece 1piece handle=/orabackup/inc1_ZHONG_1hn70dke_1_1 tag=INC1channel c1: restore complete, elapsed time: 00:00:01channel c1: starting incremental datafile backupset restorechannel c1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00001: /u01/app/oracle/oradata/zhong/system01.dbfchannel c1: reading from backup piece /orabackup/inc2_ZHONG_1ln70dlm_1_1channel c1: restored backup piece 1piece handle=/orabackup/inc2_ZHONG_1ln70dlm_1_1 tag=INC2channel c1: restore complete, elapsed time: 00:00:01starting media recoverymedia recovery complete, elapsed time: 00:00:00Finished recover at 28-MAR-12sql statement: alter database openreleased channel: c1
SYS@zhong:~>select open_mode from v$database;OPEN_MODE----------READ WRITE

控制文件的还原

[oracle@zhong zhong]$ rm -rf *.ctl
将目标数据库启动到nomount状态

SYS@zhong:~>startup nomount forceORACLE instance started.Total System Global Area 285212672 bytesFixed Size 1218992 bytesVariable Size 100664912 bytesDatabase Buffers 180355072 bytesRedo Buffers 2973696 bytes
RMAN> run {2> allocate channel c1 device type disk;3> restore controlfile from tag='BKCTL';4> sql 'alter database mount';5> recover database;6> sql 'alter database open resetlogs';7> release channel c1;8> }allocated channel: c1channel c1: sid=155 devtype=DISKStarting restore at 28-MAR-12channel c1: starting datafile backupset restorechannel c1: restoring control filechannel c1: reading from backup piece /orabackup/backupctl.ctlchannel c1: restored backup piece 1piece handle=/orabackup/backupctl.ctl tag=BKCTLchannel c1: restore complete, elapsed time: 00:00:01output filename=/u01/app/oracle/oradata/zhong/control01.ctloutput filename=/u01/app/oracle/oradata/zhong/control02.ctloutput filename=/u01/app/oracle/oradata/zhong/control03.ctlFinished restore at 28-MAR-12sql statement: alter database mountStarting recover at 28-MAR-12Starting implicit crosscheck backup at 28-MAR-12Crosschecked 10 objectsFinished implicit crosscheck backup at 28-MAR-12Starting implicit crosscheck copy at 28-MAR-12Finished implicit crosscheck copy at 28-MAR-12searching for all files in the recovery areacataloging files...no files catalogedstarting media recoveryarchive log thread 1 sequence 21 is already on disk as file /u01/app/oracle/oradata/zhong/redo02.logarchive log thread 1 sequence 22 is already on disk as file /u01/app/oracle/oradata/zhong/redo03.logarchive log filename=/u01/app/oracle/oradata/zhong/redo02.log thread=1 sequence=21archive log filename=/u01/app/oracle/oradata/zhong/redo03.log thread=1 sequence=22media recovery complete, elapsed time: 00:00:01Finished recover at 28-MAR-12sql statement: alter database open resetlogsnew incarnation of database registered in recovery catalogstarting full resync of recovery catalogfull resync completereleased channel: c1RMAN>
SYS@zhong:~>select name from v$controlfile;NAME--------------------------------------------------------------------------------/u01/app/oracle/oradata/zhong/control01.ctl/u01/app/oracle/oradata/zhong/control02.ctl/u01/app/oracle/oradata/zhong/control03.ctlSYS@zhong:~>

online redolog
[oracle@zhong zhong]$ rm -rf *.log
SYS@zhong:~>startup mount forceORACLE instance started.Total System Global Area 285212672 bytesFixed Size 1218992 bytesVariable Size 104859216 bytesDatabase Buffers 176160768 bytesRedo Buffers 2973696 bytesDatabase mounted.SYS@zhong:~>
SYS@zhong:~>recover database until cancel;ORA-00279: change 568289 generated at 03/28/2012 11:47:50 needed for thread 1ORA-00289: suggestion : /arch/1_5_779110904.dbfORA-00280: change 568289 for thread 1 is in sequence #5Specify log: {=suggested | filename | AUTO | CANCEL}ORA-00308: cannot open archived log '/arch/1_5_779110904.dbf'ORA-27037: unable to obtain file statusLinux Error: 2: No such file or directoryAdditional information: 3SYS@zhong:~>recover database until cancel;ORA-00279: change 568289 generated at 03/28/2012 11:47:50 needed for thread 1ORA-00289: suggestion : /arch/1_5_779110904.dbfORA-00280: change 568289 for thread 1 is in sequence #5Specify log: {=suggested | filename | AUTO | CANCEL}cancelMedia recovery cancelled.SYS@zhong:~>alter database open resetlogs;Database altered.SYS@zhong:~>select open_mode from v$database;OPEN_MODE----------READ WRITESYS@zhong:~>

online redolog, controlfile, datafile全部删除恢复

[oracle@zhong zhong]$ rm -rf rm -rf *.ctl *.log *.dbf[oracle@zhong zhong]$ ls[oracle@zhong zhong]$
SYS@zhong:~>startup nomount forceORACLE instance started.Total System Global Area 285212672 bytesFixed Size 1218992 bytesVariable Size 104859216 bytesDatabase Buffers 176160768 bytesRedo Buffers 2973696 bytesSYS@zhong:~>
[oracle@catalog scripts]$ rman catalog cataloguser/cataloguser target sys/oracle@zhongRecovery Manager: Release 10.2.0.1.0 - Production on Wed Mar 28 13:11:25 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.connected to target database: zhong (not mounted)connected to recovery catalog databaseRMAN> run {2> allocate channel c1 device type disk;3> restore database;4> sql 'alter database mount';5> recover database;6> release channel c1;7> }allocated channel: c1channel c1: sid=155 devtype=DISKStarting restore at 28-MAR-12channel c1: starting datafile backupset restorechannel c1: specifying datafile(s) to restore from backup setrestoring datafile 00001 to /u01/app/oracle/oradata/zhong/system01.dbfrestoring datafile 00002 to /u01/app/oracle/oradata/zhong/undotbs01.dbfrestoring datafile 00003 to /u01/app/oracle/oradata/zhong/sysaux01.dbfrestoring datafile 00004 to /u01/app/oracle/oradata/zhong/users01.dbfrestoring datafile 00005 to /u01/app/oracle/oradata/zhong/example01.dbfchannel c1: reading from backup piece /orabackup/inc0_ZHONG_1qn70iom_1_1channel c1: restored backup piece 1piece handle=/orabackup/inc0_ZHONG_1qn70iom_1_1 tag=INC0channel c1: restore complete, elapsed time: 00:00:35Finished restore at 28-MAR-12sql statement: alter database mountreleased channel: c1RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03009: failure of sql command on default channel at 03/28/2012 13:12:53RMAN-11003: failure during parse/execution of SQL statement: alter database mountORA-00205: error in identifying control file, check alert log for more infoRMAN>
重建控制文件的脚本

create controlfile set database "zhong" resetlogs archivelogmaxlogfiles 16maxlogmembers 3maxdatafiles 100maxinstances 8maxloghistory 292logfilegroup 1 '/u01/app/oracle/oradata/zhong/redo01.log' size 50M,group 2 '/u01/app/oracle/oradata/zhong/redo02.log' size 50M,group 3 '/u01/app/oracle/oradata/zhong/redo03.log' size 50Mdatafile'/u01/app/oracle/oradata/zhong/system01.dbf','/u01/app/oracle/oradata/zhong/undotbs01.dbf','/u01/app/oracle/oradata/zhong/sysaux01.dbf','/u01/app/oracle/oradata/zhong/users01.dbf','/u01/app/oracle/oradata/zhong/example01.dbf'character set zhs16gbk;
[oracle@zhong ~]$ sqlplus / as sysdbaSQL*Plus: Release 10.2.0.1.0 - Production on Wed Mar 28 13:28:19 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining optionsSYS@zhong:~>select open_mode v$database;select open_mode v$database*ERROR at line 1:ORA-00923: FROM keyword not found where expectedSYS@zhong:~>select open_mode from v$database;select open_mode from v$database*ERROR at line 1:ORA-01507: database not mountedSYS@zhong:~>@cte_ctlControl file created.SYS@zhong:~>
[oracle@catalog scripts]$ rman catalog cataloguser/cataloguser target sys/oracle@zhongRecovery Manager: Release 10.2.0.1.0 - Production on Wed Mar 28 13:33:04 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.connected to target database: ZHONG (DBID=1447686871, not open)connected to recovery catalog databaseRMAN> run{2> allocate channel c1 device type disk;3> sql 'alter database mount';4> recover database;5> release channel c1;6> }allocated channel: c1channel c1: sid=157 devtype=DISKsql statement: alter database mountreleased channel: c1RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03009: failure of sql command on default channel at 03/28/2012 13:34:05RMAN-11003: failure during parse/execution of SQL statement: alter database mountORA-01100: database already mountedRMAN> recover database;Starting recover at 28-MAR-12RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of recover command at 03/28/2012 13:35:03RMAN-12010: automatic channel allocation initialization failedRMAN-06004: ORACLE error from recovery catalog database: RMAN-20011: target database incarnation is not current in recovery catalogRMAN> exit
[oracle@catalog scripts]$ rman nocatalog target sys/oracle@zhongRecovery Manager: Release 10.2.0.1.0 - Production on Wed Mar 28 13:37:27 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.connected to target database: ZHONG (DBID=1447686871, not open)using target database control file instead of recovery catalogRMAN> recover database;Starting recover at 28-MAR-12allocated channel: ORA_DISK_1channel ORA_DISK_1: sid=155 devtype=DISKstarting media recoveryunable to find archive logarchive log thread=1 sequence=1RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of recover command at 03/28/2012 13:37:49RMAN-06054: media recovery requesting unknown log: thread 1 seq 1 lowscn 567965RMAN> alter database open resetlogs;database openedRMAN> exit









原创粉丝点击