Dataguard Switchover Using DGMGRL Utility

Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
  • User AvatarANKUSH THAVALI
  • 03 Dec, 2023
  • 0 Comments
  • 2 Mins Read

Dataguard Switchover Using DGMGRL Utility

Step1 :- Check the Primary Database
DGMGRL>  SHOW DATABASE VERBOSE 'prim';

Database - prim

  Role:               PRIMARY
  Intended State:     TRANSPORT-ON
  Instance(s):
    prim

  Properties:
    DGConnectIdentifier             = 'prim'
    ObserverConnectIdentifier       = ''
    FastStartFailoverTarget         = ''
    PreferredObserverHosts          = ''
    LogShipping                     = 'ON'
    RedoRoutes                      = ''
    LogXptMode                      = 'ASYNC'
    DelayMins                       = '0'
    Binding                         = 'optional'
    MaxFailure                      = '0'
    ReopenSecs                      = '300'
    NetTimeout                      = '30'
    RedoCompression                 = 'DISABLE'
    PreferredApplyInstance          = ''
    ApplyInstanceTimeout            = '0'
    ApplyLagThreshold               = '30'
    TransportLagThreshold           = '30'
    TransportDisconnectedThreshold  = '30'
    ApplyParallel                   = 'AUTO'
    ApplyInstances                  = '0'
    StandbyFileManagement           = ''
    ArchiveLagTarget                = '0'
    LogArchiveMaxProcesses          = '0'
    LogArchiveMinSucceedDest        = '0'
    DataGuardSyncLatency            = '0'
    LogArchiveTrace                 = '0'
    LogArchiveFormat                = ''
    DbFileNameConvert               = ''
    LogFileNameConvert              = ''
    ArchiveLocation                 = ''
    AlternateLocation               = ''
    StandbyArchiveLocation          = ''
    StandbyAlternateLocation        = ''
    InconsistentProperties          = '(monitor)'
    InconsistentLogXptProps         = '(monitor)'
    LogXptStatus                    = '(monitor)'
    SendQEntries                    = '(monitor)'
    RecvQEntries                    = '(monitor)'
    HostName                        = 'test.learnomate.org'
    StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test.learnomate.org)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=prim_DGMGRL)(INSTANCE_NAME=prim)(SERVER=DEDICATED)))'
    TopWaitEvents                   = '(monitor)'
    SidName                         = '(monitor)'

  Log file locations:
    Alert log               : /data/app/oracle/diag/rdbms/prim/prim/trace/alert_prim.log
    Data Guard Broker log   : /data/app/oracle/diag/rdbms/prim/prim/trace/drcprim.log

Database Status:
SUCCESS
Step2 :- Check the Standby Database That is the Target of the Switchover
DGMGRL>  SHOW DATABASE 'stand';

Database - stand

  Role:               PHYSICAL STANDBY
  Intended State:     APPLY-ON
  Transport Lag:      0 seconds (computed 0 seconds ago)
  Apply Lag:          0 seconds (computed 1 second ago)
  Average Apply Rate: 0 Byte/s
  Real Time Query:    OFF
  Instance(s):
    stand

Database Status:
SUCCESS

Step3 :- Confirm That the Database Is Ready for a Role Change
DGMGRL> VALIDATE DATABASE 'prim';

  Database Role:    Primary database

  Ready for Switchover:  Yes

  Flashback Database Status:
    prim:  Off

  Managed by Clusterware:
    prim:  NO
    Validating static connect identifier for the primary database prim...
    The static connect identifier allows for a connection to database "prim".



DGMGRL> VALIDATE DATABASE 'stand';

  Database Role:     Physical standby database
  Primary Database:  prim

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

  Flashback Database Status:
    prim :  Off
    stand:  Off
Step4 :- Issue the Switchover Command

DGMGRL> switchover to 'stand';
Performing switchover NOW, please wait...
Operation requires a connection to database "stand"
Connecting ...
Connected to "stand"
Connected as SYSDBA.
New primary database "stand" is opening...
Operation requires start up of instance "prim" on database "prim"
Starting instance "prim"...
Connected to an idle instance.
ORACLE instance started.
Connected to "prim"
Database mounted.
Connected to "prim"
Switchover succeeded, new primary is "stand"

Step5 :- Show the Configuration

DGMGRL> show configuration

Configuration - prim

  Protection Mode: MaxPerformance
  Members:
  stand - Primary database
    prim  - Physical standby database

Fast-Start Failover:  Disabled

Configuration Status:
SUCCESS   (status updated 12 seconds ago)

Hope it Helps!