Wednesday, December 6, 2023

Add Oracle Physical Standby to Existing Data guard BROKER Configuration

 

 
PRIMARY  : oradb_prim
STANDBY  :  oradb_std
ORACLE Version : 19c
 
Assuming tnsping using TNSNAME is working from both sides.

On Standby :

sho parameter broker

 alter system set dg_broker_config_file1='+DATAC1/ORADB_STD/DATAGUARDCONFIG/oradb_primdg1.dat' scope=both sid='*'; 

 alter system set dg_broker_config_file2='+DATAC1/ORADB_STD/DATAGUARDCONFIG/oradb_primdg2.dat' scope=both sid='*';

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

sho parameter broker

 

From primary

$ dgmgrl /

show configuration;            

    --- Add Standby database into Broker Config                                  
add database oradb_std  as connect identifier is oradb_std maintained as physical;
 

enable configuration;

show configuration;

        --- Add Redo Routes for Primary

show database oradb  redoroutes;

edit database oradb_prim set property RedoRoutes='(local:oradb_std ASYNC)';   -- Change as per requirements

  -- As soon as Redo property is added oracle dest_ parameter will set in database Automatically

show database oradb_prim redoroutes;

 

edit database 'oradb_std' set state='apply-off';

edit database 'oradb_std' set state='apply-on';

Enable configuration

            --- Optionally adjust some properties as you like

DGMGRL> edit database oradb_std set property TransportLagThreshold='900';

Property "transportlagthreshold" updated

 

DGMGRL> edit database oradb_std set property ApplyLagThreshold='900';

Property "applylagthreshold" updated



Enable Physical standby BROKER Configuration for oracle Primary


Primary : PRIMDB  
Standby  : primdb_std 
 
On primary :
 
12:14:55 SYSTEM@PRIMDB >sho parameter broker
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
connection_brokers                   string      ((TYPE=DEDICATED)(BROKERS=1)),
                                                  ((TYPE=EMON)(BROKERS=1))
dg_broker_config_file1               string      /opt/oracle/product/19.3.0/dbs
                                                 /dr1primdb.dat
dg_broker_config_file2               string      /opt/oracle/product/19.3.0/dbs
                                                 /dr2primdb.dat
dg_broker_start                      boolean     FALSE
use_dedicated_broker                 boolean     FALSE
 
12:15:05 SYSTEM@PRIMDB > show parameter log_archive_config
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_config                   string
 
oraclehost:PRIMDB:/home/oracle $ dgmgrl /
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Thu Jul 27 11:45:14 2023
Version 19.17.0.0.0
 
Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.
 
Welcome to DGMGRL, type "help" for information.
Connected to "PRIMDB"
Connected as SYSDG.
DGMGRL> show configuration
ORA-16525: The Oracle Data Guard broker is not yet available.
 
Configuration details cannot be determined by DGMGRL
 
 
 
SYNTAX:
DGMGRL> CREATE CONFIGURATION '<configuration name>' AS PRIMARY DATABASE IS '<primary db_unique_name>' CONNECT IDENTIFIER IS <primary connect string>;
 
 
DGMGRL>  create configuration Primdb_dg as primary database is 'PRIMDB' connect identifier is PRIMDB ;
Error:
ORA-16525: The Oracle Data Guard broker is not yet available.
 
 
Fix : set “dg_broker_start” to TRUE
 
11:50:11 SYSTEM@PRIMDB >   alter system set dg_broker_start=true sid='*';
 
System altered.
 
Also you can set desired broker config file path using below

alter system set dg_broker_config_file1='+<path>/DATAGUARDCONFIG/primdb_dg1.dat' scope=both sid='*'; 

alter system set dg_broker_config_file2='+<path>/DATAGUARDCONFIG/primdb_dg2.dat' scope=both sid='*'; 


11:51:53 SYSTEM@PRIMDB >sho parameter broker
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
connection_brokers                   string      ((TYPE=DEDICATED)(BROKERS=1)),
                                                  ((TYPE=EMON)(BROKERS=1))
dg_broker_config_file1               string      /opt/oracle/product/19.3.0/dbs/dr1PRIMDB.dat
dg_broker_config_file2               string      /opt/oracle/product/19.3.0/dbs/dr2PRIMDB.dat                                            
dg_broker_start                      boolean     TRUE
use_dedicated_broker                 boolean     FALSE
 
  
 
DGMGRL> create configuration primdb_dg as primary database is 'PRIMDB' connect identifier is primdb ;
Configuration "primdb_dg" created with primary database "PRIMDB"
 
DGMGRL>  show configuration
 
Configuration - Primdb_dg
 
  Protection Mode: MaxPerformance
  Members:
  PRIMDB - Primary database
 
Fast-Start Failover:  Disabled
 
Configuration Status:
DISABLED
 
Files will be created automatically on server
 
oraclehost:PRIMDB:/home/oracle $ ll /opt/oracle/product/19.3.0/dbs/dr1PRIMDB.dat
-rw-r----- 1 oracle oinstall 8192 Jul 27 11:58 /opt/oracle/product/19.3.0/dbs/dr1PRIMDB.dat
 
oraclehost:PRIMDB:/home/oracle $ ll /opt/oracle/product/19.3.0/dbs/dr2PRIMDB.dat
-rw-r----- 1 oracle oinstall  8192 Jul 27 11:58 /opt/oracle/product/19.3.0/dbs/dr2PRIMDB.dat
 
 
DGMGRL> enable configuration;
Enabled.
 
DGMGRL> show configuration
 
Configuration - Primdb_dg
 
  Protection Mode: MaxPerformance
  Members:
  PRIMDB - Primary database
    Warning: ORA-16905: The member was not enabled yet.
 
Fast-Start Failover:  Disabled
 
Configuration Status:
WARNING   (status updated 246 seconds ago)

 Doc:
12c Create Dataguard Broker Configuration - DGMGRL (Doc ID 1583588.1)
 
Add Standby to primary can be found here :  Add standby to Broker 

Auto Scroll Stop Scroll