While using dataguard broker is optional with Dataguard, using it adds some complexity and flexibility – expect a little learning curve.
A prerequisite for using DGMGRL is that a primary database and any standby databases must already exist.
The DG_BROKER_START initialization parameter must be set to TRUE for all databases in the configuration. You must use a server parameter file (SPFILE) to use the Dataguard broker.
Two initialization parameters will be created for you when a broker configuration is defined using dgmgrl.
To enable DGMGRL to restart instances during the course of broker operations, a service with a specific name must be statically registered with the local listener of each instance.
The value for the GLOBAL_DBNAME attribute must be set to a concatenation of <db_unique_name>_DGMGRL.<db_domain> see the following example – note you can have as many SID_DESC sections as you want but one must meet the above requirements to be used by dgmgrl automatically:
(GLOBAL_DBNAME = PROD_DGMGRL)
(SID_NAME = PROD)
If you are SSH’d into the primary or standby – the following are some simple show configuration commands:
show configuration verbose
show database ‘PRIM’
show database ‘STDBY’
Create a dgmgrl configuration
You create a dgmgrl configuration with two commands – first the primary – second add the standby. You must also enable the configuration.
By the way, I have not confirmed this but, you can now connect to dgmgrl as more than just “SYS” – inconsistent user connections to dgmgrl could cause issues. Which ever user you use, you should be consistent about how you connect and who you are connected to (note sometimes you may connect as SYSDG instead). I just always make sure I connect as SYS and there is an Oracle password file for the SYS user on both primary and standby hosts.
[oracle@o68-122db ~]$ dgmgrl
DGMGRL for Linux: Release 188.8.131.52.0 – Production on Sat Sep 2 15:13:52 2017
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type “help” for information.
Connected to “GGTARGET”
Connected as SYS.
CREATE CONFIGURATION DGCONFIG AS PRIMARY DATABASE IS GGTARGET CONNECT IDENTIFIER IS GGTARGET;
Configuration “dgconfig” created with primary database “ggtarget”
Now on while still on the primary side – add the standby to the configuration – and then enable the configuration
DGMGRL> ADD DATABASE GGSTBY AS CONNECT IDENTIFIER IS GGSTBY MAINTAINED AS PHYSICAL;
DGMGRL> enable configuration;
Here’s a nice write up for using DG Broker by Julian Dyke – although his listener configuration confused me a bit.