7.1 Prerequisites for Getting StartedOne of the prerequisites for using DGMGRL is that a primary database and any standby databases must already exist. The DGBROKERSTART initialization parameter must be set to TRUE for all databases in the configuration. You must use a server parameter file with the broker (see and ).Convert the initialization parameter files (PFILE) on both primary and standby databases into server parameter files (SPFILE), if necessary. Use the following SQL.Plus command:CREATE SPFILE FROM PFILE=' pfilename';If an instance was not started with a server parameter file, then you must shut down the instance and restart it using the server parameter file.After starting the Oracle instance, set the DGBROKERSTART=TRUE initialization parameter using the SQL ALTER SYSTEM statement. The parameter value will be saved in the server parameter file. The next time you start the Oracle instance, the broker is started automatically, and you do not need to issue the SQL ALTER SYSTEM statement again. 7.2 Scenario 1: Creating a ConfigurationThis section provides examples that create a broker configuration named DRSolution that includes a primary and standby database named NorthSales and DRSales.The following steps show how to create a configuration and add one physical standby database.Step 1 Invoke DGMGRL.To start DGMGRL, enter dgmgrl at the command-line prompt on a system where Oracle Data Guard is installed:$ dgmgrlDGMGRL for Linux: Version 11.1.0.7.0 - ProductionCopyright (c) 2000, 2005, Oracle.
![Fast Start Failover Auto Reinstate Fast Start Failover Auto Reinstate](http://3.bp.blogspot.com/-9LdTu0-I7SU/W74l-oxcoRI/AAAAAAAAGsg/c9tZq1uROSoIs-HlScsciHyVKyj-uLE9wCK4BGAYYCw/s1600/Screen%2BShot%2B2018-10-09%2Bat%2B7.30.59%2BAM.png)
Start the observer. When starting the old primary ( prmydb), the observer automatically reinstates it and changes its role to be a fully functional standby.
All rights reserved.Welcome to DGMGRL, type 'help' for information.DGMGRLStep 2 Connect to the primary database.Before you specify any command (other than the HELP, EXIT, or QUIT), you must first connect to the primary database using the DGMGRL CONNECT command.The account from which you connect to the database ( SYS in this example) must have SYSDBA privileges on the primary and standby databases. Note:The names for the primary and standby databases must match their database unique names. 7.3 Scenario 2: Setting Database PropertiesAfter you create the configuration with DGMGRL, you can set database properties at any time.
![Fast start failover auto reinstatement Fast start failover auto reinstatement](/uploads/1/2/5/5/125542900/928992401.jpg)
For example, the following statements set the LogArchiveFormat and StandbyArchiveLocation configurable database properties for the DRSales standby database:DGMGRL EDIT DATABASE 'DRSales' SET PROPERTY 'LogArchiveFormat'='log%t%s%r%d.arc';Property 'LogArchiveFormat' updated.DGMGRL EDIT DATABASE 'DRSales' SET PROPERTY 'StandbyArchiveLocation'='/archfs/arch/';Property 'StandbyArchiveLocation' updated.Use the SHOW DATABASE VERBOSE command to view all properties and their values for a database. Note:The database properties are typically displayed in mixed-case (for example, LogArchiveFormat) typeface to help you visually differentiate database properties (from the corresponding initialization parameter, SQL statement, or PL/SQL procedure), which are typically documented in UPPERCASE typeface. However, the commands to manage properties are not case sensitive; you can issue commands in uppercase, lowercase, or mixed-case.You can change a property if the database is enabled or disabled.
However, if the database is disabled when you change a property, the change does not take effect until the database is enabled. 7.4 Scenario 3: Enabling the Configuration and DatabasesSo far, the DRSolution configuration is disabled, which means it is not under the control of the Data Guard broker. Note:If the protection mode to be set is maximum protection mode, the broker automatically restarts the primary database.This scenario sets the protection mode of the configuration to the MAXAVAILABILITY mode.
7.6 Scenario 5: Enabling Fast-Start Failover and Starting the ObserverYou can enable fast-start failover from any site, including the observer site, while connected to any database in the broker configuration. Enabling fast-start failover does not trigger a failover. Instead, it allows the observer to begin observing the primary and standby databases and initiate a fast-start failover should conditions warrant a failover.This section describes the steps to enable fast-start failover and start the observer where the configuration property mode is to be set to:.Step 1 Ensure standby redo logs are configured on the primary and target standby databases.Standby redo logs must be configured on the primary and standby databases. You must stop log apply services prior to configuring standby redo logs. See Also: for instructions on configuring standby redo log filesStep 2 Ensure the LogXptMode Property is set to SYNC.The LogXptMode configurable database property must be set to SYNC on the primary and target standby databases.To set the redo transport service that corresponds to the protection mode you plan to set, use the EDIT DATABASE (property) command on the primary and target standby databases. 7.7.2 Disabling the Configuration and DatabasesWhen you disable the broker configuration or any of its databases, you are disabling the broker's management of those objects and are effectively removing your ability to use DGMGRL to manage and monitor the disabled object. However, disabling the broker's management of a broker configuration does not affect the actual operation of the underlying Data Guard configuration or the databases.
For example, the redo transport services and log apply services in the Data Guard configuration continue to function unchanged, but you can no longer manage them. 7.7.3 Removing the Configuration or a Standby DatabaseWhen you use either the REMOVE CONFIGURATION or REMOVE DATABASE command, you effectively delete the configuration or standby database profile from the broker configuration file, removing the ability of the Data Guard broker to manage the configuration or the standby database, respectively.A remove operation with the PRESERVE DESTINATIONS clause does not remove or delete the actual Data Guard configuration underneath, nor does it affect the operation of the actual Data Guard configuration and its databases. 7.8 Scenario 7: Performing a Switchover OperationYou can switch the role of the primary database and a standby database using the SWITCHOVER command. Note:If fast-start failover is enabled, you can perform a manual failover only to the standby database that was specified as the target of a fast-start failover and only when the observer is running.If you want to perform a manual failover to a standby database that is not the fast-start failover target standby database, you must first disable fast-start failover using the FORCE option on the standby database you want to fail over. See for more information about the FORCE option.Step 1 Connect to the target standby database.To perform the failover operation, you must connect to the standby database to which you want to fail over to as a user that has the SYSDBA privilege.
For example:DGMGRL CONNECT [email protected];Password: passwordConnected.Step 2 Issue the failover command.Now you can issue the failover command to make the target standby database the new primary database for the configuration. 7.10 Scenario 9: Reinstating a Failed Primary DatabaseIf your primary database had been configured with Flashback Database, you can easily reinstate the failed primary database as a standby database of the new primary database. The failed primary database will be reinstated as a standby type that matches the old standby database. For example, if you failed over to a physical standby database, the old primary will be reinstated as a physical standby database.To reinstate the failed primary database, start it to the mounted state. 7.11 Scenario 10: Converting a Physical Standby to a Snapshot StandbyIf you have a physical standby database that you would like to convert to a snapshot standby database, use the DGMGRL CONVERT DATABASE command. Redo data will continue to be received by the database while it is operating as a snapshot standby database, but it will not be applied until the snapshot standby is converted back into a physical standby database.Note that the Flashback Database feature is required to create a snapshot standby database.
If Flashback database is disabled, it is automatically enabled during conversion to a snapshot standby database. The broker automatically restarts the database to the mounted state if it had been opened with Flashback Database disabled. No user action is required.DGMGRL CONVERT DATABASE 'DRSales' to SNAPSHOT STANDBY;Converting database 'DRSales' to a Snapshot Standby database, please wait.Database 'DRSales' converted successfullyDGMGRL SHOW CONFIGURATION;ConfigurationName: DRSolutionEnabled: YESProtection Mode: MaxPerformanceDatabases:NorthSales - Primary databaseDRSales - Snapshot standby databaseFast-Start Failover: DISABLEDCurrent status for 'DRSolution':SUCCESSWhen you are ready to revert the database back to a physical standby database, use the DGMGRL CONVERT DATABASE command again as follows.
Any updates made to the database while it was operating as a snapshot standby database will be discarded. 7.12 Scenario 11: Monitoring a Data Guard ConfigurationThe scenario in this section demonstrates how to use the SHOW command and monitorable database properties to identify and resolve a failure situation.Step 1 Check the configuration status.The status of the broker configuration is an aggregated status of all databases and instances in the broker configuration.
You can check the configuration status first to determine whether or not any further action needs to be taken. If the configuration status is SUCCESS, everything in the broker configuration is working fine.