Database Reference
In-Depth Information
It may be that when you try to clear the log file you will receive an error that indicates
that the log file needs to be archived:
SQL> alter database clear logfile group 1;
alter database clear logfile group 1
*
ERROR at line 1:
ORA-00350: log 1 of instance orcl (thread 1) needs to be archived
ORA-00312: online log 1 thread 1: '/oracle01/oradata/orcl/redo01.log'
Since the log file is not there, it cannot be archived. You can use the
ALTER DATABASE
CLEAR UNARCHIVED LOGFILE
command to clear the unarchived log file and rebuild the log
file in its current location, as shown here:
SQL> alter database clear
2 unarchived logfile '/oracle01/oradata/orcl/redo01.log';
You will need to back up your database in this case, since an archived redo log will have
been lost.
Sometimes the database will not crash but will freeze. In this case, you will open another
SQL*Plus session as a user with SYSDBA privileges and issue the
ALTER SYSTEM CHECKPOINT
command followed by either the
ALTER DATABASE CLEAR LOGFILE
or the
ALTER DATABASE
CLEAR UNARCHIVED LOGFILE
command, depending on the type of recovery required. After
issuing these commands, the database should operate as usual.
Back Up the Database after Clearing Unarchived log Files
Sometimes the database will crash as a result of the loss of the online redo log group. In
this case, you will need to follow this procedure:
1.
From SQL*Plus, log in as
SYS
using SYSDBA privileges.
2.
Mount the database using the
STARTUP MOUNT
command.
3.
Issue the
ALTER DATABASE CLEAR LOGFILE GROUP
SQL command.
4.
Open the database with the
ALTER DATABASE OPEN
command.
Dealing with the Loss of an Active but Not Current Online
Redo Log Group
Loss of an
ACTIVE
(as shown in
V$LOG
column status) online redo log group requires the use of
the
ALTER DATABASE CLEAR UNARCHIVED LOGFILE
command, as shown in the previous section.
Search WWH ::
Custom Search