Home » , , , » Creating A Dataguard Broker Configuration Using DGMGRL

Creating A Dataguard Broker Configuration Using DGMGRL

Written By Srikrishna Murthy Annam on Tuesday, December 13, 2011 | 11:25 AM

In this article we will see step by step instructions on how to configure dataguard broker configuration using DGMGRL utility. The dataguard broker makes it easy to maintain and administer several standby databases. Dataguard broker maintains its own configuration files and runs a background process DMON both on primary and standby database servers. Dataguard broker configuration can be created using either OEM grid control or using a command line utility DGMGRL. In the present article we are using DGMGRL to create dataguard broker configuration to maintain standby databases.

Setup:

Primary Site
Standby Site
Hostname
dgaskmpri01
dgaskmsby01
Database Name
orcl
orcl
Database Unique Name
orcl
sbyorcl
Net Service Name
orcl
sbyorcl

  1. Prepare Primary Site ( Modify init.ora and listener.ora ) 
  2. Prepare Standby site ( Modify init.ora and listener.ora ) 
  3. Create Dataguard configuration 
  4. Adding Standby Database 
  5. Verify the Configuration 
  6. Enable Configuration 
  7. Verifying Configuration With Switchover 
  8. Monitoring DataGuard Broker Configuration

Prepared By SRI

1.Prepare Primary Site :
Init.ora Changes: DB_BROKER_CONFIG_FILEn parameter is used to specify the location of the dataguard configuration. DG_BROKER_START parameter is used to start the broker automatically when the instance starts.
SQL> alter system set dg_broker_config_file1='/home/oracle/app/oracle/product/11.2.0/dbhome_2/dbs/dr1orcl.dat' sid='*';
System altered.
SQL> alter system set dg_broker_config_file2='/home/oracle/app/oracle/product/11.2.0/dbhome_2/dbs/dr2orcl.dat' sid='*';
System altered.
SQL> alter system set dg_broker_start=true  sid='*';
System altered.
Listener.ora Changes : GLOBAL_DBNAME attribute value should be set as shown in the following listener.ora configuraiton on primary site otherwise you will get TNS-12154 error during switch over configuration. A service with name <sid>_DGMGRL will be started when the listener is started.
[oracle@dgaskmpri01 admin]$ cat listener.ora 
LISTENER_PRI = 
  (DESCRIPTION_LIST = 
    (DESCRIPTION = 
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1525)) 
    ) 
    (DESCRIPTION = 
      (ADDRESS = (PROTOCOL = TCP)(HOST = dgaskmpri01.localdomain)(PORT = 1525)) 
    ) 
  )

SID_LIST_LISTENER_PRI = 
  (SID_LIST = 
    (SID_DESC = 
      (GLOBAL_DBNAME = orcl_DGMGRL.localdomain) 
      (ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_2) 
      (SID_NAME = orcl) 
      (SERVICE_NAME = orcl.localdomain) 
    ) 
  ) 
[oracle@dgaskmpri01 admin]$
2. Prepare Standby site:
Init.ora Changes:
SQL> alter system set dg_broker_config_file1='/home/oracle/app/oracle/product/11.2.0/dbhome_2/dbs/dr1sbyorcl.dat' sid='*';
System altered.
SQL> alter system set dg_broker_config_file2='/home/oracle/app/oracle/product/11.2.0/dbhome_2/dbs/dr2sbyorcl.dat' sid='*';
System altered.
SQL> alter system set dg_broker_start=true  sid='*';
System altered.
Listener.ora Changes:
[oracle@dgaskmsby01 admin]$ cat listener.ora
LISTENER_SBY = 
  (DESCRIPTION_LIST = 
    (DESCRIPTION = 
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1525)) 
    ) 
    (DESCRIPTION = 
      (ADDRESS = (PROTOCOL = TCP)(HOST = dgaskmsby01.localdomain)(PORT = 1525)) 
    ) 
  )

SID_LIST_LISTENER_SBY = 
  (SID_LIST = 
    (SID_DESC = 
      (GLOBAL_DBNAME = sbyorcl_DGMGRL.localdomain) 
      (ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_2) 
      (SID_NAME = sbyorcl) 
      (SERVICE_NAME = sbyorcl.localdomain) 
    ) 
  ) 
[oracle@dgaskmsby01 admin]$

3. Create Dataguard configuration:
On the primary Database Server connect to database using DGMGRL utility.
[oracle@dgaskmpri01 dbs]$ dgmgrl 
DGMGRL for Linux: Version 11.2.0.2.0 - Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information. 
DGMGRL> connect sys/oracle
Connected.
DGMGRL> CREATE CONFIGURATION 'askm_config' AS PRIMARY DATABASE IS 'orcl' CONNECT IDENTIFIER IS orcl; 
Configuration "askm_config" created with primary database "orcl"
DGMGRL> show configuration;
Configuration - askm_config
  Protection Mode: MaxPerformance 
  Databases:
    orcl - Primary database

Fast-Start Failover: DISABLED
Configuration Status: 
DISABLED
DGMGRL>
In the created configuration command,
askm_config = It is the name of the configuration. And it can be anything that your choice.
Primary Database is ‘orcl’ = Here ‘orcl’ is primary database db_unique_name value
Connect Identifier is ‘orcl’ = Here ‘orcl’ is alias name defined in tnsnames.ora to connect to primary database.
4. Adding Standby Databas:
DGMGRL> ADD DATABASE 'sbyorcl' AS CONNECT IDENTIFIER IS sbyorcl MAINTAINED AS PHYSICAL;
Database "sbyorcl" added 
DGMGRL> show configuration;
Configuration - askm_config
  Protection Mode: MaxPerformance 
  Databases:
    orcl    - Primary database
    sbyorcl - Physical standby database

Fast-Start Failover: DISABLED
Configuration Status: 
DISABLED
DGMGRL>
6. Enable Configuration:
DGMGRL> help enable configuration;
Enables a configuration, a database, or fast-start failover
Syntax:
  ENABLE CONFIGURATION;
  ENABLE DATABASE <database name>;
  ENABLE FAST_START FAILOVER [CONDITION <condition>];
DGMGRL> enable configuration; 
Enabled.
DGMGRL> show configuration;

Configuration - askm_config
  Protection Mode: MaxPerformance 
  Databases:
    orcl    - Primary database
    sbyorcl - Physical standby database

Fast-Start Failover: DISABLED
Configuration Status: 
SUCCESS
DGMGRL>
7. Verifying Configuration With Switchover:
[oracle@dgaskmpri01 dbs]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.2.0 - Production

Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information. 
DGMGRL> connect sys/oracle
Connected.
DGMGRL> switchover to 'sbyorcl';
Performing switchover NOW, please wait...
New primary database "sbyorcl" is opening...
Operation requires shutdown of instance "orcl" on database "orcl"
Shutting down instance "orcl"...
ORACLE instance shut down.
Operation requires startup of instance "orcl" on database "orcl"
Starting instance "orcl"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "sbyorcl"
DGMGRL>

DGMGRL> exit 
[oracle@dgaskmpri01 dbs]$ clear
[oracle@dgaskmpri01 dbs]$ sqlplus '/as sysdba'

SQL*Plus: Release 11.2.0.2.0 Production on Thu Nov 17 08:54:54 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to: 
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select database_role,switchover_status from v$database;
DATABASE_ROLE    SWITCHOVER_STATUS 
--------------- -------------------- PHYSICAL STANDBY NOT ALLOWED
SQL> exit 
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dgaskmpri01 dbs]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.2.0 - Production

Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information. 
DGMGRL> connect sys/oracle
Connected.
DGMGRL> switchover to 'orcl';
Performing switchover NOW, please wait...
New primary database "orcl" is opening...
Operation requires shutdown of instance "sbyorcl" on database "sbyorcl"
Shutting down instance "sbyorcl"...
ORACLE instance shut down.
Operation requires startup of instance "sbyorcl" on database "sbyorcl"
Starting instance "sbyorcl"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "orcl"
DGMGRL> exit
[oracle@dgaskmpri01 dbs]$ sqlplus '/as sysdba'

SQL*Plus: Release 11.2.0.2.0 Production on Thu Nov 17 08:56:46 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to: 
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select database_role,switchover_status from v$database;
DATABASE_ROLE    SWITCHOVER_STATUS 
---------------- -------------------- PRIMARY          TO STANDBY
SQL> 

8. Monitoring DataGuard Broker Configuration:
DGMGRL> help DGMGRL> show configuration;
DGMGRL> edit database "orcl" set property LogXptMode='SYNC';
DGMGRL> show database 'orcl' 'LogXptStatus';
DGMGRL> edit configuration set protection mode as MaxAvailability;
DGMGRL> enable fast_start failover; DGMGRL> show database 'orcl';
DGMGRL> enable database 'orcl'; DGMGRL> remove configuration;
DGMGRL> show database verbose orcl;
DGMGRL> show database orcl InconsistentProperties
DGMGRL> show database 'orcl' 'StatusReport';

Reference :
http://docs.oracle.com/cd/B12037_01/server.101/b10822/cli.htm
Setup and maintenance of Data Guard Broker using DGMGRL [ID 201669.1]
10g DGMGRL CLI Configuration [ID 260112.1]
Unable To Recreate Data Guard Fast Start Failover Configuration With DGMGRL [ID 454418.1]
Creating a configuration using Data Guard Manager [ID 214071.1]
Interaction Between the Data Guard Broker and a Data Guard Configuration [ID 249703.1]
http://www.izzysoft.de/oracle/ifaqmaker.php?id=7;toc=1

Hope It Helps
SRI


Share this article :

Related Articles By Category



+ comments + 10 comments

Sankar
February 15, 2012 at 2:03 PM

Hi Sri

Nice document. Please give access for this video

learnwithme11g
February 16, 2012 at 10:15 AM

hi Sankar, This video is public, you should be able to access it. Please check once.
Thanks
SRI

Som Sharma
June 20, 2012 at 8:48 PM

Very good - please give me access this video

shiva
August 2, 2012 at 12:23 PM

nice

December 12, 2012 at 2:58 PM

Hi Sri,
GLOBAL_DBNAME = _DGMGRL.domain.
Is it mandatory to put the oracle_sid in lower case ? Or it can be upper case/Mixed case

Thanks
Sid

Satyam Nirujogi
March 7, 2013 at 4:16 AM

Hi Sri,
Its good one, It would be realy helpful to me.

Thanks
Satyam.

deeps
March 12, 2013 at 12:10 PM

too gud.

Thanks.

Sohail
November 15, 2013 at 3:42 PM

Hi sri,
Please help me out, iam very much confused.. please iam very much confuse about dgmgrl configuration , please be more precised on these configuration.

Srikrishna Murthy Annam
November 18, 2013 at 3:26 AM

Hi Sohail, Please let me know which part of this article, you are confused with. This is the simple step by step configuration of the DGMGRL. I doubt if someone has even more simplest form than this.

Sohail
November 18, 2013 at 3:22 PM

Hi Krishna,

iam getting error while iam enable the configuration,
showing me this error . Warning: ORA-16801: redo transport-related property is inconsistent with database setting. Though i have create both sides standby logfile with higher number, but still iam getting the same issue.
Please solve this issue. Its very urgent

Post a Comment

Thank you for visiting our site and leaving your valuable comment.

 
Support :
Copyright © 2013. askMLabs - All Rights Reserved
Proudly powered by Blogger