Oracle Technologies Blog

By ASKM

Creating A Dataguard Broker Configuration Using DGMGRL

Posted by Srikrishna Murthy Annam on December 13, 2011

            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
About these ads

11 Responses to “Creating A Dataguard Broker Configuration Using DGMGRL”

  1. Sankar said

    Hi Sri

    Nice document. Please give access for this video

  2. learnwithme11g said

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

  3. Som Sharma said

    Very good – please give me access this video

  4. shiva said

    nice

  5. 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

  6. Satyam Nirujogi said

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

    Thanks
    Satyam.

  7. deeps said

    too gud.

    Thanks.

  8. Sohail said

    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.

  9. Srikrishna Murthy Annam said

    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.

  10. Sohail said

    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

  11. Praveen Koppula said

    Cause: The values of one or more redo transport-related configuration properties were inconsistent with database in-memory settings or server parameter file settings. This may happen by directly altering initialization parameters instead of editing configurable property values using Data Guard broker.
    Action: Query the InconsistentLogXptProps property on the primary database or check the Data Guard broker log to find which properties are set inconsistently. Reset these properties to make them consistent with the database settings. Alternatively, enable the database or the entire configuration to allow the configurable property settings to be propagated to the initialization parameters.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: