Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
oracle_guard_broker_conf [2020/10/25 11:45] – [Overview] andonovj | oracle_guard_broker_conf [2020/10/25 12:13] (current) – andonovj | ||
---|---|---|---|
Line 3: | Line 3: | ||
As such, the Data Guard Broker provide a set of utilities to the DBA to manage the Data Guard in easier way. | As such, the Data Guard Broker provide a set of utilities to the DBA to manage the Data Guard in easier way. | ||
- | So to that, we need again to prepare the standby and the primary, as there are some settings that needs to be fixed :) | + | You can see a brief architecture of the broker. The broker can be started from a 3rd server, but the configuration has to be sure with all instances. Because of that, it is recommended to be stored on the shared data location (ASM in our case) |
+ | |||
+ | {{: | ||
+ | |||
+ | Before we configure the Broker, we need again to prepare the standby and the primary, as there are some settings that needs to be fixed :) | ||
- | So the goal of our exercise here is to bring the database something like that: | ||
- | {{: | ||
=====Preparation===== | =====Preparation===== | ||
- | To prepare the primary and standby, we have to reset the destination parameters: | + | To prepare the primary and standby, we have to move the password file to shared location and reset the destination parameters: |
**Note**: As of Oracle Database 12c Release 1 (12.1), for all databases to be added to a | **Note**: As of Oracle Database 12c Release 1 (12.1), for all databases to be added to a | ||
Line 16: | Line 18: | ||
+ | < | ||
+ | --Primary | ||
+ | ----Unlock the Broker User | ||
+ | [oracle@enode01 ~]$ | ||
+ | SQL> alter user sysdg identified by oracle_4U; | ||
+ | User altered. | ||
+ | SQL> alter user sysdg account unlock; | ||
+ | User altered. | ||
+ | SQL> exit; | ||
+ | |||
+ | ----Password file Export: | ||
+ | [oracle@enode01 ~]$ scp / | ||
+ | orapweastdb 100% 7680 7.5KB/s 00:00 | ||
+ | [oracle@enode01 ~]$ | ||
+ | |||
+ | ----Log destination Reset | ||
+ | [oracle@enode01 ~]$ sqlplus / as sysdba | ||
+ | SQL> alter system set log_archive_dest_2='' | ||
+ | System altered. | ||
+ | SQL> alter system set dg_broker_config_file1=' | ||
+ | System altered. | ||
+ | SQL> alter system set dg_broker_config_file2=' | ||
+ | System altered. | ||
+ | SQL> alter system set dg_broker_start=true scope=both sid=' | ||
+ | System altered. | ||
+ | SQL> exit | ||
+ | |||
+ | |||
+ | --Standby | ||
+ | ----Password file import: | ||
+ | [grid@wnode03 ~]$ asmcmd pwcopy / | ||
+ | copying / | ||
+ | [grid@wnode03 ~]$ su - oracle | ||
+ | [oracle@wnode03 ~]$ export ORACLE_SID=westdb1 | ||
+ | [oracle@wnode03 ~]$ srvctl modify database -db westdb -pwfile +data/ | ||
+ | |||
+ | ----Cancel Apply & Log destination Reset | ||
+ | [oracle@wnode03 ~]$ sqlplus / as sysdba | ||
+ | SQL> alter database recover managed standby database cancel; | ||
+ | Database altered. | ||
+ | SQL> alter system set log_archive_dest_2='' | ||
+ | System altered. | ||
+ | SQL> alter system set dg_broker_config_file1=' | ||
+ | System altered. | ||
+ | SQL> alter system set dg_broker_config_file2=' | ||
+ | System altered | ||
+ | SQL> alter system set dg_broker_start=true scope=both sid=' | ||
+ | System altered. | ||
+ | SQL> exit | ||
+ | [oracle@wnode03 ~]$ | ||
+ | |||
+ | ----Verificaiton | ||
+ | [oracle@wnode03 ~]$ dgmgrl | ||
+ | DGMGRL for Linux: Version 12.1.0.2.0 - 64bit Production | ||
+ | Copyright (c) 2000, 2012, Oracle. All rights reserved. | ||
+ | Welcome to DGMGRL, type " | ||
+ | DGMGRL> connect sysdg/ | ||
+ | Connected as SYSDG. | ||
+ | DGMGRL> connect sysdg/ | ||
+ | Connected as SYSDG. | ||
+ | DGMGRL> exit | ||
+ | [oracle@wnode03 ~]$ | ||
+ | </ | ||
+ | |||
+ | =====Configuration===== | ||
+ | The configuration is done on the primary and then the configuration is edited to include the standby as well: | ||
+ | |||
+ | < | ||
+ | [oracle@enode01 ~]$ dgmgrl | ||
+ | DGMGRL for Linux: Version 12.1.0.2.0 - 64bit Production | ||
+ | Copyright (c) 2000, 2012, Oracle. All rights reserved. | ||
+ | Welcome to DGMGRL, type " | ||
+ | DGMGRL> connect sysdg/ | ||
+ | Connected as SYSDG. | ||
+ | DGMGRL> show configuration | ||
+ | ORA-16532: Data Guard broker configuration does not exist | ||
+ | Configuration details cannot be determined by DGMGRL | ||
+ | DGMGRL> | ||
+ | ' | ||
+ | Configuration " | ||
+ | DGMGRL> show configuration | ||
+ | Configuration - dg_config | ||
+ | Protection Mode: MaxPerformance | ||
+ | Members: | ||
+ | eastdb - Primary database | ||
+ | Fast-Start Failover: DISABLED | ||
+ | Configuration Status: | ||
+ | DISABLED | ||
+ | DGMGRL> | ||
+ | DGMGRL> add database ' | ||
+ | Database " | ||
+ | DGMGRL> show configuration | ||
+ | Configuration - dg_config | ||
+ | Protection Mode: MaxPerformance | ||
+ | Members: | ||
+ | | ||
+ | | ||
+ | Fast-Start Failover: DISABLED | ||
+ | Configuration Status: | ||
+ | DISABLED | ||
+ | DGMGRL> | ||
+ | </ | ||
+ | |||
+ | =====Management===== | ||
+ | Now that we have the configuration, | ||
+ | |||
+ | |||
+ | ====Change the Redo Rules to SYNC==== | ||
+ | < | ||
+ | DGMGRL> EDIT DATABASE ' | ||
+ | ' | ||
+ | Property " | ||
+ | DGMGRL> EDIT DATABASE ' | ||
+ | ' | ||
+ | Property " | ||
+ | DGMGRL> | ||
+ | DGMGRL> edit database westdb set property MaxConnections=4; | ||
+ | DGMGRL> edit database eastdb set property MaxConnections=4; | ||
+ | DGMGRL> | ||
+ | DGMGRL> edit configuration set property CommunicationTimeout = 300; <- How many seconds before Broker decides Network timeout. | ||
+ | Property " | ||
+ | DGMGR | ||
+ | DGMGRL> edit configuration set property OperationTimeout = 600; <- specifies the maximum amount of time the broker should wait for health check, get monitorable property, and set property | ||
+ | operations to complete | ||
+ | Property " | ||
+ | DGMGRL> | ||
+ | </ | ||
+ | |||
+ | ====Change Protection Mode to Max Availability==== | ||
+ | < | ||
+ | DGMGRL> edit configuration set protection mode as MaxAvailability; | ||
+ | Succeeded. | ||
+ | DGMGRL | ||
+ | DGMGRL> enable configuration | ||
+ | Enabled. | ||
+ | DGMGRL> show configuration | ||
+ | Configuration - dg_config | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | Fast-Start Failover: DISABLED | ||
+ | |||
+ | Configuration Status: | ||
+ | SUCCESS (status updated 75 seconds ago) | ||
+ | DGMGRL> | ||
+ | </ | ||
+ | |||
+ | =====Verify Transportation & Apply===== | ||
+ | From the Broker it is very easy to verify both Transportation & Apply | ||
+ | |||
+ | < | ||
+ | DGMGRL> show database eastdb | ||
+ | Database - eastdb | ||
+ | Role: PRIMARY | ||
+ | Intended State: TRANSPORT-ON | ||
+ | Instance(s): | ||
+ | eastdb1 | ||
+ | eastdb2 | ||
+ | Database Status: | ||
+ | SUCCESS | ||
+ | DGMGRL | ||
+ | DGMGRL> | ||
+ | DGMGRL> show database westdb | ||
+ | Database - westdb | ||
+ | Role: PHYSICAL STANDBY | ||
+ | Intended State: APPLY-ON | ||
+ | Transport Lag: 0 seconds (computed 1 second ago) | ||
+ | Apply Lag: 0 seconds (computed 1 second ago) | ||
+ | Average Apply Rate: 8.00 KByte/s | ||
+ | Real Time Query: OFF | ||
+ | Instance(s): | ||
+ | westdb1 | ||
+ | westdb2 (apply instance) | ||
+ | Database Status: | ||
+ | SUCCESS | ||
+ | </ |