Quantcast
Channel: Oracle
Viewing all articles
Browse latest Browse all 1814

Blog Post: How to Change the Protection Mode with Data Guard Broker

$
0
0
In this article we will see how to change the protection mode in a Data Guard configuration which is managed by Broker, If you want to read more about each Protection Mode you can read HERE . In this article we will focus on what is needed in order to change from one Protection Mode to another and how to change it. For this article I will use two databases in two different Servers: db12102 (db1) - Primary Database db12102 (db1s) - Physical Standby Database Basically what we need to set up is the following: Redo Transport Services Standby Redo Logs The following image shows a typical configuration of Redo Transport Services: Those two things are very important , The Protection mode relies on those settings. We need to adjust following the next path: For Maximum Performance Mode: Redo Transport Services: ASYNC NOAFFIRM Optional: SYNC NOAFFIRM or SYNC AFFIRM Standby Redo Logs is optional but strongly recommended. Standby Redo Logs must be configured if we are using SYNC NOAFFIRM or SYNC AFFIRM . For Maximum Availability Mode Redo Transport Services: SYNC NOAFFIRM Optional: SYNC AFFIRM Standby Redo Logs must exist . For Maximum Protection Mode Redo Transport Services: SYNC AFFIRM Standby Redo Logs must exist . Checking out the current Configuration: DGMGRL> show configuration; Configuration - NuvolaConfig Protection Mode: MaxPerformance Members: db1 - Primary database db1s - Physical standby database Warning: ORA-16789: standby redo logs configured incorrectly Fast-Start Failover: DISABLED Configuration Status: WARNING (status updated 26 seconds ago) DGMGRL> We see that our current Protection Mode is "Maximum Performance". Following our guideline, Standby Redo Logs are optional in Standby Site, however we see a WARNING (not error) recommending to create Standby Redo Logs. That means that in Standby Site either there are not Standby Redo Logs or they are wrongly configured. Oracle recommends to create the number of Standby Redo Logs = number of Redo Log Groups + 1. Let's verify: Standby Logs in Primary Site: SQL> select group#, thread# from v$standby_log; GROUP# THREAD# ---------- ---------- 4 1 5 1 6 1 7 1 Redo Logs in Primary Site: SQL> select group#, thread# from v$log; GROUP# THREAD# ---------- ---------- 1 1 2 1 3 1 Standby Logs in Standby Site: SQL> select group#, thread# from v$standby_log; no rows selected Redo Logs in Standby Site: SQL> select group#, thread# from v$log; GROUP# THREAD# ---------- ---------- 1 1 2 1 3 1 As we see, there are not Standby Redo Logs created in Standby Site, that's why we saw the WARNING in Broker. Following Broker recommendation, I will proceed to create the Standby Redo Logs, which based on our guideline they should be 4 groups. Creating Standby Logs In Standby Site: SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; Database altered. SQL> SQL> ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 SIZE 50M; Database altered. SQL> ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 SIZE 50M; Database altered. SQL> ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 SIZE 50M; Database altered. SQL> ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 SIZE 50M; Database altered. SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE NODELAY DISCONNECT FROM SESSION; Database altered. Confirming if the Standby Redo Logs exist in Standby Site: SQL> select group#, thread# from v$standby_log; GROUP# THREAD# ---------- ---------- 4 1 5 1 6 1 7 1 Now that the Standby Redo Logs were created Broker should show be OK: DGMGRL> show configuration; Configuration - NuvolaConfig Protection Mode: MaxPerformance Members: db1 - Primary database db1s - Physical standby database Fast-Start Failover: DISABLED Configuration Status: SUCCESS (status updated 2 seconds ago) Changing the Protection Mode from Maximum Performance to Maximum Availability: As our guideline said, we should change the Redo Transport Service to SYNC, let's see what is the current value: DGMGRL> DGMGRL> show database 'db1s' 'LogXptMode'; LogXptMode = ' ASYNC ' DGMGRL> I will try to change the Protection mode without set SYNC just to see if we can bypass this requirement: DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY; Error: ORA-16627: operation disallowed since no standby databases would remain to support protection mode Failed. DGMGRL> Confirmed, we have to change it to SYNC. Firstable let's see what is the current value of the parameter log_archive_dest_2 which is the parameter that points to our Standby Database. This parameters should be verified in Primary Site. In Primary Site: SQL> show parameters log_archive_dest_2 NAME TYPE VALUE -------------------- -------- ------------------------------ log_archive_dest_2 string service="db1s", ASYNC NOAFFIRM delay=0 optional compression= disable max_failure=0 max_conn ections=1 reopen=300 db_unique _name="db1s" net_timeout=30, v alid_for=(online_logfile,all_r oles) Now let's change it to SYNC: DGMGRL> EDIT DATABASE 'db1s' SET PROPERTY 'LogXptMode'='SYNC'; Property "LogXptMode" updated DGMGRL> show database 'db1s' 'LogXptMode'; LogXptMode = ' SYNC ' DGMGRL> Verifying the value: In Primary Site: SQL> show parameters log_archive_dest_2 NAME TYPE VALUE ------------------- ------- ------------------------------ log_archive_dest_2 string service="db1s", SYNC AFFIRM de lay=0 optional compression=dis able max_failure=0 max_connect ions=1 reopen=300 db_unique_na me="db1s" net_timeout=30, vali d_for=(online_logfile,all_role s) If our guideline is correct, now we should be able to change the Protection Mode: DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY; Succeeded. Confirming in the Configuration: DGMGRL> show configuration; Configuration - NuvolaConfig Protection Mode: MaxAvailability Members: db1 - Primary database db1s - Physical standby database Fast-Start Failover: DISABLED Configuration Status: SUCCESS (status updated 46 seconds ago) DGMGRL> Changing the Protection Mode from Maximum Availability to Maximum Protection: Since currently we have Standby Redo Logs Created in Standby Database and we have the Redo Transport Service set to SYNC AFFIRM, we should be able to change the Protection Mode to Maximum Protection, based on our guideline, let's confirm it: DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXPROTECTION; Succeeded. DGMGRL> show configuration; Configuration - NuvolaConfig Protection Mode: MaxProtection Members: db1 - Primary database db1s - Physical standby database Fast-Start Failover: DISABLED Configuration Status: SUCCESS (status updated 20 seconds ago) DGMGRL> Changing the Protection Mode from Maximum Protection to Maximum Availability: The guideline also says the Max Availability Mode can also be used if we are using the same settings than Maximum Protection Mode, if that is correct we should be able to change it now without issues: DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY; Succeeded. DGMGRL> show configuration; Configuration - NuvolaConfig Protection Mode: MaxAvailability Members: db1 - Primary database db1s - Physical standby database Fast-Start Failover: DISABLED Configuration Status: SUCCESS (status updated 18 seconds ago) DGMGRL> Changing the Protection Mode from Maximum Availability to Maximum Performance: The guideline also says the same for Maximum Performance mode, we can use it if the settings are the same than for Maximum Protection Mode. DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXPERFORMANCE; Succeeded. DGMGRL> DGMGRL> show configuration ; Configuration - NuvolaConfig Protection Mode: MaxPerformance Members: db1 - Primary database db1s - Physical standby database Fast-Start Failover: DISABLED Configuration Status: SUCCESS (status updated 1 second ago) DGMGRL> Follow me:

Viewing all articles
Browse latest Browse all 1814

Trending Articles