Friday, July 15, 2016

RDBMS -- how to rollforward a database using incremental backups after a failed duplicate/recovery session

In this post, I will give a quick tip about the incremental backup based recovery.
I will explain the concept by giving an example "rman duplicate" scenario.
Actually, this type of incremental backup based recovery is automatically done by the rman duplicate command. However, I will show you a failed automatic recovery that is supposed to be done by a rman duplicate and then, I will give you the command to roll forward the database using the incremental backups.

The error in this example is so obvious. That is, it is a Linux permission denied error and what rman clearly says with this error is "I can't read the backup files(incremental in this case) , because I don't have the necessary filesystem permission"

At this point, if we summarize the situation we can say that:
we restored our database (level 0 backup), but it is not up-to-date.
So, we have 2 choices to roll forward the database to current time
1) archivelog apply
2) incremental backup + archivelog

In fact, if we have incremental backups for the level0 we have restored, it is more reasonable to recover our database using those incremental backup.

This is because; if the level0 was taken a long time ago and if, we choose applying all the archivelogs generated since the level0 was taken, we ll probably have to apply lots of archivelog..

So, in this case, the things that we need do for makin rman use the incremental backups for recovering our newly restored database, are as follows;

1) We fix the permission issues for the backup files (chmod or chown)
2) We connect our mountented duplicate database using rman target /
3) We register the incremental backups using catalog start with (catalog start with 'BACKUP1/LEVEL_1')
4) We execute "recover database" command.!! So here is the surprise :))) we just simple execute recover database command. So, in conclusion, Rman already knows that, it is better to recover a database using incremental backups if they are available :)
5)We apply the archivelogs, which could be created since the time that we have taken our level1 backup, to make our database consistent and up-to-date. (Remember all the backups -- "including rman backups", which are taken while the databases are open, are inconsistent)

Awarded TOP 60 Oracle Blog

About Me

Erman Arslan is currently working as “Applications and Database
Operations Manager” and “Leading Oracle Consultant” for one of the
biggest Oracle Partner Company in Turkey.

He is a “Principle Apps
Dba”, “Oracle-certified Linux” and Certified Exadata Admin” with lots
of field experience in several Oracle projects implemented in several
sectors.

He studied Computer Engineering and received an MBA in istanbul
Turkey. He is a blogger who has written about Oracle Technologies
(“Erman Arslan’ Oracle Blog”) since
2013.

Arslan is the author of the book "Practical Oracle E-Business Suite" (Apress 2016).

Arslan also answers the questions of his readers and provides
support for their problems in his Oracle forum. (“Erman Arslan’s Oracle
Forum").

In addition to the administration and implementation works,
Arslan has developed applications for helping the Oracle Dbas in routine
administration works such as backup and recovery, deployments and performance.

As part of the consultancy work, Arslan has done several Oracle environment healthchecks and general
recoverability assessments in critical customer environments.

Arslan has completed several EBS migrations, Core Database migrations and replatforming projects. He
also played part as the Apps DBA Lead in 6 EBS 12.2 projects, which have gone live in 2015 and in 2016.
As part of the Apps Dba, Core Dba and Engineered Systems support responsibilities, he has managed
more than 15 Critical Customer Production Environments (mostly EBS, but also including Exadata, Oracle
Database Appliance, SSO, OID, and Weblogic Application Servers as well).

Arslan also has worked as DB
SME in very critical assesment and migration projects which are done by EMC in Banking Sector.