NAVEEN

Wednesday, April 7, 2010

Dataguard Broker Concepts and Configuration

Oracle Data Guard Overview

Oracle Data Guard ensures high availability, data protection, and disaster recovery for enterprise data. Data Guard provides a comprehensive set of services that create, maintain, manage, and monitor one or more standby databases to enable production Oracle databases to survive disasters and data corruptions. Data Guard maintains these standby databases as transactionally consistent copies of the primary database. If the primary database becomes unavailable because of a planned or an unplanned outage, Data Guard can switch any standby database to the production role, thus minimizing the downtime associated with the outage. Data Guard can be used with traditional backup, recovery, and cluster techniques, as well as the Flashback Database feature to provide a high level of data protection and data availability.


Oracle Data Guard Configuration Overview

A Data Guard configuration consists of one primary database and up to nine standby databases. The databases in a Data Guard configuration are connected by Oracle Net and may be dispersed geographically. There are no restrictions on where the databases are located if they can communicate with each other. For example, you can have a standby database on the same system as the primary database, along with two standby databases on another system.

The Data Guard broker logically groups these primary and standby databases into a broker configuration that allows the broker to manage and monitor them together as an integrated unit. You can manage them using the broker's graphical user interface (GUI) that is integrated with Oracle Enterprise Manager or using a command-line interface (CLI) called DGMGRL.


Oracle Data Guard Broker Overview

The Oracle Data Guard broker is a distributed management framework that automates and centralizes the creation, maintenance, and monitoring of Data Guard configurations. The following are some of the operations that the broker automates and simplifies:

•Automated creation of Data Guard configurations incorporating a primary database, a new or existing (physical or logical) standby database, log transport services, and log apply services, where any of the databases could be Real Application Clusters (RAC) databases.

•Adding up to 8 additional new or existing (physical or logical, RAC, or non-RAC) standby databases to each existing Data Guard configuration, for a total of one primary database, and from 1 to 9 standby databases in the same configuration.

•Managing an entire Data Guard configuration, including all databases, log transport services, and log apply services, through a client connection to any database in the configuration.

•Invoking switchover or failover with a single command to initiate and control complex role changes across all databases in the configuration.

•Monitoring the status of the entire configuration, capturing diagnostic information, reporting statistics such as the log apply rate and the redo generation rate, and detecting problems quickly with centralized monitoring, testing, and performance tools.

You can perform all management operations locally or remotely through the broker's easy-to-use interfaces: the Data Guard web pages of Oracle Enterprise Manager, which is the broker's graphical user interface (GUI), and the Data Guard command-line interface (CLI) called DGMGRL.

Benefits of Data Guard Broker

The broker's interfaces improve usability and centralize management and monitoring of the Data Guard configuration. Available as a feature of the Enterprise Edition and Personal Edition of the Oracle database, the broker is also integrated with the Oracle database. These broker attributes result in the following benefits:

Automated switchover and failover operations:

Only one command is required to initiate complex role changes for switchover or failover operations across all databases in the configuration. The broker automates switchover and failover to a specified standby database in the broker configuration.

Benefits of Data Guard Broker

The broker's interfaces improve usability and centralize management and monitoring of the Data Guard configuration. Available as a feature of the Enterprise Edition and Personal Edition of the Oracle database, the broker is also integrated with the Oracle database. These broker attributes result in the following benefits:

Automated switchover and failover operations:

Only one command is required to initiate complex role changes for switchover or failover operations across all databases in the configuration. The broker automates switchover and failover to a specified standby database in the broker configuration.


Data Guard Broker Components

The Oracle Data Guard broker consists of the following components:

•Data Guard GUI

•Data Guard Command-Line Interface (DGMGRL)

•Data Guard Monitor

The Data Guard graphical user interface, tightly integrated with Oracle Enterprise Manager, and the Data Guard command-line interface are the broker client interfaces that help you define and manage a configuration consisting of a collection of primary and standby databases.


The Data Guard monitor is the broker server-side component that is integrated with the Oracle database. Data Guard monitor is composed of the DMON process and broker configuration files that allow you to control the databases of that configuration, modify their behavior at runtime, monitor the overall health of the configuration, and provide notification of other operational characteristics.

The following example lists the available commands:

DGMGRL> HELP

The following commands are available:

add Add a standby database into the broker configuration
connect Connect to an Oracle instance
create Create a broker configuration
disable Disable broker control of a configuration or database
edit Edit a configuration, database or instance
enable Enable broker control of a configuration or database
exit Exit the program
failover Change a standby database to be the primary database
help Display description and syntax for a given command
quit Exit the program
rem Comment to be ignored by DGMGRL
remove Remove a configuration, database or instance
show Display information of a configuration, database or instance
shutdown Shut down a currently running Oracle instance
startup Start an Oracle database instance
switchover Switch roles between the primary database and a standby database

C:\>set oracle_sid=prod

C:\>dgmgrl

DGMGRL for 32-bit Windows: Version 10.2.0.1.0 - Production
Copyright (c) 2000, 2005, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.


DGMGRL> connect sys/prod

Connected.


Cretate Configuration :

DGMGRL> create configuration 'DGConfig1' as

> primary database is 'prod'

> connect identifier is prod;

Configuration "DGConfig1" created with primary database "prod"


Add standby database to broker:

DGMGRL> add database 'stand' as connect identifier is stand maintained as physical;
Database "stand" added


DGMGRL> SHOW DATABASE 'prod' 'StatusReport';

Error: ORA-16548: object not enabled



DGMGRL> show configuration;



Configuration

Name: DGConfig1

Enabled: NO

Protection Mode: MaxPerformance

Fast-Start Failover: DISABLED

Databases:

prod - Primary database

stand - Physical standby database



Current status for "DGConfig1":

DISABLED



DGMGRL> enable configuration;

Enabled.

DGMGRL> show configuration;



Configuration

Name: DGConfig1

Enabled: YES

Protection Mode: MaxPerformance

Fast-Start Failover: DISABLED

Databases:

prod - Primary database

stand - Physical standby database



Current status for "DGConfig1":

SUCCESS



DGMGRL> SHOW DATABASE 'prod' 'StatusReport';

STATUS REPORT

INSTANCE_NAME SEVERITY ERROR_TEXT



DGMGRL> SHOW DATABASE 'stand' 'StatusReport';

STATUS REPORT

INSTANCE_NAME SEVERITY ERROR_TEXT



DGMGRL> SHOW DATABASE VERBOSE 'prod' ;



Database

Name: prod

Role: PRIMARY

Enabled: YES

Intended State: ONLINE

Instance(s):

prod



Properties:

InitialConnectIdentifier = 'prod'

LogXptMode = 'ASYNC'

Dependency = ''

DelayMins = '0'

Binding = 'OPTIONAL'

MaxFailure = '0'

MaxConnections = '1'

ReopenSecs = '300'

NetTimeout = '180'

LogShipping = 'ON'

PreferredApplyInstance = ''

ApplyInstanceTimeout = '0'

ApplyParallel = 'AUTO'

StandbyFileManagement = 'AUTO'

ArchiveLagTarget = '0'

LogArchiveMaxProcesses = '30'

LogArchiveMinSucceedDest = '1'

DbFileNameConvert = 'C:\oracle\product\oradata\stand, C:\oracle\product\10.2.0\oradata\prod\prod'

LogFileNameConvert = 'C:\oracle\product\oradata\stand, C:\oracle\product\10.2.0\oradata\prod\prod, C:\oracle\product\oradat

a\arch_stand, C:\oracle\product\10.2.0\oradata\arch_prod'

FastStartFailoverTarget = ''

StatusReport = '(monitor)'

InconsistentProperties = '(monitor)'

InconsistentLogXptProps = '(monitor)'

SendQEntries = '(monitor)'

LogXptStatus = '(monitor)'

RecvQEntries = '(monitor)'

HostName = 'IGTEWF9000'

SidName = 'prod'

LocalListenerAddress = '(ADDRESS=(PROTOCOL=tcp)(HOST=IGTEWF9000)(PORT=1521))'

StandbyArchiveLocation = 'C:\oracle\product\10.2.0\oradata\arch_prod'

AlternateLocation = ''

LogArchiveTrace = '0'

LogArchiveFormat = 'ARC%S_%R.%T.arc'

LatestLog = '(monitor)'

TopWaitEvents = '(monitor)'



Current status for "prod":

SUCCESS



DGMGRL> edit database prod set property 'logxptmode'='SYNC';

Property "logxptmode" updated

DGMGRL> SHOW DATABASE VERBOSE 'prod' ;



Database

Name: prod

Role: PRIMARY

Enabled: YES

Intended State: ONLINE

Instance(s):

prod



Properties:

InitialConnectIdentifier = 'prod'

LogXptMode = 'SYNC'

Dependency = ''

DelayMins = '0'

Binding = 'OPTIONAL'

MaxFailure = '0'

MaxConnections = '1'

ReopenSecs = '300'

NetTimeout = '180'

LogShipping = 'ON'

PreferredApplyInstance = ''

ApplyInstanceTimeout = '0'

ApplyParallel = 'AUTO'

StandbyFileManagement = 'AUTO'

ArchiveLagTarget = '0'

LogArchiveMaxProcesses = '30'

LogArchiveMinSucceedDest = '1'

DbFileNameConvert = 'C:\oracle\product\oradata\stand, C:\oracle\product\10.2.0\oradata\prod\prod'

LogFileNameConvert = 'C:\oracle\product\oradata\stand, C:\oracle\product\10.2.0\oradata\prod\prod, C:\oracle\product\oradat

a\arch_stand, C:\oracle\product\10.2.0\oradata\arch_prod'

FastStartFailoverTarget = ''

StatusReport = '(monitor)'

InconsistentProperties = '(monitor)'

InconsistentLogXptProps = '(monitor)'

SendQEntries = '(monitor)'

LogXptStatus = '(monitor)'

RecvQEntries = '(monitor)'

HostName = 'IGTEWF9000'

SidName = 'prod'

LocalListenerAddress = '(ADDRESS=(PROTOCOL=tcp)(HOST=IGTEWF9000)(PORT=1521))'

StandbyArchiveLocation = 'C:\oracle\product\10.2.0\oradata\arch_prod'

AlternateLocation = ''

LogArchiveTrace = '0'

LogArchiveFormat = 'ARC%S_%R.%T.arc'

LatestLog = '(monitor)'

TopWaitEvents = '(monitor)'



Current status for "prod":

SUCCESS



DGMGRL> SHOW DATABASE VERBOSE 'stand' ;



Database

Name: stand

Role: PHYSICAL STANDBY

Enabled: YES

Intended State: ONLINE

Instance(s):

stand



Properties:

InitialConnectIdentifier = 'stand'

LogXptMode = 'ASYNC'

Dependency = ''

DelayMins = '0'

Binding = 'OPTIONAL'

MaxFailure = '0'

MaxConnections = '1'

ReopenSecs = '300'

NetTimeout = '180'

LogShipping = 'ON'

PreferredApplyInstance = ''

ApplyInstanceTimeout = '0'

ApplyParallel = 'AUTO'

StandbyFileManagement = 'AUTO'

ArchiveLagTarget = '0'

LogArchiveMaxProcesses = '30'

LogArchiveMinSucceedDest = '1'

DbFileNameConvert = 'C:\oracle\product\10.2.0\oradata\prod\prod, C:\oracle\product\oradata\stand'

LogFileNameConvert = 'C:\oracle\product\10.2.0\oradata\prod\prod, C:\oracle\product\oradata\stand, C:\oracle\product\10.2.0

\oradata\arch_prod, C:\oracle\product\oradata\arch_stand'

FastStartFailoverTarget = ''

StatusReport = '(monitor)'

InconsistentProperties = '(monitor)'

InconsistentLogXptProps = '(monitor)'

SendQEntries = '(monitor)'

LogXptStatus = '(monitor)'

RecvQEntries = '(monitor)'

HostName = 'IGTEWF1635'

SidName = 'stand'

LocalListenerAddress = '(ADDRESS=(PROTOCOL=tcp)(HOST=IGTEWF1635)(PORT=1521))'

StandbyArchiveLocation = 'C:\oracle\product\oradata\arch_stand'

AlternateLocation = ''

LogArchiveTrace = '0'

LogArchiveFormat = 'ARC%S_%R.%T.arc'

LatestLog = '(monitor)'

TopWaitEvents = '(monitor)'



Current status for "stand":

SUCCESS



DGMGRL> edit database stand set property 'logxptmode'='SYNC';

Property "logxptmode" updated



Perform Switch over operation by this command:


DGMGRL> switchover to stand;

Performing switchover NOW, please wait...

Operation requires shutdown of instance "prod" on database "prod"

Shutting down instance "prod"...

ORA-01109: database not open



Database dismounted.

ORACLE instance shut down.

Operation requires shutdown of instance "stand" on database "stand"

Shutting down instance "stand"...

ORA-01109: database not open



Database dismounted.

ORACLE instance shut down.

Operation requires startup of instance "prod" on database "prod"

Starting instance "prod"...

ORACLE instance started.

Database mounted.

Operation requires startup of instance "stand" on database "stand"

Starting instance "stand"...

ORACLE instance started.

Database mounted.

Switchover succeeded, new primary is "stand"


Now standby is acting as priamry database.

DGMGRL>