Thursday, 11 March 2021

Dataguard12c - Multiple physical standby Dataguard on 12c

 Dataguard12c - Multiple physical standby Data guard on 12c 

Primary Database : srv3.example.com

1st Standby Database : srv4.example.com

2nd Standby Database : srv5.example.com


Step 1: create multiple physical standby database  and  add DG broker pre requestories.

link to create physical standby dataguard  dataguard setup steps link

Step 2 : Connect to primary database and create DG configuration

[oracle@srv3 dbs]$ dgmgrl sys/system123@zabbix

DGMGRL for Linux: 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> CREATE CONFIGURATION zabbix AS PRIMARY DATABASE IS zabbix CONNECT IDENTIFIER IS zabbix;
Configuration "zabbix" created with primary database "zabbix"

Step 3: Add multiple standby database configuration:

DGMGRL> ADD DATABASE zabbixdr AS CONNECT IDENTIFIER IS zabbixdr;
Database "zabbixdr" added

DGMGRL> ADD DATABASE zabbixdr2 AS CONNECT IDENTIFIER IS zabbixdr2;
Database "zabbixdr2" added

Step 4: Enable Configuration .

DGMGRL> enable configuration;

Enabled.


Step 5 : check dataguard configuration : 

[oracle@srv3 dbs]$ dgmgrl sys/system123@zabbix

DGMGRL for Linux: 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 configuration;

Configuration - zabbix

  Protection Mode: MaxPerformance
  Members:
  zabbix    - Primary database
    zabbixdr  - Physical standby database
    zabbixdr2 - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS   (status updated 28 seconds ago)

DGMGRL>


[oracle@srv4 dbs]$ dgmgrl sys/system123@zabbixdr

DGMGRL for Linux: 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 configuration;

Configuration - zabbix

  Protection Mode: MaxPerformance
  Members:
  zabbix    - Primary database
    zabbixdr  - Physical standby database
    zabbixdr2 - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS   (status updated 14 seconds ago)

DGMGRL>


[oracle@srv5 dbs]$ dgmgrl sys/system123@zabbixdr2

DGMGRL for Linux: 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 configuration;

Configuration - zabbix

  Protection Mode: MaxPerformance
  Members:
  zabbix    - Primary database
    zabbixdr  - Physical standby database
    zabbixdr2 - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS   (status updated 41 seconds ago)

DGMGRL>

Step 6 :  Check standby MRP0 status using sql query

oracle@:~> cat standby.sql
select name,open_mode,database_role from v$database;

select process,status,sequence# from v$managed_standby;

SELECT ARCH.THREAD# "Thread", ARCH.SEQUENCE# "Last Sequence Received", APPL.SEQUENCE# "Last Sequence Applied", (ARCH.SEQUENCE# - APPL.SEQUENCE#) "Difference" FROM (SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH, (SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL WHERE ARCH.THREAD# = APPL.THREAD#;

SQL> @standby

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
ZABBIX    READ WRITE           PRIMARY


PROCESS   STATUS        SEQUENCE#
--------- ------------ ----------
ARCH      CLOSING            1121
ARCH      CLOSING            1119
ARCH      CLOSING            1071
SQL> @standby

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
ZABBIX    MOUNTED              PHYSICAL STANDBY


PROCESS   STATUS        SEQUENCE#
--------- ------------ ----------
ARCH      CLOSING            1115
ARCH      CLOSING            1121
ARCH      CONNECTED             0
ARCH      CLOSING            1120
MRP0      APPLYING_LOG       1122
RFS       IDLE                  0
RFS       IDLE               1122
RFS       IDLE                  0
RFS       IDLE                  0

9 rows selected.


    Thread Last Sequence Received Last Sequence Applied Difference
---------- ---------------------- --------------------- ----------
         1                   1121                  1121          0

SQL> !hostname
srv4.example.com

SQL>


SQL> @standby

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
ZABBIX    MOUNTED              PHYSICAL STANDBY


PROCESS   STATUS        SEQUENCE#
--------- ------------ ----------
ARCH      CLOSING            1121
ARCH      CLOSING            1120
ARCH      CONNECTED             0
ARCH      CLOSING            1116
RFS       IDLE               1122
RFS       IDLE                  0
RFS       IDLE                  0
RFS       IDLE                  0
MRP0      APPLYING_LOG       1122

9 rows selected.


    Thread Last Sequence Received Last Sequence Applied Difference
---------- ---------------------- --------------------- ----------
         1                   1121                  1121          0

SQL> !hostname
srv5.example.com

SQL>

ARCH      CLOSING            1120
LNS       WRITING            1122
LNS       WRITING            1122

6 rows selected.


    Thread Last Sequence Received Last Sequence Applied Difference
---------- ---------------------- --------------------- ----------
         1                   1121                  1121          0
         1                   1121                  1121          0
         1                   1121                  1121          0

SQL> !hostname
srv3.example.com




No comments:

Post a Comment