Wednesday, January 6, 2016

12c Dataguard broker setup error ORA-16698

The Oracle Data Guard broker is a great management framework that automates and centralizes the creation, maintenance, and monitoring of Oracle Data Guard configurations.

Recently for a Primary Oracle RAC database I was in the process of setting up a RAC Dataguard broker in Oracle 12c - 12.1.0.2 on the latest Exadata X5-2 and encountered an error ORA-16698. The setup steps and error details and solution/workaround I used is below.

On the Primary RAC database ensure the broker file is on ASM and turn on the broker.

-- Primary

alter system set dg_broker_config_file1 = '+DATA/DROID/DATAFILE/dg1_DROID.dat' scope=both sid='*';
alter system set dg_broker_config_file2 = '+DATA/DROID/DATAFILE/dg2_DROID.dat' scope=both sid='*';

alter system set dg_broker_start=true scope=both sid='*';
On the Standby RAC database ensure the broker file is on ASM as well and turn on the broker.

-- Standby

alter system set dg_broker_config_file1 = '+DATA/DROIDDG/DATAFILE/dg1_DROIDDG.dat' scope=both sid='*';
alter system set dg_broker_config_file2 = '+DATA/DROIDDG/DATAFILE/dg2_DROIDDG.dat' scope=both sid='*';

alter system set dg_broker_start=true scope=both sid='*';

 
On the primary I invoked the dataguard broker and encountered the error when setting up the configuration for the standby database.
-- Back to Primary


DGMGRL> connect sys
Password:
Connected as SYSDG.
DGMGRL>  CREATE CONFIGURATION 'DROIDDR' AS PRIMARY DATABASE IS 'DROID' CONNECT IDENTIFIER IS DROID;
Configuration "DROIDDR" created with primary database "DROID"
DGMGRL> ADD DATABASE 'DROIDDG' AS CONNECT IDENTIFIER IS DROIDDG;
Error: ORA-16698: member has a LOG_ARCHIVE_DEST_n parameter with SERVICE attribute set

Failed.

Save the log archive destination settings from both the Primary and Standby databases then remove the configuration.
 
-- PRIMARY log_archive_dest_2 setting
log_archive_dest_2='SERVICE=DROIDDG ARCH VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=DROIDDG'

-- STANDBY log_archive_dest_2 setting
log_archive_dest_2='SERVICE=DROID ARCH VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=DROID'

-- Remove the Dataguard configuration

DGMGRL> remove configuration;
Removed configuration


 
Set the log_archive_dest_2 settings from both the Primary and Standby databases to be nothing.


alter system set log_archive_dest_2='' scope=both sid='*';
  
Disable then Enable the broker parameter on both the Primary and Standby databases.

-- Primary
alter system set dg_broker_start=false scope=both sid='*';
alter system set dg_broker_start=true scope=both sid='*';

-- Standby
alter system set dg_broker_start=false scope=both sid='*';
alter system set dg_broker_start=true scope=both sid='*';


On the Primary database create the broker configuration for the Primary and Standby database and this time it should work fine with no issues since the log archive destination 2 setting is not set, this is the workaround/solution.


[oracle@okx1pdbadm06 ~]$ dgmgrl
DGMGRL for Linux: Version 12.1.0.2.0 - 64bit Production

Copyright (c) 2000, 2013, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys
Password:
Connected as SYSDG.
DGMGRL>
DGMGRL>  CREATE CONFIGURATION 'DROIDDR' AS PRIMARY DATABASE IS 'DROID' CONNECT IDENTIFIER IS DROID;
Configuration "DROIDDR" created with primary database "DROID"
DGMGRL> ADD DATABASE 'DROIDDG' AS CONNECT IDENTIFIER IS DROIDDG;

 
Revert the original settings back for the log_archive_dest_2 settings from both Primary and Standby databases.


-- PRIMARY log_archive_dest_2
alter system set log_archive_dest_2='SERVICE=DROIDDG ARCH VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=DROIDDG' sid='*' scope=both;

-- STANDBY log_archive_dest_2
alter system set log_archive_dest_2='SERVICE=DROID ARCH VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=DROID' sid='*' scope=both;

  
Enable the broker configuration and we now have a successful 12c RAC dataguard broker configuration enabled on Exadata!


[oracle@okx1pdbadm06 ~]$ dgmgrl
DGMGRL for Linux: Version 12.1.0.2.0 - 64bit Production

Copyright (c) 2000, 2013, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys
Password:
Connected as SYSDG.
DGMGRL>

DGMGRL> enable configuration;
Enabled.
DGMGRL> show configuration;

Configuration - DROIDDR

  Protection Mode: MaxPerformance
  Members:
  DROID   - Primary database
    DROIDDG - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS   (status updated 315 seconds ago)





    

No comments:

Post a Comment