重建控制文件的操作
Posted joson
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了重建控制文件的操作相关的知识,希望对你有一定的参考价值。
[[email protected] trace]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Fri Sep 15 17:01:14 2017
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
SQL>
SQL>
SQL> select name from v$controlfile ;
NAME
-------------------------------------------------------------------------------
/u01/app/oracle/oradata/PROD1/control01.ctl
/u01/app/oracle/fast_recovery_area/PROD1/control02.ctl
SQL>
SQL>
SQL> ho rm /u01/app/oracle/oradata/PROD1/control01.ctl
SQL> ho rm /u01/app/oracle/fast_recovery_area/PROD1/control02.ctl
SQL> shutdown abort
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 472887296 bytes
Fixed Size 1345716 bytes
Variable Size 419432268 bytes
Database Buffers 46137344 bytes
Redo Buffers 5971968 bytes
ORA-00205: error in identifying control file, check alert log for more info
SQL> CREATE CONTROLFILE REUSE DATABASE "PROD1" RESETLOGS FORCE LOGGING ARCHIVELOG
2 MAXLOGFILES 16
3 MAXLOGMEMBERS 3
4 MAXDATAFILES 100
5 MAXINSTANCES 8
6 MAXLOGHISTORY 292
7 LOGFILE
8 GROUP 1 ‘/u01/app/oracle/oradata/PROD1/redo01.log‘ SIZE 50M BLOCKSIZE 512,
9 GROUP 2 ‘/u01/app/oracle/oradata/PROD1/redo02.log‘ SIZE 50M BLOCKSIZE 512,
10 GROUP 3 ‘/u01/app/oracle/oradata/PROD1/redo03.log‘ SIZE 50M BLOCKSIZE 512
11 -- STANDBY LOGFILE
12 DATAFILE
13 ‘/u01/app/oracle/oradata/PROD1/system01.dbf‘,
14 ‘/u01/app/oracle/oradata/PROD1/sysaux01.dbf‘,
15 ‘/u01/app/oracle/oradata/PROD1/undotbs01.dbf‘,
16 ‘/u01/app/oracle/oradata/PROD1/users01.dbf‘,
17 ‘/u01/app/oracle/oradata/PROD1/example01.dbf‘,
18 ‘/u01/app/oracle/oradata/PROD1/undo01.dbf‘,
19 ‘/u01/practice/undotsb3.dbf‘
20 CHARACTER SET WE8MSWIN1252;
Control file created.
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: ‘/u01/app/oracle/oradata/PROD1/system01.dbf‘
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 4833502 generated at 09/15/2017 15:19:37 needed for thread 1
ORA-00289: suggestion :
/u01/app/oracle/fast_recovery_area/PROD1/archivelog/2017_09_15/o1_mf_1_3_%u_.arc
ORA-00280: change 4833502 for thread 1 is in sequence #3
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
auto
ORA-00308: cannot open archived log
‘/u01/app/oracle/fast_recovery_area/PROD1/archivelog/2017_09_15/o1_mf_1_3_%u_.ar
c‘
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
ORA-00308: cannot open archived log
‘/u01/app/oracle/fast_recovery_area/PROD1/archivelog/2017_09_15/o1_mf_1_3_%u_.ar
c‘
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
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: ‘/u01/app/oracle/oradata/PROD1/system01.dbf‘
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 4833502 generated at 09/15/2017 15:19:37 needed for thread 1
ORA-00289: suggestion :
/u01/app/oracle/fast_recovery_area/PROD1/archivelog/2017_09_15/o1_mf_1_3_%u_.arc
ORA-00280: change 4833502 for thread 1 is in sequence #3
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/u01/app/oracle/oradata/PROD1/redo01.log
ORA-00310: archived log contains sequence 1; sequence 3 required
ORA-00334: archived log: ‘/u01/app/oracle/oradata/PROD1/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: ‘/u01/app/oracle/oradata/PROD1/system01.dbf‘
SQL> /u01/app/oracle/oradata/PROD1/redo01.log
SP2-0734: unknown command beginning "/u01/app/o..." - rest of line ignored.
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 4833502 generated at 09/15/2017 15:19:37 needed for thread 1
ORA-00289: suggestion :
/u01/app/oracle/fast_recovery_area/PROD1/archivelog/2017_09_15/o1_mf_1_3_%u_.arc
ORA-00280: change 4833502 for thread 1 is in sequence #3
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/u01/app/oracle/oradata/PROD1/redo02.log
ORA-00310: archived log contains sequence 2; sequence 3 required
ORA-00334: archived log: ‘/u01/app/oracle/oradata/PROD1/redo02.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: ‘/u01/app/oracle/oradata/PROD1/system01.dbf‘
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 4833502 generated at 09/15/2017 15:19:37 needed for thread 1
ORA-00289: suggestion :
/u01/app/oracle/fast_recovery_area/PROD1/archivelog/2017_09_15/o1_mf_1_3_%u_.arc
ORA-00280: change 4833502 for thread 1 is in sequence #3
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/u01/app/oracle/oradata/PROD1/redo03.log
Log applied.
Media recovery complete.
SQL>
SQL>
SQL>
SQL> alter database open resetlogs;
Database altered.
以上是关于重建控制文件的操作的主要内容,如果未能解决你的问题,请参考以下文章