RMAN and archived redo log failover

RMAN and archived redo log failover

This is something that you might have already known, but it’s a cool thing when using RMAN that I want to show you.

As you may know Oracle Database has a feature called archived redo log failover, this feature allows RMAN to backup successfully the archived redo logs when you have at least 1 archived redo log available in 1 location.

So what I will do we have 2 locations where the online redo logs are being archived , called ARCH_1 and ARCH_2, and what I will do is corrupt an archived redo log and delete some other but still leave at least 1 available in 1 location

[oracle@em13c arch_1]$ ls
1_18_915547998.dbf 1_19_915547998.dbf 1_20_915547998.dbf 1_21_915547998.dbf 1_22_915547998.dbf 1_23_915547998.dbf
[oracle@em13c arch_1]$ dd if=/dev/zero of=1_23_915547998.dbf bs=8192 conv=notrunc seek=205 count=1
1+0 records in
1+0 records out
8192 bytes (8.2 kB) copied, 0.000208321 s, 39.3 MB/s
[oracle@em13c arch_1]$ rm 1_20_915547998.dbf
[oracle@em13c arch_1]$ cd ..
[oracle@em13c archives]$ ls
arch_1 arch_2
[oracle@em13c archives]$ cd arch_2
[oracle@em13c arch_2]$ ls
1_18_915547998.dbf 1_19_915547998.dbf 1_20_915547998.dbf 1_21_915547998.dbf 1_22_915547998.dbf 1_23_915547998.dbf
[oracle@em13c arch_2]$ rm 1_18_915547998.dbf
[oracle@em13c arch_2]$ ls
1_19_915547998.dbf 1_20_915547998.dbf 1_21_915547998.dbf 1_22_915547998.dbf 1_23_915547998.dbf

Now what I will do is run a crosscheck archivelog all , as I deleted some and running a backup will fail ,  once that is complete , I run a backup of my archived redo logs

[oracle@em13c arch_2]$ rman target /
Recovery Manager: Release 12.1.0.2.0 - Production on Wed Nov 9 20:34:07 2016
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: CDB12C (DBID=4114161052)
RMAN> crosscheck archivelog all;

...

RMAN> run {
2> allocate channel ch001 device type disk FORMAT '/home/oracle/archives/backup/%d_%s_%p_%c_%t.arc.rman';
3> backup archivelog all ;
4> release channel ch001;
5> }

using target database control file instead of recovery catalog
allocated channel: ch001
channel ch001: SID=55 device type=DISK

Starting backup at 09-NOV-16
current log archived
channel ch001: starting archived log backup set
channel ch001: specifying archived log(s) in backup set
input archived log thread=1 sequence=18 RECID=4 STAMP=927491153
input archived log thread=1 sequence=19 RECID=7 STAMP=927491154
input archived log thread=1 sequence=20 RECID=9 STAMP=927491155
input archived log thread=1 sequence=21 RECID=11 STAMP=927491211
input archived log thread=1 sequence=22 RECID=13 STAMP=927491212
input archived log thread=1 sequence=23 RECID=15 STAMP=927491213
input archived log thread=1 sequence=24 RECID=16 STAMP=927491973
channel ch001: starting piece 1 at 09-NOV-16
channel ch001: finished piece 1 at 09-NOV-16
piece handle=/home/oracle/archives/backup/CDB12C_6_1_1_927491973.arc.rman tag=TAG20161109T203933 comment=NONE
channel ch001: backup set complete, elapsed time: 00:00:01
Finished backup at 09-NOV-16

Starting Control File and SPFILE Autobackup at 09-NOV-16
piece handle=/u01/app/oracle/fast_recovery_area/CDB12C/autobackup/2016_11_09/o1_mf_s_927491974_d27myq4k_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 09-NOV-16

released channel: ch001

As you can see , the backup is complete and if I run a BACKUP VALIDATE DATABASE ARCHIVELOG ALL we can see that the STATUS is OK for all the archived redo logs and in distinct locations, which is where the RMAN backup used it from.

RMAN> BACKUP VALIDATE DATABASE ARCHIVELOG ALL;
...

List of Archived Logs
=====================
Thrd Seq Status Blocks Failing Blocks Examined Name
---- ------- ------ -------------- --------------- ---------------
1 18 OK 0 275 /home/oracle/archives/arch_1/1_18_915547998.dbf
1 19 OK 0 0 /home/oracle/archives/arch_1/1_19_915547998.dbf
1 20 OK 0 4 /home/oracle/archives/arch_2/1_20_915547998.dbf
1 21 OK 0 0 /home/oracle/archives/arch_2/1_21_915547998.dbf
1 22 OK 0 1 /home/oracle/archives/arch_2/1_22_915547998.dbf
1 23 OK 0 0 /home/oracle/archives/arch_1/1_23_915547998.dbf
Finished backup at 09-NOV-16

Conclusion

This is a very cool feature that RMAN allows you to do even when you have corrupt or missing archived redo logs in certain locations, as long as you have 1 valid location , you are good to go.

Rene Antunez
[email protected]
No Comments

Sorry, the comment form is closed at this time.