Thursday, November 19, 2009

ORA-01113 "Media Recovery"

Description:
Below error I noticed when I start the database.
ORA-01113: file 21 needs media recovery
ORA-01110: data file 21: '/ORAIndex2/testdb/test_big_idx01.dbf'

Solution I tried:
Step 1: Shutdown the database if it is running using the below
SQL>shutdown abort;

Step 2: Logged as SYSDBA
$sqlplus “/as sysdba”

Step 3: Start the database in Mount stage
SQL>startup mount;

To check status of the database use the below query
SQL> select status from v$instance;

STATUS
------------
MOUNTED

Step 4: Recover the database using controlfile backup
SQL> recover database until cancel using backup controlfile;
ORA-00279: change 2100514654 generated at 10/25/2009 15:02:01 needed for thread
1
ORA-00289: suggestion : /ORAArchive/testdb/1_7840.ARC
ORA-00280: change 2100514654 for thread 1 is in sequence #7840
Specify log: {=suggested | filename | AUTO | CANCEL}
/ORARedo1/testdb/redo01a.log
Log applied.
Media recovery complete.

Note: I logged into /ORAArchive/testdb directory I did not find any file 1_7840.ARC. Hence I used Redo Log files to recover the database.

Step 5: Open the database with Resetlog option:

SQL> alter database open resetlogs;
Database altered.

No comments: