DG Broker setup


DG Broker setup by Alok

Primary Database: prim_alok
Standby Database: stanby_alok
On both Primary as well as Standby database start the Data Guard Broker process
SQL> ALTER SYSTEM SET DG_BROKER_START=TRUE SCOPE=BOTH;
 
System altered.
Edit the listener.ora on both nodes to add a static entry for DGMGRL
This is to prevent the ORA-12154 error which can be observed on startup of the standby database after performing a switchover.
Ensure that the GLOBAL_DBNAME is set to db_unique_name_DGMGRL.db_domain
SID_LIST_LISTENER =
  (SID_LIST =
 (SID_DESC =
        (GLOBAL_DBNAME = prim_alok_dgmgrl)
        (ORACLE_HOME = /u01/oracle/product/11.1.0/db_1)
        (SID_NAME = genoa1)
        )
)
Create the configuration
genoa1:/u01/oracle> dgmgrl
DGMGRL for IBM/AIX RISC System/6000: Version 11.1.0.7.0 - 64bit Production
 
Copyright (c) 2000, 2005, Oracle. All rights reserved.
 
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/xxxx
Connected.
DGMGRL> CREATE CONFIGURATION 'GenesisDR'
> AS
> PRIMARY DATABASE IS 'prim_alok'
> CONNECT IDENTIFIER IS 'prim_alok'
> ;
Configuration "GenesisDR" created with primary database "prim_alok"
Add the Standby database to the configuration
DGMGRL>  ADD DATABASE
> 'stanby_alok'
> AS
> CONNECT IDENTIFIER IS 'stanby_alok'
> ;
Database "stanby_alok" added
 
DGMGRL> SHOW CONFIGURATION
 
Configuration
  Name:                GenesisDR
  Enabled:             NO
  Protection Mode:     MaxAvailability
  Databases:
    prim_alok - Primary database
    stanby_alok - Physical standby database
 
Fast-Start Failover: DISABLED
 
Current status for "GenesisDR":
DISABLED
Enable the configuration
DGMGRL> ENABLE CONFIGURATION
Enabled.
 
DGMGRL> SHOW CONFIGURATION
 
Configuration
  Name:                GenesisDR
  Enabled:             YES
  Protection Mode:     MaxAvailability
  Databases:
    prim_alok - Primary database
    stanby_alok - Physical standby database
 
Fast-Start Failover: DISABLED
 
Current status for "GenesisDR":
SUCCESS
View the Standby and Primary database properties
DGMGRL> show database prim_alok
 
Database
  Name:            prim_alok
  Role:            PRIMARY
  Enabled:         YES
  Intended State:  TRANSPORT-ON
  Instance(s):
    genoa1
 
Current status for "prim_alok":
SUCCESS
 
DGMGRL>  show database stanby_alok
 
Database
  Name:            stanby_alok
  Role:            PHYSICAL STANDBY
  Enabled:         YES
  Intended State:  APPLY-ON
  Instance(s):
    genoa1
 
Current status for "stanby_alok":
SUCCESS
 
DGMGRL> show database verbose  stanby_alok
 
Database
  Name:            stanby_alok
  Role:            PHYSICAL STANDBY
  Enabled:         YES
  Intended State:  APPLY-ON
  Instance(s):
    genoa1
 
  Properties:
    DGConnectIdentifier             = 'stanby_alok'
    ObserverConnectIdentifier       = ''
    LogXptMode                      = 'SYNC'
    DelayMins                       = '0'
    Binding                         = 'OPTIONAL'
    MaxFailure                      = '0'
    MaxConnections                  = '1'
    ReopenSecs                      = '300'
    NetTimeout                      = '30'
    RedoCompression                 = 'DISABLE'
    LogShipping                     = 'ON'
    PreferredApplyInstance          = ''
    ApplyInstanceTimeout            = '0'
    ApplyParallel                   = 'AUTO'
    StandbyFileManagement           = 'AUTO'
    ArchiveLagTarget                = '0'
    LogArchiveMaxProcesses          = '4'
    LogArchiveMinSucceedDest        = '1'
    DbFileNameConvert               = ''
    LogFileNameConvert              = ''
    FastStartFailoverTarget         = ''
    StatusReport                    = '(monitor)'
    InconsistentProperties          = '(monitor)'
    InconsistentLogXptProps         = '(monitor)'
    SendQEntries                    = '(monitor)'
    LogXptStatus                    = '(monitor)'
    RecvQEntries                    = '(monitor)'
    HostName                        = 'drou037'
    SidName                         = 'genoa1'
    StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=drou037)
 
(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=stanby_alok_DGMGRL)(INSTANCE_NAME=genoa1)(SERVER=DEDICATED)))'
    StandbyArchiveLocation          = 'USE_DB_RECOVERY_FILE_DEST'
    AlternateLocation               = ''
    LogArchiveTrace                 = '0'
    LogArchiveFormat                = '%t_%s_%r.dbf'
    LatestLog                       = '(monitor)'
    TopWaitEvents                   = '(monitor)'
 
Current status for "stanby_alok":
SUCCESS
Change the properties of a configured databaase
DGMGRL> EDIT DATABASE 'prim_alok' SET PROPERTY 'LogXptMode'='SYNC';
Property "LogXptMode" updated
Performing a switchover
Note: In this case, currently the Primary Database is stanby_alok and the Standby database is prim_alok.
DGMGRL> switchover to 'prim_alok'
Performing switchover NOW, please wait...
New primary database "prim_alok" is opening...
Operation requires shutdown of instance "genoa1" on database "stanby_alok"
Shutting down instance "genoa1"...
ORA-01109: database not open
 
Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "genoa1" on database "stanby_alok"
Starting instance "genoa1"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "prim_alok"
 
DGMGRL> SHOW CONFIGURATION;
 
Configuration
  Name:                GenesisDR
  Enabled:             YES
  Protection Mode:     MaxAvailability
  Databases:
    prim_alok - Primary database
    stanby_alok - Physical standby database
 
Fast-Start Failover: DISABLED
 
Current status for "GenesisDR":
SUCCESS
Monitoring the Data Guard Broker Configuration
If we receive any error or warnings we cab obtain more information about the same ny running the commands as shown below. In this case there is no output seen because currently we are not experiencing any errors or warning.
DGMGRL> show database prim_alok statusreport
STATUS REPORT
       INSTANCE_NAME   SEVERITY ERROR_TEXT
 
DGMGRL>  show database prim_alok logxptstatus
LOG TRANSPORT STATUS
PRIMARY_INSTANCE_NAME STANDBY_DATABASE_NAME               STATUS
              genoa1            stanby_alok
 
DGMGRL> show database prim_alok InconsistentProperties
INCONSISTENT PROPERTIES
   INSTANCE_NAME        PROPERTY_NAME         MEMORY_VALUE         SPFILE_VALUE         BROKER_VALUE

Comments

Popular posts from this blog

How to Configure Logging for EM 12c Management Agent

Stop Oracle Clusterware or Cluster Ready Services Processes

Steps to HandlingBlock Corruption in Large Partitioned tables using EXCHANGE PARTITION method when no Backups available Metalink Note ID 1324772.1]