Saturday, June 4, 2016

Enable Dataguard Broker and Configuring its component DGMGRL

Data Guard Configurations and Broker Configurations:
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 as long as 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 a broker configuration using either the Oracle Enterprise Manager graphical user interface or the Data Guard command-line interface.

Oracle Data Guard Broker:

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 list describes some of the operations the broker automates and simplifies:
  • Creating Data Guard configurations that incorporate a primary database, a new or existing (physical, logical, or snapshot) standby database, redo transport services, and log apply services, where any of the databases could be Oracle Real Application Clusters (RAC) databases.
  • Adding additional new or existing (physical, snapshot, logical, RAC or non-RAC) standby databases to an 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, redo transport services, and log apply services, through a client connection to any database in the configuration.
  • Managing the protection mode for the broker configuration.
  • Invoking switchover or failover with a single command to initiate and control complex role changes across all databases in the configuration.
  • Configuring failover to occur automatically upon loss of the primary database, increasing availability without manual intervention.
  • Monitoring the status of the entire configuration, capturing diagnostic information, reporting statistics such as the redo 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 management pages in Oracle Enterprise Manager, which is the broker's graphical user interface (GUI), and the Data Guard command-line interface 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 and Oracle Enterprise Manager. These broker attributes result in the following benefits:
Disaster protection:  By automating many of the manual tasks required to configure and monitor a Data Guard configuration, the broker enhances the high availability, data protection, and disaster protection capabilities that are inherent in Oracle Data Guard. Access is possible through a client to any system in the Data Guard configuration, eliminating any single point of failure. If the primary database fails, the broker automates the process for any one of the standby databases to replace the primary database and take over production processing. The database availability that Data Guard provides makes it easier to protect your data.
Higher availability and scalability with Oracle Real Application Clusters (RAC) Databases: While Oracle Data Guard broker enhances disaster protection by maintaining transactionally consistent copies of the primary database, Data Guard, configured with Oracle high availability solutions such as Oracle Real Application Clusters (RAC) databases, further enhances the availability and scalability of any given copy of that database. The intrasite high availability of an Oracle RAC database complements the intersite protection that is provided by Data Guard broker.
Consider that you have a cluster system hosting a primary Oracle RAC database comprised of multiple instances sharing access to that database. Further consider that an unplanned failure has occurred. From a Data Guard broker perspective, the primary database remains available as long as at least one instance of the clustered database continues to be available for transporting redo data to the standby databases. Oracle Clusterware manages the availability of instances of an Oracle RAC database. Cluster Ready Services (CRS), a subset of Oracle Clusterware, works to rapidly recover failed instances to keep the primary database available. If CRS is unable to recover a failed instance, the broker continues to run automatically with one less instance. If the last instance of the primary database fails, the broker provides a way to fail over to a specified standby database. If the last instance of the primary database fails, and fast-start failover is enabled, the broker can continue to provide high availability by automatically failing over to a pre-determined standby database.
The broker is integrated with CRS so that database role changes occur smoothly and seamlessly. This is especially apparent in the case of a planned role switchover (for example, when a physical standby database is directed to take over the primary role while the former primary database assumes the role of standby). The broker and CRS work together to temporarily suspend service availability on the primary database, accomplish the actual role change for both databases during which CRS works with the broker to properly restart the instances as necessary, and then start services defined on the new primary database. The broker manages the underlying Data Guard configuration and its database roles while CRS manages service availability that depends upon those roles. Applications that rely on CRS for managing service availability will see only a temporary suspension of service as the role change occurs in the Data Guard configuration.
Note that while CRS helps to maintain the availability of the individual instances of an Oracle RAC database, the broker coordinates actions that maintain one or more physical or logical copies of the database across multiple geographically dispersed locations to provide disaster protection. Together, the broker and Oracle Clusterware provide a strong foundation for Oracle's high-availability architecture.
Automated creation of a Data Guard configuration: The broker helps you to logically define and create a Data Guard configuration consisting of a primary database and (physical or logical, snapshot, RAC or non-RAC) standby databases. The broker automatically communicates between the databases in a Data Guard configuration using Oracle Net Services. The databases can be local or remote, connected by a LAN or geographically dispersed over a WAN.
Oracle Enterprise Manager provides a wizard that automates the complex tasks involved in creating a broker configuration, including:
  • Adding an existing standby database, or a new standby database created from existing backups taken through Enterprise Manager
  • Configuring the standby control file, server parameter file, and datafiles
  • Initializing communication with the standby databases
  • Creating standby redo log files
  • Enabling Flashback Database if you plan to use fast-start failover
Although DGMGRL cannot automatically create a new standby database, you can use DGMGRL commands to configure and monitor an existing standby database, including those created using Enterprise Manager.
Easy configuration of additional standby databases: After you create a Data Guard configuration consisting of a primary and a standby database, you can add up to eight new or existing, physical, snapshot, or logical standby databases to each Data Guard configuration. Oracle Enterprise Manager provides an Add Standby Database wizard to guide you through the process of adding more databases. It also makes all Oracle Net Services configuration changes necessary to support redo transport services and log apply services across the configuration.
Simplified, centralized, and extended management: You can issue commands to manage many aspects of the broker configuration. These include:
  • Simplify the management of all components of the configuration, including the primary and standby databases, redo transport services, and log apply services.
  • Coordinate database state transitions and update database properties dynamically with the broker recording the changes in a broker configuration file that includes profiles of all the databases in the configuration. The broker propagates the changes to all databases in the configuration and their server parameter files.
  • Simplify the control of the configuration protection modes (to maximize protection, to maximize availability, or to maximize performance).
  • Invoke the Enterprise Manager verify operation to ensure that redo transport services and log apply services are configured and functioning properly.
Simplified switchover and failover operations: The broker simplifies switchovers and failovers by allowing you to invoke them using a single key click in Oracle Enterprise Manager or a single command at the DGMGRL command-line interface (referred to in this documentation as manual failover). For lights-out administration, you can enable fast-start failover to allow the broker to determine if a failover is necessary and to initiate the failover to a pre-specified target standby database automatically, with no need for DBA intervention. Fast-start failover can be configured to occur with no data loss or with a configurable amount of data loss.
Fast-start failover allows you to increase availability with less need for manual intervention, thereby reducing management costs. Manual failover gives you control over exactly when a failover occurs and to which target standby database. Regardless of the method you choose, the broker coordinates the role transition on all databases in the configuration. Once failover is complete, the broker posts the DB_DOWN event to notify applications that the new primary is available.
Note that you can use the DBMS_DG PL/SQL package to enable an application to initiate a fast-start failover when it encounters specific conditions. SeeSection 4.7.3 for more information.
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. Enterprise Manager enables you to select a new primary database from a set of viable standby databases (enabled and running, with normal status). The DGMGRL SWITCHOVER and FAILOVERcommands only require you to specify the target standby database before automatically initiating and completing the many steps in switchover or failover operations across the multiple databases in the configuration.
Built-in monitoring and alert and control mechanisms: The broker provides built-in validation that monitors the health of all of the databases in the configuration. From any system in the configuration connected to any database, you can capture diagnostic information and detect obvious and subtle problems quickly with centralized monitoring, testing, and performance tools. Both Enterprise Manager and DGMGRL retrieve a complete configuration view of the progress of redo transport services on the primary database and the progress of Redo Apply or SQL Apply on the standby database.
The ability to monitor local and remote databases and respond to events is significantly enhanced by the broker's health check mechanism and tight integration with the Oracle Enterprise Manager event management system.
Transparent to application: Use of the broker is possible for any database because the broker works transparently with applications; no application code changes are required to accommodate a configuration that you manage with the broker.



                                 Relationship of Objects Managed by the Data Guard Broker



Practical Steps to enable the Dataguard Broker:


Primary DB Server:

$ps -ef | grep dmon

$export ORACLE_SID=prime

$sqlplus / as sysdba

sql>alter system set dg_broker_start=true scope=both;

sql>!

$ps -ef | grep dmon



Standby DB Server:

$ps -ef | grep dmon

$export ORACLE_SID=prime

$sqlplus / as sysdba

sql>alter system set dg_broker_start=true scope=both;

sql>!

$ps -ef | grep dmon




Configuring the DGMGRL utility:



==>> GoTo any of the servers and configure it.


Primary DB Server:


$export ORACLE_SID=prime

$dgmgrl

dgmgrl>help



=>> Connect to db using dgmgrl tool

dgmgrl>connect sys/rac@to_prime_DGMGRL




=>> Create a configuration with Primary database using DGMGRL

dgmgrl>create configuration mycon1 as primary database is 'prime' connect identifier is 'to_prime_DGMGRL




=>>Adding Standby databases to the DGMGRL configuration

dgmgrl>add database 'stand' as connect identifier is 'to_stand_DGMGRL' maintained as physical;




dgmgrl>show configuration;

dgmgrl>enable configuration;

dgmgrl>show configuration;




dgmgrl>show database open;

dgmgrl>show database verbose prime;



dgmgrl>show database stand;

dgmgrl>show database verbose prime;



dgmgrl> help connect;

dgmgrl>help create

dgmgrl>help add

dgmgrl>help remove



dgmgrl> remove database 'stand';

dgmgrl>remvoe configuration;







No comments:

Post a Comment