Wednesday, November 27, 2019

How to take consistent backups at standby site

How to take an offline, consistent, self-contained backup at the standby site. The aim of this exercise is to have a self-contained backup that can be restored on its own without needing recovery.  I.e., since recovery of standby is stopped, the backup is a cold backup.  

1) stop managed recovery:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

2) backup the database and controlfile

Please note :- If you have a recovery catalog configured you can connect to it and take a backup.
Both the Primary and Standby database should use the same recovery catalog. Even though these database share the same DBID,Rman is able to differentiate the standby database from Primary .
Note you do not need to register the standby database in the catalog if the primary is already registered. Simply connect to the standby as target and then connect to recovery catalog for taking backup.


RMAN> backup database plus archivelog ;

RMAN> backup current controlfile; 


Note: In 10g, you will need to backup the controlfile from the primary site.

The above will result in a consistent, self-contained backup.

3) restart managed recovery:


To restore from this backup:
RMAN> startup nomount;
RMAN> restore controlfile from 'controlfile backuppiece name and location';
RMAN> alter database mount;
RMAN> restore database;
RMAN> recover database noredo;


No comments:

Post a Comment

Enable YUM in OCI DBaaS Compute Instances

 If you have some DBaaS computes nodes in your OCI, you will note that they don't come with any YUM repo configured by default. This is...