Monday 27 November 2023

Data Guard Broker step on Oracle 19C Database step by step Instructions

 Dear All,


In this post i am going to show you how to enable DG Broker in Oracle 19C step by step.


Step 1. TO Enable DB Broker this  DG_BROKER_START parameter should be  TRUE value on the both the nodes.. 

Check the current status of DG Broker parameter on both sides:

Primary Side:

SQL> show parameter DG_BROKER_START


NAME                                 TYPE        VALUE

------------------------------------ ----------- ---------

dg_broker_start                      boolean     FALSE

Standby Side:

SQL> show parameter DG_BROKER_START


NAME                                 TYPE        VALUE

------------------------------------ ----------- ---------

dg_broker_start                      boolean     FALSE


Step 2:check the redo log  Gap on both the nodes 

Status on Primary

SQL> select max(sequence#) from v$archived_log;


MAX(SEQUENCE#)

--------------

            25

Status on Standby


SQL> select max(sequence#) from v$archived_log;


MAX(SEQUENCE#)

--------------

            25


Note : log sync up to date there is no gap in between primary and standby .

Step 3: Disable log_archvie_dest_2 parameter on both sides

Note :   To avoid "ORA-16698: member has a LOG_ARCHIVE_DEST_n parameter with SERVICE attribute set" and perform the below steps.


Primary side Action

SQL> show parameter log_archive_dest_2


NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

log_archive_dest_2                   string      service="stby", ASYNC NOAFFIRM

                                                  delay=0 optional compression=

                                                 disable max_failure=0 reopen=3

                                                 00 db_unique_name="stby" net_t

                                                 imeout=30, valid_for=(online_l

                                                 ogfile,all_roles)



SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='' scope=both;

System altered.

SQL> show parameter log_archive_dest_2


NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

log_archive_dest_2                   string


Standby Side Action:


SQL> show parameter log_archive_dest_2

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

log_archive_dest_2                   string      service="prod", ASYNC NOAFFIRM

                                                  delay=0 optional compression=

                                                 disable max_failure=0 reopen=3

                                                 00 db_unique_name="prod" net_t

                                                 imeout=30, valid_for=(online_l

                                                 ogfile,all_roles)


SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='' scope=both;

System altered.

SQL> show parameter log_archive_dest_2

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

log_archive_dest_2                   string



Step 4: Enable the Data Guard Broker

To enable the Data Guard Broker, 

set the parameter DG_BROKER_START to TRUE in both the primary and standby databases 


Primary Side:

SQL> alter system set dg_broker_start=true;

System altered.


SQL> show parameter DG_BROKER_START


NAME                                 TYPE        VALUE

------------------------------------ ----------- -------------

dg_broker_start                      boolean     TRUE


SQL> show parameter dg_broker_config


Standby Side :

SQL> alter system set dg_broker_start=true;

System altered.

SQL> show parameter DG_BROKER_START

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

dg_broker_start                      boolean     TRUE


SQL> show parameter dg_broker_config

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

dg_broker_config_file1               string      /u01/app/oracle/product/19.0.0

                                                 /db_home/dbs/dr1prod.dat

dg_broker_config_file2               string      /u01/app/oracle/product/19.0.0

                                                 /db_home/dbs/dr2prod.dat

SQL>


Data Guard Broker Configuration


Step 5: Configure Listener on both sides

Add the below entries on both sides listener.ora files.


Primary node :  listener.ora


  (SID_DESC =

   (GLOBAL_DBNAME = prod_DGMGRL)

   (ORACLE_HOME = /u01/app/oracle/product/19.0.0/db_home)

   (SID_NAME = prod)

 )


Standby node :  listener.ora


(SID_DESC =

   (GLOBAL_DBNAME = stby_DGMGRL)

   (ORACLE_HOME = /u01/app/oracle/product/19.0.0/db_home)

   (SID_NAME = stby)

 )


After adding the above entries in the "listener.ora" files you must reload the listener on the both the nodes .

$lsnrctl reload LISTENER

Step 6: Create the Broker Configuration

Use the DGMGRL command-line interface to create the broker configuration. This involves creating a broker configuration object, adding the primary and standby databases to the configuration, and configuring other parameters such as the observer.

$ dgmgrl sys/Welcome_123

DGMGRL>

DGMGRL for Linux: Release 19.0.0.0.0 - Production on Mon Nov 27 15:16:10 2023

Version 19.21.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Welcome to DGMGRL, type "help" for information.

Connected to "prod"

Connected as SYSDBA.



DGMGRL> create configuration 'prod' as primary database is 'prod' connect identifier is prod;


DGMGRL> show configuration;

Add standby in Broker

DGMGRL> add database 'stby' as connect identifier is stby maintained as physical;

DGMGRL> show configuration;

Database "stby" added

DGMGRL> show configuration;

Configuration - prod


  Protection Mode: MaxPerformance

  Members:

  prod - Primary database

    stby - Physical standby database


Fast-Start Failover:  Disabled


Configuration Status:

DISABLED


Step 7: Enable Data Guard Broker


Enable the Data Guard Broker by executing the DGMGRL command ENABLE CONFIGURATION from the primary database.


DGMGRL> enable configuration;


DGMGRL> show configuration;


Configuration - prod


  Protection Mode: MaxPerformance

  Members:

  prod - Primary database

    stby - Physical standby database


Fast-Start Failover:  Disabled


Configuration Status:

SUCCESS   (status updated 21 seconds ago)




Thanks,

Srini

No comments:

Post a Comment


No one has ever become poor by giving