Backup Database from Standby Server using Standby database.

Follow
Problem Description

The backup should be performed during a period when the Dbvisit Standby schedule is not running on the standby database. You do not need to stop the primary node schedules.

Steps Performed

Step 1: Set The Environment

First configure RMAN environment on the standby database:

RMAN> show all;

RMAN configuration parameters for database with db_unique_name PROD are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_PROD.f'; # default

RMAN> configure controlfile autobackup on;

new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

RMAN> configure device type disk backup type to compressed backupset;

new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 1;
new RMAN configuration parameters are successfully stored

RMAN> configure channel device type disk format '/backup/rman/PROD_%U';

new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/backup/rman/PROD_%U';
new RMAN configuration parameters are successfully stored

RMAN> configure controlfile autobackup format for device type disk to '/backup/rman/PROD_cfc_%F';

new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/backup/rman/PROD_cfc_%F';
new RMAN configuration parameters are successfully stored

Step 2: Catalog The ARCHDEST Contents

As part of standby database backup, also include archive logs. The archive logs on the standby server will be located in the ARCHDEST folder set during standby configuration. As the logs will be in the ARCHDEST folder and not registered with the controlfile, catalog the archive logs before backing them up. This can easily be done with the catalog RMAN command:

Note: The RMAN process will not recognise the zipped files. For this you need to unzip the file first.

RMAN> catalog start with '/u01/app/oracle/archive/PROD/' noprompt;

using target database control file instead of recovery catalog
searching for all files that match the pattern /u01/app/oracle/archive/PROD/

List of Files Unknown to the Database
=====================================
File Name: /u01/app/oracle/archive/PROD/thread_1_seq_1373.466.790786927
File Name: /u01/app/oracle/archive/PROD/thread_1_seq_1522.311.791223039
File Name: /u01/app/oracle/archive/PROD/thread_1_seq_1558.1028.791244677
File Name: /u01/app/oracle/archive/PROD/thread_1_seq_1561.1076.791246481
File Name: /u01/app/oracle/archive/PROD/thread_2_seq_1158.2203.790683059
File Name: /u01/app/oracle/archive/PROD/thread_2_seq_1680.774.791311711
..
..
File Name: /u01/app/oracle/archive/PROD/thread_1_seq_1328.943.790720273
File Name: /u01/app/oracle/archive/PROD/thread_2_seq_1430.1827.791162491
File Name: /u01/app/oracle/archive/PROD/thread_2_seq_1575.2057.791250061
File Name: /u01/app/oracle/archive/PROD/thread_2_seq_1260.981.790745457
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u01/app/oracle/archive/PROD/thread_1_seq_1373.466.790786927
File Name: /u01/app/oracle/archive/PROD/thread_1_seq_1522.311.791223039
File Name: /u01/app/oracle/archive/PROD/thread_1_seq_1558.1028.791244677
File Name: /u01/app/oracle/archive/PROD/thread_1_seq_1561.1076.791246481
File Name: /u01/app/oracle/archive/PROD/thread_2_seq_1158.2203.790683059
File Name: /u01/app/oracle/archive/PROD/thread_2_seq_1680.774.791311711
..
..
File Name: /u01/app/oracle/archive/PROD/thread_1_seq_1328.943.790720273
File Name: /u01/app/oracle/archive/PROD/thread_2_seq_1430.1827.791162491
File Name: /u01/app/oracle/archive/PROD/thread_2_seq_1575.2057.791250061
File Name: /u01/app/oracle/archive/PROD/thread_2_seq_1260.981.790745457

RMAN>

The standby database controlfile will now be aware of these archive logs.

Step 3: Backup The Database and Archivelogs

To backup the database you can use incremental or full backups.

RMAN> run {
2> backup filesperset 5 database;
3> catalog start with '/u01/app/oracle/archive/PROD/' noprompt;
4> backup filesperset 200 archivelog all;
5> }

Adding catalog start with '/u01/app/oracle/archive/PROD/' noprompt will ensure all archive logs that might have arrived on the standby database while the database is being backed up are also included in the archivelog backup.

You now have a backup of the database. This backup can now be used to perform restore and recovery operations on the primary if required.

Komal Sachdeva March 04, 2015 11:01

Have more questions? Submit a request

Comments