OraDataSystems.com

Thursday, November 11, 2010

Recover from Loss of All Control Files - from backup control file

RECOVER FROM CORRUPTION OF ALL CONTROL FILES USING BINARY BACKUP CONTROL FILE

Tue Oct 13 11:45:38 2009
Hex dump of (file 0, block 1) in trace file c:\oracle\product\10.2.0\admin\orcln
ew\bdump\orclnew_arc1_3816.trc
Corrupt block relative dba: 0x00000001 (file 0, block 1)
Fractured block found during control file header read
Data in bad block:
type: 0 format: 0 rdba: 0x00000000
last change scn: 0x0000.00000000 seq: 0x0 flg: 0x00
spare1: 0x0 spare2: 0x0 spare3: 0x0
consistency value in tail: 0x00000000
check value in block header: 0x0
block checksum disabled
Tue Oct 13 11:45:38 2009
Errors in file c:\oracle\product\10.2.0\admin\orclnew\bdump\orclnew_arc1_3816.tr
c:
ORA-00202: control file: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCLNEW\CONTROL01.CTL
'

Tue Oct 13 11:45:39 2009
Errors in file c:\oracle\product\10.2.0\admin\orclnew\bdump\orclnew_arc1_3816.tr
c:
ORA-00227: corrupt block detected in control file: (block 1, # blocks 1)
ORA-00202: control file: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCLNEW\CONTROL01.CTL
'

Tue Oct 13 11:45:39 2009
Errors in file c:\oracle\product\10.2.0\admin\orclnew\bdump\orclnew_arc1_3816.tr
c:
ORA-00227: corrupt block detected in control file: (block 1, # blocks 1)
ORA-00202: control file: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCLNEW\CONTROL01.CTL
'

Tue Oct 13 11:45:39 2009
Errors in file c:\oracle\product\10.2.0\admin\orclnew\bdump\orclnew_arc1_3816.tr
c:
ORA-00227: corrupt block detected in control file: (block 1, # blocks 1)
ORA-00202: control file: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCLNEW\CONTROL01.CTL
'

Master background archival failure: 227
Tue Oct 13 11:46:09 2009
Hex dump of (file 0, block 1) in trace file c:\oracle\product\10.2.0\admin\orcln
ew\bdump\orclnew_lgwr_5128.trc
Corrupt block relative dba: 0x00000001 (file 0, block 1)
Fractured block found during control file header read
Data in bad block:
type: 0 format: 0 rdba: 0x00000000
last change scn: 0x0000.00000000 seq: 0x0 flg: 0x00
spare1: 0x0 spare2: 0x0 spare3: 0x0
consistency value in tail: 0x00000000
check value in block header: 0x0
block checksum disabled
Tue Oct 13 11:46:09 2009
Errors in file c:\oracle\product\10.2.0\admin\orclnew\bdump\orclnew_lgwr_5128.tr
c:
ORA-00202: control file: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCLNEW\CONTROL01.CTL
'

Tue Oct 13 11:46:10 2009
Errors in file c:\oracle\product\10.2.0\admin\orclnew\bdump\orclnew_lgwr_5128.tr
c:
ORA-00227: corrupt block detected in control file: (block 1, # blocks 1)
ORA-00202: control file: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCLNEW\CONTROL01.CTL
'

LGWR: terminating instance due to error 227
Tue Oct 13 11:46:10 2009
Errors in file c:\oracle\product\10.2.0\admin\orclnew\bdump\orclnew_q001_4024.tr
c:
ORA-00227: corrupt block detected in control file: (block , # blocks )

Tue Oct 13 11:46:10 2009
Errors in file c:\oracle\product\10.2.0\admin\orclnew\bdump\orclnew_pmon_5988.tr
c:
ORA-00227: corrupt block detected in control file: (block , # blocks )

Tue Oct 13 11:46:10 2009
Errors in file c:\oracle\product\10.2.0\admin\orclnew\bdump\orclnew_j000_5208.tr
c:
ORA-00227: corrupt block detected in control file: (block , # blocks )

Tue Oct 13 11:46:10 2009
Errors in file c:\oracle\product\10.2.0\admin\orclnew\bdump\orclnew_dbw0_5032.tr
c:
ORA-00227: corrupt block detected in control file: (block , # blocks )

Tue Oct 13 11:46:11 2009
Errors in file c:\oracle\product\10.2.0\admin\orclnew\bdump\orclnew_ckpt_4876.tr
c:
ORA-00227: corrupt block detected in control file: (block , # blocks )

Tue Oct 13 11:46:12 2009
Errors in file c:\oracle\product\10.2.0\admin\orclnew\bdump\orclnew_psp0_6120.tr
c:
ORA-00227: corrupt block detected in control file: (block , # blocks )

Tue Oct 13 11:46:12 2009
Errors in file c:\oracle\product\10.2.0\admin\orclnew\bdump\orclnew_mman_4716.tr
c:
ORA-00227: corrupt block detected in control file: (block , # blocks )

Tue Oct 13 11:46:22 2009
Errors in file c:\oracle\product\10.2.0\admin\orclnew\bdump\orclnew_reco_2720.tr
c:
ORA-00227: corrupt block detected in control file: (block , # blocks )

Tue Oct 13 11:46:22 2009
Errors in file c:\oracle\product\10.2.0\admin\orclnew\bdump\orclnew_smon_2108.tr
c:
ORA-00227: corrupt block detected in control file: (block , # blocks )

Tue Oct 13 11:46:29 2009
Instance terminated by LGWR, pid = 5128

SQL> alter system switch logfile;
alter system switch logfile
*
ERROR at line 1:
ORA-00227: corrupt block detected in control file: (block , # blocks )


SQL> /
alter system switch logfile
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel


SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area 1073741824 bytes
Fixed Size 1294680 bytes
Variable Size 465571496 bytes
Database Buffers 599785472 bytes
Redo Buffers 7090176 bytes
ORA-00205: error in identifying control file, check alert log for more info

All Control Files lost.


sphilip@seadba01 /cygdrive/c/oracle/product/10.2.0/oradata/orclnewbkp
$ cp BACKUPCONTROLFILE.CTL ../orclnew/CONTROL01.CTL

sphilip@seadba01 /cygdrive/c/oracle/product/10.2.0/oradata/orclnewbkp
$ cd ../orclnew

sphilip@seadba01 /cygdrive/c/oracle/product/10.2.0/oradata/orclnew
$ ls -ltr CONTROL*
-rwxr-xr-x 1 sphilip mkgroup-l-d 7749632 Oct 13 11:50 CONTROL01.CTL

sphilip@seadba01 /cygdrive/c/oracle/product/10.2.0/oradata/orclnew
$ cp CONTROL01.CTL CONTROL02.CTL

sphilip@seadba01 /cygdrive/c/oracle/product/10.2.0/oradata/orclnew
$ cp CONTROL01.CTL CONTROL03.CTL

sphilip@seadba01 /cygdrive/c/oracle/product/10.2.0/oradata/orclnew
$ ls -ltr CONTROL*
-rwxr-xr-x 1 sphilip mkgroup-l-d 7749632 Oct 13 11:50 CONTROL01.CTL
-rwxr-xr-x 1 sphilip mkgroup-l-d 7749632 Oct 13 11:51 CONTROL02.CTL
-rwxr-xr-x 1 sphilip mkgroup-l-d 7749632 Oct 13 11:51 CONTROL03.CTL

sphilip@seadba01 /cygdrive/c/oracle/product/10.2.0/oradata/orclnew
$ chmod 777 CONTROL*

sphilip@seadba01 /cygdrive/c/oracle/product/10.2.0/oradata/orclnew
$ ls -ltr CONTROL*
-rwxrwxrwx 1 sphilip mkgroup-l-d 7749632 Oct 13 11:50 CONTROL01.CTL
-rwxrwxrwx 1 sphilip mkgroup-l-d 7749632 Oct 13 11:51 CONTROL02.CTL
-rwxrwxrwx 1 sphilip mkgroup-l-d 7749632 Oct 13 11:51 CONTROL03.CTL

ORACLE instance shut down.
SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area 1073741824 bytes
Fixed Size 1294680 bytes
Variable Size 469765800 bytes
Database Buffers 595591168 bytes
Redo Buffers 7090176 bytes
Database mounted.
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-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCLNEW\SYSTEM01.DBF'

SQL> recover database using backup controlfile;
ORA-00279: change 14032132 generated at 10/13/2009 11:40:02 needed for thread 1
ORA-00289: suggestion :
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCHIVE\ORCLNEW\ARC00095_0684492530.001
ORA-00280: change 14032132 for thread 1 is in sequence #95


Specify log: {=suggested | filename | AUTO | CANCEL}
AUTO
ORA-00308: cannot open archived log
'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCHIVE\ORCLNEW\ARC00095_0684492530.001'
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 2) The system cannot find the file specified.


ORA-00308: cannot open archived log
'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCHIVE\ORCLNEW\ARC00095_0684492530.001'
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 2) The system cannot find the file specified.


SQL>

ALTER DATABASE RECOVER database using backup controlfile
Tue Oct 13 11:59:19 2009
Media Recovery Start
WARNING! Recovering data file 1 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 2 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 3 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 4 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 5 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 6 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 7 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 8 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 9 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 10 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 11 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 12 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 13 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 14 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 15 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 16 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 17 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 18 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 19 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 20 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 21 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 22 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 23 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 24 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 25 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 26 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 27 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 28 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 29 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 30 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 31 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 32 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 33 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 34 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 35 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 36 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 37 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 38 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 39 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 40 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 41 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 42 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 43 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
parallel recovery started with 2 processes
ORA-279 signalled during: ALTER DATABASE RECOVER database using backup controlf
ile ...
Tue Oct 13 12:01:32 2009
ALTER DATABASE RECOVER CONTINUE DEFAULT
Tue Oct 13 12:01:32 2009
Media Recovery Log C:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCHIVE\ORCLNEW\ARC00095_068
4492530.001
Errors with log C:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCHIVE\ORCLNEW\ARC00095_068449
2530.001
ORA-308 signalled during: ALTER DATABASE RECOVER CONTINUE DEFAULT ...
Tue Oct 13 12:01:32 2009
ALTER DATABASE RECOVER CONTINUE DEFAULT
Tue Oct 13 12:01:32 2009
Media Recovery Log C:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCHIVE\ORCLNEW\ARC00095_068
4492530.001
Errors with log C:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCHIVE\ORCLNEW\ARC00095_068449
2530.001
ORA-308 signalled during: ALTER DATABASE RECOVER CONTINUE DEFAULT ...
Tue Oct 13 12:01:32 2009
ALTER DATABASE RECOVER CANCEL
Tue Oct 13 12:01:45 2009
Media Recovery Canceled
Completed: ALTER DATABASE RECOVER CANCEL

NAME FIRST_CHANGE# NEXT_CHANGE#
------------------------------------------------------------ ------------- ------------
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCHIVE\ORCLNEW\ARC00089_06 14011324 14011364
84492530.001

C:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCHIVE\ORCLNEW\ARC00090_06 14011364 14011367
84492530.001

C:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCHIVE\ORCLNEW\ARC00091_06 14011367 14011370
84492530.001

C:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCHIVE\ORCLNEW\ARC00092_06 14011370 14011380
84492530.001

NAME FIRST_CHANGE# NEXT_CHANGE#
------------------------------------------------------------ ------------- ------------

C:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCHIVE\ORCLNEW\ARC00093_06 14011380 14011383
84492530.001

C:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCHIVE\ORCLNEW\ARC00094_06 14011383 14031658
84492530.001


488 rows selected.

SQL>
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-01113: file 1 needs media recovery
ORA-01110: data file 1: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCLNEW\SYSTEM01.DBF'


SQL> recover database using backup controlfile;
ORA-00279: change 14032132 generated at 10/13/2009 11:40:02 needed for thread 1
ORA-00289: suggestion :
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCHIVE\ORCLNEW\ARC00095_0684492530.001
ORA-00280: change 14032132 for thread 1 is in sequence #95

SQL> select group#,sequence# from v$log;

GROUP# SEQUENCE#
---------- ----------
1 95
3 93
2 94


Specify log: {=suggested | filename | AUTO | CANCEL}
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCLNEW\REDO1A.LOG
Log applied.
Media recovery complete.

Tue Oct 13 12:04:21 2009
ALTER DATABASE RECOVER LOGFILE 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCLNEW\REDO
1A.LOG'
Tue Oct 13 12:04:21 2009
Media Recovery Log C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCLNEW\REDO1A.LOG
Tue Oct 13 12:04:33 2009
Completed: ALTER DATABASE RECOVER LOGFILE 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\O
RCLNEW\REDO1A.LOG'
Tue Oct 13 12:05:54 2009
alter database open resetlogs


1* select sequence#,FIRST_CHANGE#,TO_CHAR(FIRST_TIME,'DD-MON-YYYY HH:MI:SS'),NEXT_CHANGE#,TO_CHAR(NEXT_TIME,'DD-MON-YYYY HH:MI:SS'),ARCHIVED,APPLIED from v$archived_log where to_char(first_time,'DD-MON-YY')='13-OCT-09' order by sequence#,resetlogs_id
SQL> /

SEQUENCE# FIRST_CHANGE# TO_CHAR(FIRST_TIME,' NEXT_CHANGE# TO_CHAR(NEXT_TIME,'D ARC APP
---------- ------------- -------------------- ------------ -------------------- --- ---
73 13987064 13-OCT-2009 09:31:35 13987105 13-OCT-2009 09:32:20 YES NO
74 13987105 13-OCT-2009 09:32:20 13987108 13-OCT-2009 09:32:24 YES NO
75 13987108 13-OCT-2009 09:32:24 13987708 13-OCT-2009 09:51:44 YES NO
76 13987708 13-OCT-2009 09:51:44 13987710 13-OCT-2009 09:51:45 YES NO
77 13987710 13-OCT-2009 09:51:45 14007712 13-OCT-2009 10:36:41 YES NO
78 14007712 13-OCT-2009 10:36:41 14008308 13-OCT-2009 10:45:31 YES NO
79 14008308 13-OCT-2009 10:45:31 14008310 13-OCT-2009 10:45:31 YES NO
80 14008310 13-OCT-2009 10:45:31 14008313 13-OCT-2009 10:45:37 YES NO
81 14008313 13-OCT-2009 10:45:37 14008325 13-OCT-2009 10:46:12 YES NO
82 14008325 13-OCT-2009 10:46:12 14008327 13-OCT-2009 10:46:13 YES NO
83 14008327 13-OCT-2009 10:46:13 14008329 13-OCT-2009 10:46:17 YES NO

SEQUENCE# FIRST_CHANGE# TO_CHAR(FIRST_TIME,' NEXT_CHANGE# TO_CHAR(NEXT_TIME,'D ARC APP
---------- ------------- -------------------- ------------ -------------------- --- ---
84 14008329 13-OCT-2009 10:46:17 14011258 13-OCT-2009 11:23:33 YES NO
85 14011258 13-OCT-2009 11:23:33 14011313 13-OCT-2009 11:23:44 YES NO
86 14011313 13-OCT-2009 11:23:44 14011317 13-OCT-2009 11:23:53 YES NO
87 14011317 13-OCT-2009 11:23:53 14011321 13-OCT-2009 11:24:01 YES NO
88 14011321 13-OCT-2009 11:24:01 14011324 13-OCT-2009 11:24:08 YES NO
89 14011324 13-OCT-2009 11:24:08 14011364 13-OCT-2009 11:25:12 YES NO
90 14011364 13-OCT-2009 11:25:12 14011367 13-OCT-2009 11:25:17 YES NO
91 14011367 13-OCT-2009 11:25:17 14011370 13-OCT-2009 11:25:23 YES NO
92 14011370 13-OCT-2009 11:25:23 14011380 13-OCT-2009 11:25:25 YES NO
93 14011380 13-OCT-2009 11:25:25 14011383 13-OCT-2009 11:25:29 YES NO
93 14011380 13-OCT-2009 11:25:25 14011383 13-OCT-2009 11:25:29 YES YES

SEQUENCE# FIRST_CHANGE# TO_CHAR(FIRST_TIME,' NEXT_CHANGE# TO_CHAR(NEXT_TIME,'D ARC APP
---------- ------------- -------------------- ------------ -------------------- --- ---
94 14011383 13-OCT-2009 11:25:29 14031658 13-OCT-2009 11:38:37 YES NO
94 14011383 13-OCT-2009 11:25:29 14031658 13-OCT-2009 11:38:37 YES YES
95 14031658 13-OCT-2009 11:38:37 14032304 13-OCT-2009 12:05:56 YES NO

25 rows selected.


SQL> select distinct(checkpoint_change#),to_char(CHECKPOINT_TIME,'DD-MON-YYYY HH:MI:SS') from v$datafile;

CHECKPOINT_CHANGE# TO_CHAR(CHECKPOINT_T
------------------ --------------------
14032305 13-OCT-2009 12:06:28

No comments:

Post a Comment