The Purpose of this Article is to show how to sync a primary and standby database with a RMAN recovery catalog. For example if the Production Backup is to be run from the Standby Database.
Problem Details
Problem Statement
Syncing a RMAN recovery catalog from a Primary or a Standby Databases with the from DB_UNIQUE_NAME all clause.
Applicable Error Code
RMAN-03002: failure of register command at 05/12/2017 12:25:40
RMAN-01005: Mounted control file type must be CURRENT to register the database
RMAN-03002: failure of resync from db_unique_name command at 05/15/2017 09:25:21
ORA-17629: Cannot connect to the remote database server
ORA-17627: ORA-12154: TNS:could not resolve the connect identifier specified
ORA-17629: Cannot connect to the remote database server
Pre-requisities
The names, number and locations of the Redo Log members must be consistent across the Primary/Standby sites.Otherwise the following error can be experienced:
RMAN-03002: failure of allocate command at 05/10/2017 03:00:20 RMAN-03014: implicit resync of recovery catalog failed RMAN-03009: failure of partial resync command on default channel at 05/10/2017 03:00:20 RMAN-20036: invalid record order.
Relevant Metalink Note: Resync Catalog From db_unique_name All; Fails With RMAN-20036 (Doc ID 1460889.1)
Affected Platforms
Oracle 11gR2 onwards
Ensure the Standby database has an Unique Name as identified by the db_unique_name parameter.
See example below:
Standby
SQL> select name, database_role, db_unique_name from v$database;
NAME DATABASE_ROLE DB_UNIQUE_NAME
--------- ---------------- ------------------------------
TESTDB PHYSICAL STANDBY TESTDB_STBY
Primary
SQL> select name, database_role, db_unique_name from v$database;
NAME DATABASE_ROLE DB_UNIQUE_NAME
--------- ---------------- ------------------------------
TESTDB PRIMARY TESTDB
The Standby And Primary Databases need to be registered with the listener and connect strings matching the db_unique_name values configured for the primary database and standby databases. This enables RMAN to connect remotely and perform re synchronization when the RESYNC CATALOG FROM DB_UNIQUE_NAME command is used.
oracle@dbvlab03[/home/oracle]: rman target / catalog rman/rman@laa
Recovery Manager: Release 11.2.0.4.0 - Production on Mon May 15 09:36:52 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: TESTDB (DBID=2725042839)
connected to recovery catalog database
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
RMAN>CONFIGURE DB_UNIQUE_NAME 'TESTDB_STBY' CONNECT IDENTIFIER 'TESTDB_STBY';
RMAN> list db_unique_name of database;
List of Databases DB Key DB Name DB ID Database Role Db_unique_name
------- ------- ----------------- --------------- ------------------
1849 TESTDB 2725042839 PRIMARY TESTDB
1849 TESTDB 2725042839 STANDBY TESTDB_STBY
RMAN> resync catalog from db_unique_name all;
starting full resync of recovery catalog
full resync complete resyncing from database with DB_UNIQUE_NAME TESTDB_STBY
The same operation can be performed from the Standby
RMAN> resync catalog from db_unique_name all;
resyncing from database with DB_UNIQUE_NAME TESTDB
starting full resync of recovery catalog
full resync complete
Comments