Recovery Redologs Online (ORACLE 11gR2)


Checking the redo log
[oracle@localhost OCM]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Wed Jan 29 11:43:38 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
SQL> col member for a55
SQL> select GROUP#, STATUS, TYPE, MEMBER from v$logfile;
GROUP# STATUS TYPE MEMBER
———- ——- ——- ——————————————————-
 3 ONLINE /u01/app/oracle/oradata/OCM/redo03.log
 2 ONLINE /u01/app/oracle/oradata/OCM/redo02.log
 1 ONLINE /u01/app/oracle/oradata/OCM/redo01.log
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/fast_recovery_area/OCM/archive1
Oldest online log sequence 11
Next log sequence to archive 13
Current log sequence 13 –last log sequence
SQL> shut immediate
Deleting all the redo logs online
[oracle@localhost OCM]$ ls -ltr *.log
-rw-r—– 1 oracle oinstall 52429312 Jan 29 12:02 redo02.log
-rw-r—– 1 oracle oinstall 52429312 Jan 29 12:02 redo03.log
-rw-r—– 1 oracle oinstall 52429312 Jan 29 12:05 redo01.log
[oracle@localhost OCM]$ rm *.log
[oracle@localhost OCM]$ ls -ltr *.log
ls: *.log: No such file or directory
Starting the database obviously get an error because the redo logs were eliminated.
SQL> startup
ORACLE instance started.
Total System Global Area 523108352 bytes
Fixed Size 1346052 bytes
Variable Size 398460412 bytes
Database Buffers 117440512 bytes
Redo Buffers 5861376 bytes
Database mounted.
ORA-03113: end-of-file on communication channel
Process ID: 4271
Session ID: 125 Serial number: 5
Status of the Database.
SQL> select instance_name, status from v$instance;
INSTANCE_NAME STATUS
—————- ————
OCM MOUNTED
Find out the last log sequence (previously found) and Recover till this sequence
run {
 allocate channel c1 type disk;
 allocate channel c2 type disk;
 set until sequence 13;
 restore database;
 recover database;
 sql ‘alter database open resetlogs’;
 release channel c1;
 release channel c2;
}
Recovery Manager complete.
Checking the REDOLOG ONLINE at level of Operating System.
[oracle@localhost OCM]$ ls -ltr *.log
-rw-r—– 1 oracle oinstall 52429312 Jan 29 12:17 redo03.log OK
-rw-r—– 1 oracle oinstall 52429312 Jan 29 12:17 redo02.log
-rw-r—– 1 oracle oinstall 52429312 Jan 29 12:19 redo01.log
[oracle@localhost OCM]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Wed Jan 29 12:19:30 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select instance_name, status from v$instance;
INSTANCE_NAME STATUS
—————- ————
OCM OPEN
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: