Monday, January 10, 2011

Redo log Corruption Recovery incomplete

Conditions for incomplete recovery:

- Must be in archive log mode
- Must have recent cold or hot backups
- Necessary archive log files must exist to roll forward
*********************************************

Recovery Procedure:

1.) Make sure that the database is shut down.

2.) Restore from last cold or hot backup all datafiles and controlfile(s).

3.) Open Server Manager.

4.) Open the database in mount mode:

Startup mount pfile=d:\orant\database\init[sid].ora

5.) Recover using:

Recover database using backup controlfile until cancel

6.) When prompted to apply existing archive logs, press [return]

ORA-00279: Change 11532 generated at 11/05/99 10:47:59 needed for thread 1
ORA-00289: Suggestion: d:\orant\database\archive\arch127.arc
ORA-00280: Change 11532 for thread 1 is in sequence #127
Specify log: ((RET)=suggested | filename | AUTO | CANCEL)

7.) When prompted to apply archive log that does not exist (current
redo log), type "CANCEL" (this is current/active redo log file when
database crashed).

ORA-00279: Change 11548 generated at 11/05/99 10:55:17 needed for thread 1
ORA-00289: Suggestion: d:\orant\database\archive\arch129.arc
ORA-00280: Change 11532 for thread 1 is in sequence #129
ORA-00278: Logfile 'd:\orant\database\archive\arch128.arc' no longer
needed for this recovery
Specify log: ((RET)=suggested | filename | AUTO | CANCEL)

8.) Copy the control file by typing:
Alter database backup controlfile to trace

9.) Issue "Shutdown Immediate".

10.) Edit/rename the trace file generated.

- Delete all lines before and including the line "Startup Nomount"
- Change "Noresetlogs" with "Resetlogs"
- Change the location of all redo logs away from corrupted disk
- Delete every line after the "Datafile" entry

Result Sample file (recotest.sql):

CREATE CONTROLFILE REUSE DATABASE "ITOR" RESETLOGS ARCHIVELOG
MAXLOGFILES 32
MAXLOGMEMBERS 4
MAXDATAFILES 50
MAXINSTANCES 16
MAXLOGHISTORY 1600
LOGFILE
GROUP 1 (
'D:\ORANT\DATABASE\LOGITOR\newlogdir\LOGITOR1A.LOG',
'D:\ORANT\DATABASE\LOGITOR\newlog\LOGITOR1B.LOG'
) SIZE 500K,
GROUP 2 (
'D:\ORANT\DATABASE\LOGITOR\newlog\LOGITOR2A.LOG',
'D:\ORANT\DATABASE\LOGITOR\newlog\LOGITOR2B.LOG'
) SIZE 500K,
GROUP 3 (
'D:\ORANT\DATABASE\LOGITOR\newlog\LOGITOR3A.LOG',
'D:\ORANT\DATABASE\LOGITOR\newlog\LOGITOR3B.LOG'
) SIZE 512K
DATAFILE
'D:\ORANT\DATABASE\LOGITOR\SYSTEMITOR.DBF',
'D:\ORANT\DATABASE\LOGITOR\DATA_1.TBL',
'D:\ORANT\DATABASE\LOGITOR\RBS_ITOR.DBF'
;

11.) Start server manager.

12.) Start database in nomount mode:

Startup nomount pfile=d:\orant\database\init[sid].ora

13.) Run controlfile script:

svrmgrl> @recotest.sql

14.) Open the database with redo logs in new location:

Alter database open resetlogs;

15.) Shutdown the database and perform a full backup.

No comments: