45 liens privés
===> No Archivelog mode:-
a) Online redolog file in INACTIVE and UNUSED state:-
This would not require crash recovery. Clear the logfile group and recreate the group manually by deleting the log file.
Commands:-
SQL> ALTER DATABASE CLEAR LOGFILE GROUP ;
SQL>ALTER DATABASE DROP LOGFILE GROUP ;
Delete the redolog file from the physical location.
SQL>ALTER DATABASE ADD LOGFILE GROUP ('/oracle/dbs/log1c.rdo', '/oracle/dbs/log2c.rdo') SIZE 10M;
b) Online redolog file in ACTIVE state:-
This would require crash recovery. Issue a checkpoint.
Command:-
SQL>ALTER SYSTEM CHECKPOINT;
If the check point failed, then please do a complete recovery of the database from the last full backup. The steps to perform complete recovery are explained in the complete recovery section.
c) Online redolog file in CURRENT state:-
The LGWR will be terminated in this case and you have to perform complete recovery from cold backup.
===> Archivelog mode:-
a) Online redolog file in UNUSED state:-
The steps would be same as that of no archivelog mode.
b) Online redolog file in INACTIVE state:-
Check your redolog file is archive or not.
Command:-
SQL> set linesize 160
SQL> select group#,thread#,sequence#,members,status,archived from v$log;
Yes:-follow the same step as noarchive log mode.
No:- Issue the below command.
SQL>ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP ;
After this command there would be a gap in the archive log. So do complete recovery from backup.
c) Online redolog file in ACTIVE state:-
Perform a check point and if it fails then perform a complete recovery.
Command:-
SQL>ALTER SYSTEM CHECKPOINT;
d) Online redolog file in CURRENT state:-
The LGWR will be terminated in this case. We would have to perform incomplete recovery.
Steps for complete recovery:-
- Using RMAN
- Using multiplex copy of redolog file
a) Using RMAN:-
Connect to the target database and perform a recovery.
Commands:-
D:>rman target sys/@
RMAN> RESTORE DATABASE;
RMAN>RECOVER DATABASE;
RMAN>ALTER DATABASE OPEN;
b) Using Backup of redolog file:-
Apply the multiplex copy of redolog file and start the database.
SQL> alter database open;
Steps for Incomplete recovery:-
-
First find out the first change for the redolog file. This would be the SCN number.
Command:-
SQL> set linesize 160
SQL> select group#,thread#,sequence#,members,status,to_char(first_change#) first_change,to_char(first_time,'YYYYMMDD HH:MI:SS') first_time from v$log;
FIRST_CHANGE123456
-
Connect to RMAN and perform the incomplete recovery until SCN number -1;
Command:-
C:>rman target sys
RMAN> RESTORE DATABASE UNTIL SCN ;
RMAN> restore database until scn 123455;
RMAN> recover database until scn 123455;
RMAN> alter database open resetlogs;