DG Broker Configuration in Oracle Database and Examples

DG Broker Configuration in Oracle Database




1.Set the primary and standby databases StaticConnectIdentifier property

DGMGRL>edit database <Primary Database> set property StaticConnectIdentifier='<dg_prim>' where dg_prim is TNS alias to connect the Primary


DGMGRL>edit database <Standby Database> set property StaticConnectIdentifier='<dg_stndby>' where dg_stndby is TNS alias to connect the Standby

2.Start the Data Guard Broker on both primary and standby databases.

The Data Guard Broker will create two files under the location specified by the initialization parameter DG_BROKER_CONFIG_FILEn. The default location is the $ORACLE_HOME/dbs/ directory.

alter system set dg_broker_start=TRUE.

3.Configure Data Guard broker using DGMGRL as follows: 

dgmgrl sys/****@<primary database alias>
 DGMGRL>CREATE CONFIGURATION '<Any Name>' AS PRIMARY DATABASE IS '<db_unique_name>' CONNECT IDENTIFIER IS <Primary database alias>;

4.Add Standby database using the following command: 

ADD DATABASE '<standby unique name>' AS CONNECT IDENTIFIER IS <Standby TNS Alias>;

5.Check the configuration using Show Configuration.

6.View the configuration using the Show Configuration command. 

7.Set the following Data Guard Broker properties: 

   1.Set the configuration protection mode to maximum availability. At any time you can change the protection mode of configuration. Note that this protection mode requires that there be at least one standby database configured to use standby redo log files, with its LogXptMode configurable database property set to SYNC on both primary and standby.

DGMGRL>EDIT database <database name> set property LogXptMode='SYNC'
DGMGRL>EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;


2.if you are using Oracle EBS ERP system, Do not enable FAST_START_FAILOVER as automatic failover is not supported 

Examples for Step by Step DG Broker Configuration in Oracle Database

Production Database Name:   ERPPROD
Standby Database Name:        ERPSBY

bash:dgmgrl sys/manager@ERPPROD
DGMGRL for Solaris: Version 12.1.0.2.0 - 64bit Production

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

Welcome to DGMGRL, type "help" for information.

DGMGRL>edit instance 'ERPPROD1' on database ERPPROD set property StaticConnectIdentifier='(DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=proddb1-vip.nizam.com)(PORT=1529)) (CONNECT_DATA= (SERVICE_NAME=ERPPROD) (INSTANCE_NAME=ERPPROD1)))'

DGMGRL>edit instance 'ERPPROD2' on database ERPPROD set property StaticConnectIdentifier='(DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=proddb2-vip.nizam.com)(PORT=1529)) (CONNECT_DATA= (SERVICE_NAME=ERPPROD) (INSTANCE_NAME=ERPPROD2)))'

DGMGRL>edit database 'ERPSBY' set property StaticConnectIdentifier='(DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=erpsby01.nizam.com)(PORT=1529)) (CONNECT_DATA=(SERVER = DEDICATED)(SID=ERPSBY1)))';


SQL>alter system set dg_broker_start=TRUE;

dgmgrl sys/manager@ERPPROD


dgmgrl>CREATE CONFIGURATION 'DG_CONFIGURATION' AS PRIMARY DATABASE IS 'ERPPROD' CONNECT IDENTIFIER IS ERPPROD;

SQL>ADD DATABASE 'ERPSBY' AS CONNECT IDENTIFIER IS ERPSBY;


DGMGRL>enable configuration;


DGMGRL>enable database 'ERPSBY';

DGMGRL> show configuration;

Configuration - DG_CONFIGURATION

  Protection Mode: MaxPerformance
  Members:
  ERPPROD    - Primary database
    ERPSBY - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS   (status updated 38 seconds ago)

DGMGRL> show configuration verbose

Configuration - DG_CONFIGURATION

  Protection Mode: MaxPerformance
  Members:
  ERPPROD    - Primary database
    ERPSBY - Physical standby database

  Properties:
    FastStartFailoverThreshold      = '30'
    OperationTimeout                = '30'
    TraceLevel                      = 'USER'
    FastStartFailoverLagLimit       = '30'
    CommunicationTimeout            = '180'
    ObserverReconnect               = '0'
    FastStartFailoverAutoReinstate  = 'TRUE'
    FastStartFailoverPmyShutdown    = 'TRUE'
    BystandersFollowRoleChange      = 'ALL'
    ObserverOverride                = 'FALSE'
    ExternalDestination1            = ''
    ExternalDestination2            = ''
    PrimaryLostWriteAction          = 'CONTINUE'

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS




bash:dgmgrl sys/manager@ERPPROD
DGMGRL for Solaris: Version 12.1.0.2.0 - 64bit Production

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

Welcome to DGMGRL, type "help" for information.
Connected as SYSDBA.
DGMGRL> SHOW DATABASE VERBOSE 'ERPPROD';

Database - ERPPROD

  Role:               PRIMARY
  Intended State:     TRANSPORT-ON
  Instance(s):
    ERPPROD
    ERPPROD1
    ERPPROD2

  Properties:
    DGConnectIdentifier             = 'erpprod'
    ObserverConnectIdentifier       = ''
    LogXptMode                      = 'ASYNC'
    RedoRoutes                      = ''
    DelayMins                       = '0'
    Binding                         = 'optional'
    MaxFailure                      = '0'
    MaxConnections                  = '1'
    ReopenSecs                      = '300'
    NetTimeout                      = '30'
    RedoCompression                 = 'DISABLE'
    LogShipping                     = 'ON'
    PreferredApplyInstance          = ''
    ApplyInstanceTimeout            = '0'
    ApplyLagThreshold               = '0'
    TransportLagThreshold           = '0'
    TransportDisconnectedThreshold  = '30'
    ApplyParallel                   = 'AUTO'
    StandbyFileManagement           = 'AUTO'
    ArchiveLagTarget                = '0'
    LogArchiveMaxProcesses          = '4'
    LogArchiveMinSucceedDest        = '1'
    DbFileNameConvert               = ''
    LogFileNameConvert              = ''
    FastStartFailoverTarget         = ''
    InconsistentProperties          = '(monitor)'
    InconsistentLogXptProps         = '(monitor)'
    SendQEntries                    = '(monitor)'
    LogXptStatus                    = '(monitor)'
    RecvQEntries                    = '(monitor)'
    StaticConnectIdentifier(*)
    StandbyArchiveLocation(*)
    AlternateLocation(*)
    LogArchiveTrace(*)
    LogArchiveFormat(*)
    TopWaitEvents(*)
    (*) - Please check specific instance for the property value

Database Status:
SUCCESS

DGMGRL>  SHOW instance verbose 'ERPPROD1' on database 'ERPPROD';

Instance 'ERPPROD1' of database 'ERPPROD'

  Host Name: au1606
  PFILE:   
  Properties:
    StaticConnectIdentifier         = '(DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=proddb1-vip.nizam.com)(PORT=1529)) (CONNECT_DATA= (SERVICE_NAME=ERPPROD) (INSTANCE_NAME=ERPPROD1)))'
    StandbyArchiveLocation          = '+RECO/erpprod/archivelog'
    AlternateLocation               = ''
    LogArchiveTrace                 = '0'
    LogArchiveFormat                = '%t_%s_%r.dbf'
    TopWaitEvents                   = '(monitor)'

Instance Status:
SUCCESS

DGMGRL> SHOW instance verbose 'ERPPROD2' on database 'ERPPROD';

Instance 'ERPPROD2' of database 'ERPPROD'

  Host Name: au1607
  PFILE:   
  Properties:
    StaticConnectIdentifier         = '(DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=proddb2-vip.nizam.com)(PORT=1529)) (CONNECT_DATA= (SERVICE_NAME=ERPPROD) (INSTANCE_NAME=ERPPROD2)))'
    StandbyArchiveLocation          = '+RECO/erpprod/archivelog'
    AlternateLocation               = ''
    LogArchiveTrace                 = '0'
    LogArchiveFormat                = '%t_%s_%r.dbf'
    TopWaitEvents                   = '(monitor)'

Instance Status:
SUCCESS

DGMGRL> SHOW DATABASE VERBOSE 'ERPSBY';

Database - ERPSBY

  Role:               PHYSICAL STANDBY
  Intended State:     APPLY-ON
  Transport Lag:      0 seconds (computed 0 seconds ago)
  Apply Lag:          0 seconds (computed 0 seconds ago)
  Average Apply Rate: 3.89 MByte/s
  Active Apply Rate:  10.43 MByte/s
  Maximum Apply Rate: 95.83 MByte/s
  Real Time Query:    ON
  Instance(s):
    ERPPROD1

  Properties:
    DGConnectIdentifier             = 'ERPSBY'
    ObserverConnectIdentifier       = ''
    LogXptMode                      = 'ASYNC'
    RedoRoutes                      = ''
    DelayMins                       = '0'
    Binding                         = 'optional'
    MaxFailure                      = '0'
    MaxConnections                  = '1'
    ReopenSecs                      = '300'
    NetTimeout                      = '30'
    RedoCompression                 = 'DISABLE'
    LogShipping                     = 'ON'
    PreferredApplyInstance          = ''
    ApplyInstanceTimeout            = '0'
    ApplyLagThreshold               = '0'
    TransportLagThreshold           = '0'
    TransportDisconnectedThreshold  = '30'
    ApplyParallel                   = 'AUTO'
    StandbyFileManagement           = 'AUTO'
    ArchiveLagTarget                = '0'
    LogArchiveMaxProcesses          = '4'
    LogArchiveMinSucceedDest        = '1'
    DbFileNameConvert               = '+DATA/erpprod/datafile, /erp_data/oradata/erpsby, +DATA/erpprod/tempfile, /erp_temp/oradata/erpsby'
    LogFileNameConvert              = '+DATA/erpprod/onlinelog, /erp_data/oradata/ERPPROD, +RECO/erpprod/onlinelog, /erp_data/oradata/erpsby'
    FastStartFailoverTarget         = ''
    InconsistentProperties          = '(monitor)'
    InconsistentLogXptProps         = '(monitor)'
    SendQEntries                    = '(monitor)'
    LogXptStatus                    = '(monitor)'
    RecvQEntries                    = '(monitor)'
    StaticConnectIdentifier         = '(DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=erpsby01.nizam.com)(PORT=1529)) (CONNECT_DATA=(SERVER = DEDICATED)(SID=ERPSBY1)))'
    StandbyArchiveLocation          = '/erp_arc1/oradata/ERPSBY'
    AlternateLocation               = ''
    LogArchiveTrace                 = '0'
    LogArchiveFormat                = '%t_%s_%r.dbf'
    TopWaitEvents                   = '(monitor)'

Database Status:
SUCCESS

DGMGRL>

DGMGRL> validate database 'ERPSBY';

  Database Role:     Physical standby database
  Primary Database:  ERPPROD

  Ready for Switchover:  Yes
  Ready for Failover:    Yes (Primary Running)

  Capacity Information:
    Database  Instances        Threads     
    ERPPROD       2                2           
    ERPSBY    1                2           
    Warning: the target standby has fewer instances than the
    primary database, this may impact application performance

  Flashback Database Status:
    ERPPROD:     Off
    ERPSBY:  Off

  Standby Apply-Related Information:
    Apply State:      Running
    Apply Lag:        1 second (computed 0 seconds ago)
    Apply Delay:      0 minutes

  Current Log File Groups Configuration:
    Thread #  Online Redo Log Groups  Standby Redo Log Groups Status     
              (ERPPROD)                   (ERPSBY)                           
    0         10                      0                       Insufficient SRLs
    Warning: standby redo logs not configured for thread 0 on ERPSBY

  Future Log File Groups Configuration:
    Thread #  Online Redo Log Groups  Standby Redo Log Groups Status     
              (ERPSBY)                (ERPPROD)                             
    0         10                      0                       Insufficient SRLs
    Warning: standby redo logs not configured for thread 0 on ERPPROD

DGMGRL>

DGMGRL> validate database verbose 'ERPSBY';

  Database Role:     Physical standby database
  Primary Database:  ERPPROD

  Ready for Switchover:  Yes
  Ready for Failover:    Yes (Primary Running)

  Capacity Information:
    Database  Instances        Threads     
    ERPPROD       2                2           
    ERPSBY    1                2           
    Warning: the target standby has fewer instances than the
    primary database, this may impact application performance

  Temporary Tablespace File Information:
    ERPPROD TEMP Files:     8
    ERPSBY TEMP Files:  8

  Flashback Database Status:
    ERPPROD:     Off
    ERPSBY:  Off

  Data file Online Move in Progress:
    ERPPROD:     No
    ERPSBY:  No

  Standby Apply-Related Information:
    Apply State:      Running
    Apply Lag:        1 second (computed 0 seconds ago)
    Apply Delay:      0 minutes

  Transport-Related Information:
    Transport On:      Yes
    Gap Status:        No Gap
    Transport Lag:     0 seconds (computed 0 seconds ago)
    Transport Status:  Success

  Log Files Cleared:
    ERPPROD Standby Redo Log Files:     Cleared
    ERPSBY Online Redo Log Files:   Cleared
    ERPSBY Standby Redo Log Files:  Available

  Current Log File Groups Configuration:
    Thread #  Online Redo Log Groups  Standby Redo Log Groups Status     
              (ERPPROD)                   (ERPSBY)                           
    0         10                      0                       Insufficient SRLs
    Warning: standby redo logs not configured for thread 0 on ERPSBY
    2         4                       5                       Sufficient SRLs

  Future Log File Groups Configuration:
    Thread #  Online Redo Log Groups  Standby Redo Log Groups Status     
              (ERPSBY)                (ERPPROD)                             
    0         10                      0                       Insufficient SRLs
    Warning: standby redo logs not configured for thread 0 on ERPPROD
    2         4                       5                       Sufficient SRLs

  Current Configuration Log File Sizes:
    Thread #   Smallest Online Redo      Smallest Standby Redo 
               Log File Size             Log File Size         
               (ERPPROD)                     (ERPSBY)               
    2          500 MBytes                500 MBytes             

  Future Configuration Log File Sizes:
    Thread #   Smallest Online Redo      Smallest Standby Redo 
               Log File Size             Log File Size         
               (ERPSBY)                  (ERPPROD)                 
    2          500 MBytes                500 MBytes             

  Apply-Related Property Settings:
    Property                        ERPPROD Value                ERPSBY Value
    DelayMins                       0                        0
    ApplyParallel                   AUTO                     AUTO

  Transport-Related Property Settings:
    Property                        ERPPROD Value                ERPSBY Value
    LogXptMode                      ASYNC                    ASYNC
    RedoRoutes                      <empty>                  <empty>
    Dependency                      <empty>                  <empty>
    DelayMins                       0                        0
    Binding                         optional                 optional
    MaxFailure                      0                        0
    MaxConnections                  1                        1
    ReopenSecs                      300                      300
    NetTimeout                      30                       30
    RedoCompression                 DISABLE                  DISABLE
    LogShipping                     ON                       ON

  Automatic Diagnostic Repository Errors:
    Error                       ERPPROD      ERPSBY
    No logging operation        NO       NO   
    Control file corruptions    NO       NO   
    SRL Group Unavailable       NO       NO   
    System data file missing    NO       NO   
    System data file corrupted  NO       NO   
    System data file offline    NO       NO   
    User data file missing      NO       NO   
    User data file corrupted    NO       NO   
    User data file offline      NO       NO   
    Block Corruptions found     NO       NO   

DGMGRL>









appsdbahelp

17+ years of experience in Oracle Database, Oracle Cloud Infrastructure(OCI), Oracle EBS on Cloud, Oracle E-Business Suite, DevOps tools, Oracle WebLogic, Oracle Application Server, Oracle Access Manager and various Operating System flavors including Redhat Linux, UNIX (Solaris, HP-UX) and Windows. Expert in Oracle9i/10g/11g/12c/19c database administration, upgrade, configuration and tuning. Experience in Oracle E-Business Suite technological stack, including architecture, installation, configuration, maintenance, tuning, cloning and patching procedures. Expert in Oracle Cloud Infrastructure(OCI), Oracle EBS On Cloud and Oracle EBS Cloud Manager Experience with Oracle Cloud Solution and Expert of Oracle ERP/Oracle HCM Cloud deployment Experience in Terraform, JSON and chef cloud infrastructure automation framework Knowledge of ASM, Data Guard, Real Application Cluster, Exadata and Exalogic Knowledge of Oracle Enterprise Manager(OEM) Grid Control, Oracle WebLogic, Oracle Internet Directory, Oracle Access Manager and Apache Ability to analyze problem, develops solutions and bring program/project execution to completion.

1 Comments

  1. You actually make it appear really easy with your presentation but I find this topic to be really something which I believe I might never understand. It seems too complicated and very broad for me. I’m taking a look forward for your next post, I will try to get the cling of it! avant singapore

    ReplyDelete
Previous Post Next Post