So last night I decided to setup a test Physical Standby database. I had everything working correctly and when I started playing around with the Data Guard Broker I started having some problems. Now I can't get the logs to ship from the primary to the standby.
Version: Primary and Standby
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
OS: Primary and Standby
[oracle@dgdb0 trace]$ uname -a
Linux dgdb0.localdomain 2.6.32-100.28.5.el6.x86_64 #1 SMP Wed Feb 2 18:40:23 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
I first noticed a problem with a large gap in sequence numbers.
Standby
SQL> SELECT sequence#, applied from v$archived_log order by sequence#;
SEQUENCE# APPLIED
---------- ---------
8 YES
9 YES
10 YES
11 YES
12 YES
13 YES
14 YES
7 rows selected.
Primary
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 37
Next log sequence to archive 39
Current log sequence 39
Here is some of the configuration information on the primary:
SQL> show parameter db_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string dgdb0
SQL> show parameter db_unique_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_unique_name string dgdb0
SQL> show parameter log_archive_config
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_config string dg_config=(dgdb0,dgdb1)
SQL> show parameter log_archive_dest_2
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_2 string service=dgdb1 async valid_for=
(online_logfile,primary_role)
db_unique_name=dgdb1
Standby parameters
SQL> show parameter db_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string dgdb0
SQL> show parameter db_unique_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_unique_name string dgdb1
So I proceeded to run this query:
SQL> SELECT error from v$archive_dest WHERE dest_name='LOG_ARCHIVE_DEST_2';
ERROR
-----------------------------------------------------------------
ORA-16047: DGID mismatch between destination setting and target
database
The error description is:
Cause: The DB_UNIQUE_NAME specified for the destination does not match the DB_UNIQUE_NAME at the destination.
Action: Make sure the DB_UNIQUE_NAME specified in the LOG_ARCHIVE_DEST_n parameter defined for the destination matches the DB_UNIQUE_NAME parameter defined at the destination.
As you can see from above the DB_UNIQUE_NAME in the LOG_ARCHIVE_DEST_2 parameter matches that of the standby database.
Also DG_BROKER_START is set to false on both the primary and standby databases.
Finally, I've removed all the drc* files from the $ORACLE_HOME/dbs directories on both the primary and standby servers to ensure the broker is not configured.
Where did I go wrong? How can I get the standby caught up and working correctly again?
I apologized if I missed anything. I'm relatively new to standby databases.