一、修改控制文件名的恢复
1、备份控制文件
SQL> alter database backup controlfile to '/opt/oracle/jack/controlbak01.ctl'; Database altered. SQL> ! ls -lh /opt/oracle/jack/controlbak01.ctl -rw-r----- 1 oracle oinstall 7.1M Jun 25 18:21 /opt/oracle/jack/controlbak01.ctl SQL>
2、切换日志,做检查点
SQL> alter system switch logfile; System altered. SQL> / System altered. SQL> / System altered. SQL> alter system checkpoint; System altered. SQL>
3、重命名控制文件
SQL> ! [oracle@ocmserver ~]$ cd oradata/ocm [oracle@ocmserver ocm]$ mv control01.ctl control011.ctl [oracle@ocmserver ocm]$ mv control02.ctl control022.ctl [oracle@ocmserver ocm]$ mv control03.ctl control033.ctl [oracle@ocmserver ocm]$ ls -lh control0* -rw-r----- 1 oracle oinstall 7.1M Jun 25 18:23 control011.ctl -rw-r----- 1 oracle oinstall 7.1M Jun 25 18:23 control022.ctl -rw-r----- 1 oracle oinstall 7.1M Jun 25 18:23 control033.ctl
4、使数据库宕机
SQL> shutdown abort;
ORACLE instance shut down.
5、启动数据库并观察日志
SQL> startup ORACLE instance started. Total System Global Area 218103808 bytes Fixed Size 1218604 bytes Variable Size 75499476 bytes Database Buffers 138412032 bytes Redo Buffers 2973696 bytes ORA-00205: error in identifying control file, check alert log for more info SQL> ! tail -20 /opt/oracle/admin/ocm/bdump/alert_ocm.log LGWR started with pid=6, OS id=2745 CKPT started with pid=7, OS id=2747 SMON started with pid=8, OS id=2749 RECO started with pid=9, OS id=2751 CJQ0 started with pid=10, OS id=2753 MMON started with pid=11, OS id=2755 Tue Jun 25 18:25:10 2013 starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'... MMNL started with pid=12, OS id=2757 Tue Jun 25 18:25:10 2013 starting up 1 shared server(s) ... Tue Jun 25 18:25:10 2013 ALTER DATABASE MOUNT Tue Jun 25 18:25:10 2013 ORA-00202: control file: '/opt/oracle/oradata/ocm/control01.ctl' ORA-27037: unable to obtain file status Linux Error: 2: No such file or directory Additional information: 3 Tue Jun 25 18:25:13 2013 ORA-205 signalled during: ALTER DATABASE MOUNT... SQL>
6、还原控制文件
[oracle@ocmserver ocm]$ mv control011.ctl control01.ctl [oracle@ocmserver ocm]$ mv control022.ctl control02.ctl [oracle@ocmserver ocm]$ mv control033.ctl control03.ctl [oracle@ocmserver ocm]$ ls -lh control0* -rw-r----- 1 oracle oinstall 7.1M Jun 25 18:24 control01.ctl -rw-r----- 1 oracle oinstall 7.1M Jun 25 18:24 control02.ctl -rw-r----- 1 oracle oinstall 7.1M Jun 25 18:24 control03.ctl [oracle@ocmserver ocm]$
7、启动数据库
SQL> alter database mount; Database altered. SQL> alter database open; Database altered. SQL> select status from v$instance; STATUS ------------ OPEN SQL>
补充说明:
最好这样备份好控制文件,然后用备份到文件和备份到trace。做实验重启系统,重装系统太费劲了!
二、丢失控制文件恢复
1、同上备份到指定位置文件(如/opt/oracle/jack/controlbak01.ctl)
2、做日志切换,同上
alter system switch logfile; alter system switch logfile; alter system switch logfile; alter system checkpoint;
3、删除控制文件
[oracle@ocmserver oradata]$ cd ocm/
[oracle@ocmserver ocm]$ ls
control01.ctl control02.ctl control03.ctl example01.dbf redo01.log redo02.log redo03.log sysaux01.dbf system01.dbf temp01.dbf undotbs01.dbf users01.dbf
[oracle@ocmserver ocm]$ rm control0*
4、使数据库宕机
shutdown abort;
5、重启报错,看日志(如上)
6、还原控制文件
[oracle@ocmserver ocm]$ cp /opt/oracle/jack/controlbak.ctl control01.ctl [oracle@ocmserver ocm]$ cp /opt/oracle/jack/controlbak.ctl control02.ctl [oracle@ocmserver ocm]$ cp /opt/oracle/jack/controlbak.ctl control03.ctl [oracle@ocmserver ocm]$ ls -lh control0* -rw-r----- 1 oracle oinstall 7.1M Jun 25 18:34 control01.ctl -rw-r----- 1 oracle oinstall 7.1M Jun 25 18:34 control02.ctl -rw-r----- 1 oracle oinstall 7.1M Jun 25 18:34 control03.ctl [oracle@ocmserver ocm]$
7、修改到启动状态
SQL> alter database mount; Database altered. SQL> alter database open; alter database open * ERROR at line 1: ORA-01589: must use RESETLOGS or NORESETLOGS option for database open SQL> alter database open resetlogs; alter database open resetlogs * ERROR at line 1: ORA-01152: file 1 was not restored from a sufficiently old backup ORA-01110: data file 1: '/opt/oracle/oradata/ocm/system01.dbf' SQL>
8、开始恢复
SQL> recover database; ORA-00283: recovery session canceled due to errors ORA-01610: recovery using the BACKUP CONTROLFILE option must be done SQL> recover database using backup controlfile; ORA-00279: change 598019 generated at 06/25/2013 09:38:35 needed for thread 1 ORA-00289: suggestion : /opt/oracle/flash_recovery_area/OCM/archivelog/2013_06_25/o1_mf_1_31_%u_.arc ORA-00280: change 598019 for thread 1 is in sequence #31 Specify log: {<RET>=suggested | filename | AUTO | CANCEL} ORA-00308: cannot open archived log '/opt/oracle/flash_recovery_area/OCM/archivelog/2013_06_25/o1_mf_1_31_%u_.arc' ORA-27037: unable to obtain file status Linux Error: 2: No such file or directory Additional information: 3 SQL> recover database using backup controlfile; ORA-00279: change 598019 generated at 06/25/2013 09:38:35 needed for thread 1 ORA-00289: suggestion : /opt/oracle/flash_recovery_area/OCM/archivelog/2013_06_25/o1_mf_1_31_%u_.arc ORA-00280: change 598019 for thread 1 is in sequence #31 Specify log: {<RET>=suggested | filename | AUTO | CANCEL} /opt/oracle/oradata/ocm/redo03.log Log applied. Media recovery complete. SQL> alter database open resetlogs; Database altered.
9、检查数据库情况
SQL> select status from v$instance; STATUS ------------ OPEN SQL>
10、添加临时表空间
SQL> ALTER TABLESPACE TEMP ADD TEMPFILE '/opt/oracle/oradata/temp01.dbf' SIZE 20971520 REUSE AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M; Tablespace altered. SQL>
11、其他检查
三、重建控制文件恢复
1、备份到trace文件
SQL> alter database backup controlfile to trace;
Database altered.
2、查看trace文件
SQL> @/opt/oracle/jack/getrace.sql
TRACE_FILE_NAME
--------------------------------------------------------------------------------
/opt/oracle/admin/ocm/udump/ocm_ora_2458.trc
getrace.sql参照http://www.eygle.com/archives/2004/12/howto_get_trace_filename.html
内容如下:
For Unix: $ sqlplus "/ as sysdba" SQL*Plus: Release 9.2.0.4.0 - Production on Fri Oct 8 12:08:09 2004 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.4.0 - Production SQL> set echo on SQL> @gettrcnameunix SQL> SELECT d.VALUE 2 || '/' 3 || LOWER (RTRIM (i.INSTANCE, CHR (0))) 4 || '_ora_' 5 || p.spid 6 || '.trc' trace_file_name 7 FROM (SELECT p.spid 8 FROM v$mystat m, v$session s, v$process p 9 WHERE m.statistic# = 1 AND s.SID = m.SID AND p.addr = s.paddr) p, 10 (SELECT t.INSTANCE 11 FROM v$thread t, v$parameter v 12 WHERE v.NAME = 'thread' 13 AND (v.VALUE = 0 OR t.thread# = TO_NUMBER (v.VALUE))) i, 14 (SELECT VALUE 15 FROM v$parameter 16 WHERE NAME = 'user_dump_dest') d 17 / TRACE_FILE_NAME -------------------------------------------------------------------------------- /opt/oracle/admin/hsbill/udump/hsbill_ora_29630.trc For Nt: SQL> SELECT d.VALUE 2 || '\' 3 || LOWER (RTRIM (i.INSTANCE, CHR (0))) 4 || '_ora_' 5 || p.spid 6 || '.trc' trace_file_name 7 FROM (SELECT p.spid 8 FROM v$mystat m, v$session s, v$process p 9 WHERE m.statistic# = 1 AND s.SID = m.SID AND p.addr = s.paddr) p, 10 (SELECT t.INSTANCE 11 FROM v$thread t, v$parameter v 12 WHERE v.NAME = 'thread' 13 AND (v.VALUE = 0 OR t.thread# = TO_NUMBER (v.VALUE))) i, 14 (SELECT VALUE 15 FROM v$parameter 16 WHERE NAME = 'user_dump_dest') d 17 / TRACE_FILE_NAME -------------------------------------------------------------------------------- e:\oracle\admin\eygle\udump\eygle_ora_3084.trc
3、看备份到trace文件的内容
SQL> ! more /opt/oracle/admin/ocm/udump/ocm_ora_2458.trc /opt/oracle/admin/ocm/udump/ocm_ora_2458.trc Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options ORACLE_HOME = /opt/oracle/product System name: Linux Node name: ocmserver.com Release: 2.6.18-164.el5 Version: #1 SMP Tue Aug 18 15:51:54 EDT 2009 Machine: i686 Instance name: ocm Redo thread mounted by this instance: 1 Oracle process number: 15 Unix process pid: 2458, image: oracle@ocmserver.com (TNS V1-V3) *** SERVICE NAME:(SYS$USERS) 2013-06-25 22:39:41.611 *** SESSION ID:(142.1) 2013-06-25 22:39:41.611 *** 2013-06-25 22:39:41.611 -- The following are current System-scope REDO Log Archival related -- parameters and can be included in the database initialization file. -- -- LOG_ARCHIVE_DEST='' -- LOG_ARCHIVE_DUPLEX_DEST='' -- -- LOG_ARCHIVE_FORMAT=%t_%s_%r.dbf -- -- DB_UNIQUE_NAME="ocm" -- -- LOG_ARCHIVE_CONFIG='SEND, RECEIVE, NODG_CONFIG' -- LOG_ARCHIVE_MAX_PROCESSES=2 -- STANDBY_FILE_MANAGEMENT=MANUAL -- STANDBY_ARCHIVE_DEST=?/dbs/arch -- FAL_CLIENT='' -- FAL_SERVER='' -- -- LOG_ARCHIVE_DEST_10='LOCATION=USE_DB_RECOVERY_FILE_DEST' -- LOG_ARCHIVE_DEST_10='OPTIONAL REOPEN=300 NODELAY' -- LOG_ARCHIVE_DEST_10='ARCH NOAFFIRM NOEXPEDITE NOVERIFY SYNC' -- LOG_ARCHIVE_DEST_10='REGISTER NOALTERNATE NODEPENDENCY' -- LOG_ARCHIVE_DEST_10='NOMAX_FAILURE NOQUOTA_SIZE NOQUOTA_USED NODB_UNIQUE_NAME' -- LOG_ARCHIVE_DEST_10='VALID_FOR=(PRIMARY_ROLE,ONLINE_LOGFILES)' -- LOG_ARCHIVE_DEST_STATE_10=ENABLE -- -- Below are two sets of SQL statements, each of which creates a new -- control file and uses it to open the database. The first set opens -- the database with the NORESETLOGS option and should be used only if -- the current versions of all online logs are available. The second -- set opens the database with the RESETLOGS option and should be used -- if online logs are unavailable. -- The appropriate set of statements can be copied from the trace into -- a script file, edited as necessary, and executed when there is a -- need to re-create the control file. -- -- Set #1. NORESETLOGS case -- -- The following commands will create a new control file and use it -- to open the database. -- Data used by Recovery Manager will be lost. -- Additional logs may be required for media recovery of offline -- Use this only if the current versions of all online logs are -- available. -- After mounting the created controlfile, the following SQL -- statement will place the database in the appropriate -- protection mode: -- ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE STARTUP NOMOUNT CREATE CONTROLFILE REUSE DATABASE "OCM" NORESETLOGS NOARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 292 LOGFILE GROUP 1 '/opt/oracle/oradata/ocm/redo01.log' SIZE 50M, GROUP 2 '/opt/oracle/oradata/ocm/redo02.log' SIZE 50M, GROUP 3 '/opt/oracle/oradata/ocm/redo03.log' SIZE 50M -- STANDBY LOGFILE DATAFILE '/opt/oracle/oradata/ocm/system01.dbf', '/opt/oracle/oradata/ocm/undotbs01.dbf', '/opt/oracle/oradata/ocm/sysaux01.dbf', '/opt/oracle/oradata/ocm/users01.dbf', '/opt/oracle/oradata/ocm/example01.dbf' CHARACTER SET AL32UTF8 ; -- Commands to re-create incarnation table -- Below log names MUST be changed to existing filenames on -- disk. Any one log file from each branch can be used to -- re-create incarnation records. -- ALTER DATABASE REGISTER LOGFILE '/opt/oracle/flash_recovery_area/OCM/archivelog/2013_06_25/o1_mf_1_1_%u_.arc'; -- Recovery is required if any of the datafiles are restored backups, -- or if the last shutdown was not normal or immediate. RECOVER DATABASE -- Database can now be opened normally. ALTER DATABASE OPEN; -- Commands to add tempfiles to temporary tablespaces. -- Online tempfiles have complete space information. -- Other tempfiles may require adjustment. ALTER TABLESPACE TEMP ADD TEMPFILE '/opt/oracle/oradata/ocm/temp01.dbf' SIZE 20971520 REUSE AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M; -- End of tempfile additions. -- -- Set #2. RESETLOGS case -- -- The following commands will create a new control file and use it -- to open the database. -- Data used by Recovery Manager will be lost. -- The contents of online logs will be lost and all backups will -- be invalidated. Use this only if online logs are damaged. -- After mounting the created controlfile, the following SQL -- statement will place the database in the appropriate -- protection mode: -- ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE STARTUP NOMOUNT CREATE CONTROLFILE REUSE DATABASE "OCM" RESETLOGS NOARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 292 LOGFILE GROUP 1 '/opt/oracle/oradata/ocm/redo01.log' SIZE 50M, GROUP 2 '/opt/oracle/oradata/ocm/redo02.log' SIZE 50M, GROUP 3 '/opt/oracle/oradata/ocm/redo03.log' SIZE 50M -- STANDBY LOGFILE DATAFILE '/opt/oracle/oradata/ocm/system01.dbf', '/opt/oracle/oradata/ocm/undotbs01.dbf', '/opt/oracle/oradata/ocm/sysaux01.dbf', '/opt/oracle/oradata/ocm/users01.dbf', '/opt/oracle/oradata/ocm/example01.dbf' CHARACTER SET AL32UTF8 ; -- Commands to re-create incarnation table -- Below log names MUST be changed to existing filenames on -- disk. Any one log file from each branch can be used to -- re-create incarnation records. -- ALTER DATABASE REGISTER LOGFILE '/opt/oracle/flash_recovery_area/OCM/archivelog/2013_06_25/o1_mf_1_1_%u_.arc'; -- Recovery is required if any of the datafiles are restored backups, -- or if the last shutdown was not normal or immediate. RECOVER DATABASE USING BACKUP CONTROLFILE -- Database can now be opened zeroing the online logs. ALTER DATABASE OPEN RESETLOGS; -- Commands to add tempfiles to temporary tablespaces. -- Online tempfiles have complete space information. -- Other tempfiles may require adjustment. ALTER TABLESPACE TEMP ADD TEMPFILE '/opt/oracle/oradata/ocm/temp01.dbf' SIZE 20971520 REUSE AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M; -- End of tempfile additions. -- SQL>
4、备份trace文件为文本控制文件。
SQL> ! cp /opt/oracle/admin/ocm/udump/ocm_ora_2458.trc /opt/oracle/jack/tra_controlfile.sql
5、以tra_controlfile.sql为模板制作控制文件脚本
SQL> ! ls -lh /opt/oracle/jack/tra_controlfile.sql -rw-r----- 1 oracle oinstall 6.0K Jun 25 22:42 /opt/oracle/jack/tra_controlfile.sql SQL>
6、执行控制文件脚本还原
SQL>!more /opt/oracle/jack/tra_controlfile.sql STARTUP NOMOUNT CREATE CONTROLFILE REUSE DATABASE "OCM" NORESETLOGS NOARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 292 LOGFILE GROUP 1 '/opt/oracle/oradata/ocm/redo01.log' SIZE 50M, GROUP 2 '/opt/oracle/oradata/ocm/redo02.log' SIZE 50M, GROUP 3 '/opt/oracle/oradata/ocm/redo03.log' SIZE 50M -- STANDBY LOGFILE DATAFILE '/opt/oracle/oradata/ocm/system01.dbf', '/opt/oracle/oradata/ocm/undotbs01.dbf', '/opt/oracle/oradata/ocm/sysaux01.dbf', '/opt/oracle/oradata/ocm/users01.dbf', '/opt/oracle/oradata/ocm/example01.dbf' CHARACTER SET AL32UTF8 ; -- Commands to re-create incarnation table -- Below log names MUST be changed to existing filenames on -- disk. Any one log file from each branch can be used to -- re-create incarnation records. -- ALTER DATABASE REGISTER LOGFILE '/opt/oracle/flash_recovery_area/OCM/archivelog/2013_06_25/o1_mf_1_1_%u_.arc'; -- Recovery is required if any of the datafiles are restored backups, -- or if the last shutdown was not normal or immediate. RECOVER DATABASE -- Database can now be opened normally. ALTER DATABASE OPEN; -- Commands to add tempfiles to temporary tablespaces. -- Online tempfiles have complete space information. -- Other tempfiles may require adjustment. ALTER TABLESPACE TEMP ADD TEMPFILE '/opt/oracle/oradata/ocm/temp01.dbf' SIZE 20971520 REUSE AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M; -- End of tempfile additions.
7、添加临时表空间
SQL> ALTER TABLESPACE TEMP ADD TEMPFILE '/opt/oracle/oradata/temp01.dbf' SIZE 20971520 REUSE AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M; Tablespace altered. SQL>
四、RMAN恢复控制文件
1、备份控制文件
RMAN> backup current controlfile format '/opt/oracle/jack/rman_ctrbak.ctl'; Starting backup at 25-JUN-13 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=144 devtype=DISK channel ORA_DISK_1: starting full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset including current control file in backupset channel ORA_DISK_1: starting piece 1 at 25-JUN-13 channel ORA_DISK_1: finished piece 1 at 25-JUN-13 piece handle=/opt/oracle/jack/rman_ctrbak.ctl tag=TAG20130625T225008 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02 Finished backup at 25-JUN-13 RMAN>
2、关闭数据库并删除控制文件;
步骤不能颠倒,否则会有一致性问题。
RMAN>shutdown abort;
3、启动到nomount模式
RMAN> alter database mount; RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of alter db command at 06/25/2013 22:57:34 ORA-00214: control file '/opt/oracle/oradata/ocm/control03.ctl' version 525 inconsistent with file '/opt/oracle/oradata/ocm/control01.ctl' version 516 RMAN> 提示03、02没有01新,做如下操作 cp control01.ctl control02.ctl cp control01.ctl control02.ctl
4、恢复控制文件
RMAN> restore controlfile from '/opt/oracle/jack/rman_ctrbak.ctl'; Starting restore at 25-JUN-13 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=156 devtype=DISK channel ORA_DISK_1: restoring control file channel ORA_DISK_1: restore complete, elapsed time: 00:00:04 output filename=/opt/oracle/oradata/ocm/control01.ctl output filename=/opt/oracle/oradata/ocm/control02.ctl output filename=/opt/oracle/oradata/ocm/control03.ctl Finished restore at 25-JUN-13 还有一种是指定to……from模式,比较费劲 RMAN> restore controlfile to '/opt/oracle/oradata/ocm/control01.ctl' from '/opt/oracle/jack/rman_ctrbak.ctl'; Starting restore at 25-JUN-13 using channel ORA_DISK_1 channel ORA_DISK_1: restoring control file channel ORA_DISK_1: restore complete, elapsed time: 00:00:01 Finished restore at 25-JUN-13 RMAN>
5、查询日志的SEQUENCE#和GROUP#
SQL> set line 300 pages 50000 SQL> col name for a80 SQL> col member for a80 SQL> select * from v$log; GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- 1 1 13 52428800 1 NO INACTIVE 547133 25-JUN-13 2 1 14 52428800 1 NO CURRENT 547135 25-JUN-13 3 1 12 52428800 1 NO INACTIVE 547131 25-JUN-13 SQL> select * from v$logfile; GROUP# STATUS TYPE MEMBER IS_ ---------- ------- ------- -------------------------------------------------------------------------------- --- 3 ONLINE /opt/oracle/oradata/ocm/redo03.log NO 2 ONLINE /opt/oracle/oradata/ocm/redo02.log NO 1 ONLINE /opt/oracle/oradata/ocm/redo01.log NO SQL>
6、在SQL下恢复数据库
SQL> recover database using backup controlfile until cancel; ORA-00279: change 541554 generated at 06/25/2013 22:38:03 needed for thread 1 ORA-00289: suggestion : /opt/oracle/flash_recovery_area/OCM/archivelog/2013_06_25/o1_mf_1_14_%u_.arc ORA-00280: change 541554 for thread 1 is in sequence #14 Specify log: {<RET>=suggested | filename | AUTO | CANCEL} /opt/oracle/oradata/ocm/redo03.log -----手动输入 ORA-00310: archived log contains sequence 13; sequence 14 required ORA-00334: archived log: '/opt/oracle/oradata/ocm/redo03.log' ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below ORA-01194: file 1 needs more recovery to be consistent ORA-01110: data file 1: '/opt/oracle/oradata/ocm/system01.dbf' SQL> recover database using backup controlfile until cancel; ORA-00279: change 541554 generated at 06/25/2013 22:38:03 needed for thread 1 ORA-00289: suggestion : /opt/oracle/flash_recovery_area/OCM/archivelog/2013_06_25/o1_mf_1_14_%u_.arc ORA-00280: change 541554 for thread 1 is in sequence #14 Specify log: {<RET>=suggested | filename | AUTO | CANCEL} /opt/oracle/oradata/ocm/redo01.log -----手动输入 ORA-00310: archived log contains sequence 12; sequence 14 required ORA-00334: archived log: '/opt/oracle/oradata/ocm/redo01.log' ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below ORA-01194: file 1 needs more recovery to be consistent ORA-01110: data file 1: '/opt/oracle/oradata/ocm/system01.dbf' SQL> recover database using backup controlfile until cancel; ORA-00279: change 541554 generated at 06/25/2013 22:38:03 needed for thread 1 ORA-00289: suggestion : /opt/oracle/flash_recovery_area/OCM/archivelog/2013_06_25/o1_mf_1_14_%u_.arc ORA-00280: change 541554 for thread 1 is in sequence #14 Specify log: {<RET>=suggested | filename | AUTO | CANCEL} /opt/oracle/oradata/ocm/redo02.log -----手动输入 Log applied. Media recovery complete. SQL>
7、在RMAN下启动数据库
RMAN> alter database open resetlogs;
database opened
RMAN>
8、查看数据库状态
SQL> select status from v$instance; STATUS ------------ OPEN SQL>
9、添加临时表空间
SQL> ALTER TABLESPACE TEMP ADD TEMPFILE '/opt/oracle/oradata/temp01.dbf' SIZE 20971520 REUSE AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M; Tablespace altered. SQL>
五、参考文档
guoyJoe:http://www.itpub.net/thread-1794416-1-1.html
eygle:http://www.eygle.com/archives/2004/10/backup_and_recreate_controlfile.html