Pages

Monday, April 12, 2021

Switchover and Switchback Using Dataguard Broker For Oracle 11.2.0.3.0 Database

Switchover and Switchback Using Dataguard Broker For Oracle 11.2.0.3.0 Database


---Primary---

[oracle@host01 ~]$ dgmgrl

DGMGRL for Linux: Version 11.2.0.3.0 - 64bit Production

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

Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/Welcome1

Connected.

DGMGRL> show configuration


Configuration - gtp2prod

Protection Mode: MaxPerformance

Databases:

gtp2_live - Primary database

gtp2_stdy - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:

SUCCESS


To check the PRIMARY status:


DGMGRL> show database verbose gtp2_live

Database - gtp2_live

 Role:            PRIMARY

  Intended State:  TRANSPORT-ON

  Instance(s):

    GTP2PROD

Properties:

    DGConnectIdentifier             = 'gtp2_live'

    ObserverConnectIdentifier       = ''

    LogXptMode                      = 'ASYNC'

    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          = '30'

    LogArchiveMinSucceedDest        = '1'

    DbFileNameConvert               = 'GTP2_STDY, GTP2_LIVE'

    LogFileNameConvert              = 'GTP2_STDY, GTP2_LIVE'

    FastStartFailoverTarget         = ''

    InconsistentProperties          = '(monitor)'

    InconsistentLogXptProps         = '(monitor)'

    SendQEntries                    = '(monitor)'

    LogXptStatus                    = '(monitor)'

    RecvQEntries                    = '(monitor)'

    SidName                         = 'GTP2PROD'

    StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.7)(PORT=1523))(CONNECT_DATA=(SERVICE_NAME=GTP2_LIVE_DGMGRL)(INSTANCE_NAME=GTP2PROD)(SERVER=DEDICATED)))'

    StandbyArchiveLocation          = '/u01/app/oracle/arch'

    AlternateLocation               = ''

    LogArchiveTrace                 = '0'

    LogArchiveFormat                = 'arch%s%t%r.arc'

    TopWaitEvents                   = '(monitor)'

Database Status:

SUCCESS


To check the STANDBY status:


DGMGRL> show database verbose gtp2_stdy

Database - gtp2_stdy

 Role:            PHYSICAL STANDBY

  Intended State:  APPLY-ON

  Transport Lag:   0 seconds

  Apply Lag:       0 seconds

  Real Time Query: ON

  Instance(s):

    GTP2PROD

 Properties:

    DGConnectIdentifier             = 'gtp2_stdy'

    ObserverConnectIdentifier       = ''

    LogXptMode                      = 'ASYNC'

    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          = '30'

    LogArchiveMinSucceedDest        = '1'

    DbFileNameConvert               = 'GTP2_LIVE, GTP2_STDY'

    LogFileNameConvert              = 'GTP2_LIVE, GTP2_STDY'

    FastStartFailoverTarget         = ''

    InconsistentProperties          = '(monitor)'

    InconsistentLogXptProps         = '(monitor)'

    SendQEntries                    = '(monitor)'

    LogXptStatus                    = '(monitor)'

    RecvQEntries                    = '(monitor)'

    SidName                         = 'GTP2PROD'

    StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.8)(PORT=1524))(CONNECT_DATA=(SERVICE_NAME=GTP2_STDY_DGMGRL)(INSTANCE_NAME=GTP2PROD)(SERVER=DEDICATED)))'

    StandbyArchiveLocation          = '/u01/app/oracle/arch'

    AlternateLocation               = ''

    LogArchiveTrace                 = '0'

    LogArchiveFormat                = 'arch%s%t%r.arc'

    TopWaitEvents                   = '(monitor)'

Database Status:

SUCCESS


Check the current status:


DGMGRL> show configuration

Configuration - gtp2prod

  Protection Mode: MaxPerformance

  Databases:

    gtp2_live - Primary database

    gtp2_stdy - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:

SUCCESS


Switchover 

It is always advised to view the alert.log files for both PRIMARY and STANDBY databases.

Issue the below command:


DGMGRL> switchover to gtp2_stdy

Performing switchover NOW, please wait...

New primary database "gtp2_stdy" is opening...

Operation requires shutdown of instance "GTP2PROD" on database "gtp2_live"

Shutting down instance "GTP2PROD"...

ORACLE instance shut down.

Operation requires startup of instance "GTP2PROD" on database "gtp2_live"

Starting instance "GTP2PROD"...

ORACLE instance started.

Database mounted.

Database opened.

Switchover succeeded, new primary is "gtp2_stdy"


Check the current status:

DGMGRL> show configuration

Configuration - gtp2prod

  Protection Mode: MaxPerformance

  Databases:

    gtp2_stdy - Primary database

    gtp2_live - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:

SUCCESS


Switchback

To revert (switch back) to the previous situation, perform the same action. Remember now your primary is your previous STANDBY and standby is previous PRIMARY. 

Issue the below command:


DGMGRL> swtichover to gtp2_live

Unrecognized command "swtichover", try "help"

DGMGRL> switchover to gtp2_live

Performing switchover NOW, please wait...

New primary database "gtp2_live" is opening...

Operation requires shutdown of instance "GTP2PROD" on database "gtp2_stdy"

Shutting down instance "GTP2PROD"...

ORACLE instance shut down.

Operation requires startup of instance "GTP2PROD" on database "gtp2_stdy"

Starting instance "GTP2PROD"...

ORACLE instance started.

Database mounted.

Database opened.

Switchover succeeded, new primary is "gtp2_live"


Check the current status:

DGMGRL> show configuration

Configuration - gtp2prod

  Protection Mode: MaxPerformance

  Databases:

    gtp2_live - Primary database

    gtp2_stdy - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:

SUCCESS


No comments:

Post a Comment