Perform the Failover by using the DGMGRL (Observer Utility) in our Test Env

Perform the Failover by using the DGMGRL (Observer Utility) in our Test Env

On Primary Database

[oracle@pr ~]$ !sq

sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 12 02:28:04 2017
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>  SELECT NAME,DB_UNIQUE_NAME, OPEN_MODE,DATABASE_ROLE FROM V$DATABASE;

NAME      DB_UNIQUE_NAME                 OPEN_MODE            DATABASE_ROLE
--------- ------------------------------ -------------------- ----------------
PR        pr                             READ WRITE           PRIMARY

On Standby Database

[oracle@std scripts]$ !sq

sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 12 02:28:21 2017
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> SELECT NAME,DB_UNIQUE_NAME, OPEN_MODE,DATABASE_ROLE FROM V$DATABASE;

NAME      DB_UNIQUE_NAME                 OPEN_MODE            DATABASE_ROLE
--------- ------------------------------ -------------------- ----------------
PR        std                            MOUNTED              PHYSICAL STANDBY

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@std scripts]$ dgmgrl

DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/xxx
Connected.

DGMGRL> show configuration

Configuration - PRDG
  Protection Mode: MaxPerformance
  Databases:
    pr  - Primary database
    std - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS

DGMGRL> show database 'pr';
Database - pr
  Role:            PRIMARY
  Intended State:  TRANSPORT-ON
  Instance(s):
    pr
Database Status:
SUCCESS

Shutdown abort on Primay Database  - (Consider the Primary DB is Intentionally or Due to some issue the Primary DB is no more exist, Therefore we need to perform the failover on standby database)

SQL> shutdown abort
ORACLE instance shut down.

On standby database

DGMGRL> failover to 'std'

Performing failover NOW, please wait...
Failover succeeded, new primary is "std"
Check the standby database status

Verify the Standby database as Primary

SQL> select status from v$instance;

STATUS
------------
OPEN

SQL> SELECT NAME,DB_UNIQUE_NAME, OPEN_MODE,DATABASE_ROLE FROM V$DATABASE;

NAME      DB_UNIQUE_NAME                 OPEN_MODE            DATABASE_ROLE
--------- ------------------------------ -------------------- ----------------
PR        std                            READ WRITE           PRIMARY

[oracle@std scripts]$ dgmgrl

DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/xxx
Connected

DGMGRL> SHOW CONFIGURATION

Configuration - PRDG
  Protection Mode: MaxPerformance
  Databases:
    std - Primary database
    pr  - Physical standby database (disabled)
      ORA-16661: the standby database needs to be reinstated
Fast-Start Failover: DISABLED
Configuration Status:

SUCCESS

DGMGRL> show database 'pr'

Database - pr
  Role:            PHYSICAL STANDBY
  Intended State:  APPLY-ON
  Transport Lag:   (unknown)
  Apply Lag:       (unknown)
  Apply Rate:      (unknown)
  Real Time Query: OFF
  Instance(s):
    pr
Database Status:

ORA-16661: the standby database needs to be reinstated

SQL> SELECT NAME,DB_UNIQUE_NAME, OPEN_MODE,DATABASE_ROLE FROM 
V$DATABASE;

NAME      DB_UNIQUE_NAME                 OPEN_MODE            DATABASE_ROLE
--------- ------------------------------ -------------------- ----------------
PR        std                            READ WRITE           PRIMARY

SQL> SELECT USERNAME FROM DBA_USERS;

USERNAME
------------------------------
MGMT_VIEW
SYS
SYSTEM
DBSNMP
SYSMAN

(etc - Can view all the users which was exist on Primary DB)

39 rows selected.

Hence the standby database becomes as primary after the failover operation.

Comments