Wednesday, November 18, 2009

10g DGMGRL CLI Configuration


10g DGMGRL CLI Configuration

Doc ID:
260112.1
Type:
REFERENCE

Modified Date:
11-JAN-2006
Status:
PUBLISHED

PURPOSE
-------

This document has been created with step-by-step instructions on how to create
a DGMGRL configuration using the command line interface (CLI)


SCOPE & APPLICATION
-------------------

For testers and customers


                   10G - DGMGRL CLI CONFIGURATION
                   ******************************

                Primary host : stdg2
               Standby host : stdg1

               Platform : Linux Redhat AS 2.1
               Kernel : 2.4.9-e.24

               Primary Set up on host stdg2
               ORACLE_SID=v10g

Prerequisite:
=============

   -    The Primary and any Standby databases must exist.
   -    DG_BROKER_START =TRUE should be set in the initialization parameter.
        This will start the DMON processes. This DMON process is the server
        side component that interacts with the local database and the DMON
        processes of the other database to perform the requested function.
        It also monitors the health of the broker configuration and ensures
        that every database has a consistent description of the configuration.
   -    SPFILE has to be used. Convert PFILE to SPFILE
   -    Make sure the instances are started with SPFILE

Creating the configuration:
============================
OS>dgmgrl
      
DGMGRL> connect sys/oracle
Connected.

NOTE1: (SYSDBA is the default setting for this command. Make sure the account
from which you connect to the database has sysdba privileges on the primary
and the standby database.)

NOTE2: (The names fo the primary and standby must match their database unique
names. The following sql will provide the information.
SQL>show parameter db_unique_name;  )

DGMGRL> create configuration 'stdg2' as  
> primary database is 'v10g_stdg2'
> connect identifier is v10g_stdg2.us.oracle.com;

Configuration "stdg2" created with primary database "v10g_stdg2".

DGMGRL> show configuration

        Configuration
        Name:            stdg2
        Enabled:         NO
        Protection Mode: MaxPerformance
        Databases:
           v10g_stdg2 - Primary database

Current status for "stdg2":
DISABLED

Add the standby to the configuration

DGMGRL> add database 'v10g_stdg1' as
> connect identifier is v10g_stdg1
> maintained as physical;

Database "v10g_stdg1" added.


DGMGRL> show configuration

Configuration
  Name:            stdg2
  Enabled:         NO
  Protection Mode: MaxPerformance
  Databases:
    v10g_stdg2 - Primary database
    v10g_stdg1 - Physical standby database

Current status for "stdg2":
DISABLED

  ~ The configuration has been created but not enabled.

   -    Use HELP to get a list of commands ( DGMGRL>help)
   -    DGMRGL>help รจ will provide the syntax of the command.

Eg: To change the log_archive_format of the standby

DGMGRL>edit database ‘v10g_stdg1’
set property ‘LogArchiveFormat’=’ %t_%s_%r.dbf’;

Property “LogArchiveFormat” updated.

  ~ To see the changes you will need to issue:


DGMGRL> show database verbose v10g_stdg1

Database
  Name:            v10g_stdg1
  Role:            PHYSICAL STANDBY
  Enabled:         NO
  Intended State:  OFFLINE
  Instance(s):
    v10g

  Properties:
    InitialConnectIdentifier        = 'v10g_stdg1'
    LogXptMode                      = 'ARCH'
    Dependency                      = ''
    DelayMins                       = '0'
    Binding                         = 'OPTIONAL'
    MaxFailure                      = '0'
    ReopenSecs                      = '10'
    AsyncBlocks                     = '20480'
    NetTimeout                      = '30'
    LogShipping                     = 'ON'
    PreferredApplyInstance          = ''
    ApplyInstanceTimeout            = '120'
    RealTimeApply                   = 'OFF'
    ApplyNoDelay                    = 'NO'
    ApplyNext                       = '0'
    ApplyParallel                   = 'AUTO'
    StandbyFileManagement           = 'AUTO'
    ArchiveLagTarget                = '0'
    LogArchiveMaxProcesses          = '2'
    LogArchiveMinSucceedDest        = '1'
    DbFileNameConvert               = ''
    LogFileNameConvert              = ''
    StatusReport                    = '(monitor)'
    InconsistentProperties          = '(monitor)'
    InconsistentLogXptProps         = '(monitor)'
    SendQEntries                    = '(monitor)'
    LogXptStatus                    = '(monitor)'
    RecvQEntries                    = '(monitor)'
    HostName                        = 'stdg1'
    SidName                         = 'v10g'
    LocalListenerAddress            = '(ADDRESS=(PROTOCOL=tcp)(HOST=stdg1)(PORT=
1521))'
    StandbyArchiveLocation          = '/u02/admin/v10g/v10garch'
    AlternateLocation               = ''
    LogArchiveTrace                 = '0'
    LogArchiveFormat                = '%t_%s_%r.dbf'
    LatestLog                       = '(monitor)'
    TopWaitEvents                   = '(monitor)'

Current status for "v10g_stdg1":
DISABLED

At this point we will need to enable the configuration. This will allow the Data Guard Broker to manage it.


Enabling the configuration:
===========================

Note: You can enable the entire configuration or a standby database.

DGMGRL> enable configuration
Enabled.

DGMGRL> show configuration

Configuration
  Name:            stdg2
  Enabled:         YES
  Protection Mode: MaxPerformance
  Databases:
    v10g_stdg2 - Primary database
    v10g_stdg1 - Physical standby database

Current status for "stdg2":
SUCCESS

NOTE: Enabling the configuration also enables the standby.

To enable the standby

DGMGRL>enable database ‘v10g_stdg1’;

DGMGRL>show database ‘v10g_stdg1’;

Database
  Name:            v10g_stdg1
  Role:            PHYSICAL STANDBY
  Enabled:         YES
  Intended State:  ONLINE
  Instance(s):
    v10g

Current status for “stdg2”:
SUCCESS

Removing the Configuration / standby database
===============================================

   -    This operation deletes the configurion or standby database profile from
        the broker configuration file, thus removing the ability of the Data
        Guard Broker to manage the configuration
        of the standby database.
        This operation does not remove or affect the actual Data Guard
        configuration and it’s databases.
   -    This is a irreversible process. Once deleted you must start from
        the beginning ( create configuration or add standby respectively.
   -    When running in either maximum protection or max availability
        mode the broker will prevent you from deleting the
        last standby database that supports the protection mode

  ~ Removing the standby database from configuration:

DGMGRL> remove database ‘v10g_stdg1’;

Removed database “v10g_stdg” from the configuration

DGMGRL>show configuration

Configuration
  Name:            stdg2
  Enabled:         YES
  Protection Mode: MaxPerformance
  Databases:
    v10g_stdg2 - Primary database
   
Current status for "stdg2":
SUCCESS

  ~ Removing the broker configuration:

DGMGRL>remove configuration;

Removed configuration

Show configuration will give error ORA-16532: Data Guard configuration does not exist.


REFERENCES
-----------
Oracle® Data Guard Broker
10g Release 1 (10.1)

No comments:

Post a Comment