Backup Options   «Prev  Next»

Lesson 5Recovering a Database with inactive Redo Logs
ObjectiveRecover a Database with Inactive Redo Logs

Recovering Database with Inactive Redo Logs

Let us say you just spent 2 hours fixing the problems in your database and put it in ARCHIVELOG mode. Before you make a backup of this database, you decide to test the automatic creation of the archived log function. You issue the ALTER SYSTEM SWITCH LOGFILE command. The second time you issue the command you get the following error message:

SVRMGR> alter system switch logfile; 
ORA-00740: LGWR process terminated with error

As an experienced DBA, you immediately know that a background process is abnormally terminated and the Oracle instance is aborted. Since you do not have a backup of the fixed database and you do not want to spend another two hours fixing those problems, what can you do?
Solution
In this situation, the only option you have is to recover the database with inactive redo logs. View the SlideShow below to go through the steps.



Recovering Database Redo Log File

The code and all the command lines are displayed below.
SVRMGR> STARTUP OPEN PFILE='C:\ORANT\DATABASE\INITORCL.ORA'
ORACLE instance started.
Total System Global Area                         11710464 bytes
Fixed Size                                          49152 bytes
Variable Size                                    11177984 bytes
Database Buffers                                   409600 bytes
Redo Buffers                                        73728 bytes
Database mounted.
ORA-00313: open failed for members of log group 4 of thread 1
ORA-00312: online log 4 thread 1: 'C:\ORANT\DATABASE\LOG1ORCL.ORA'
SVRMGR> SELECT * FROM V$LOG; 
GROUP# THREAD# ... MEMBERS    ARC   STATUS     FIRST_CHAN FIRST_TIM
------ -------   -------    ---   ---------- ---------- ---------
     1       1         1     NO    CURRENT      6402439 28-FEB-00
     2       1         1    YES    INACTIVE     6382423 28-FEB-00
     3       1         1    YES    INACTIVE     6322223 25-FEB-00
     4       1         1    YES    INACTIVE     6342407 26-FEB-00
4 rows selected.
SVRMGR> ALTER DATABASE CLEAR LOGFILE GROUP 4; 
Statement processed.
SVRMGR> ALTER DATABASE OPEN; 
Statement processed.
SVRMGR>

Is incomplete recovery necessary?

When an online redo log file is lost or damaged due to media failure, it becomes almost impossible to perform a complete recovery. However, you may find that there is no data loss in the following situations:
  1. The damaged or lost online redo log is not current
  2. This online redo log is already archived
  3. The database has mirrored online redo log files
In these situations, incomplete database recovery is unnecessary. You can recover the database by getting rid of the damaged online redo log and creating a new one.
The next lesson demonstrates how to recreate an online redo log file.

Recovering Database with Inactive RedoLogs - Quiz

Click the Quiz link below to review your understanding of database recovery with inactive redo logs.
Recovering Database with Inactive RedoLogs - Quiz