Scenario 1: Creating a Configuration

These examples create a broker configuration named DRSolution that includes a primary and standby database named North_Sales and South_Sales.

To create a configuration and add one physical standby database, perform the following tasks:

Creating a Configuration Task 1: Invoke DGMGRL

To start DGMGRL, enter dgmgrl at the command-line prompt on a system where Oracle Data Guard is installed.

$ dgmgrl

The DGMGRL prompt is displayed:

DGMGRL>

Creating a Configuration Task 2: Connect to the Primary Database

Before executing any command (other than HELP, EXIT, or QUIT) first connect to the primary database using the DGMGRL CONNECT command. The account used to connect to the primary database must have SYSDG or SYSDBA privileges. A connection to a local database using OS authentication is possible but not recommended because broker operations that also require connections to configuration members on remote hosts will fail.

Note:

If no AS clause is specified on the CONNECT command, the connection is made as SYSDBA.

The following example uses the tns alias north_sales to connect to primary database North_Sales using the SYS user. DGMGRL prompts for a password if, as in the example, it is not included as part of the command line:

DGMGRL> CONNECT sys@north_sales
Password: password
Connected to "North_Sales"
Connected as SYSDBA.

Note:

SYSDG as a user has been removed for Oracle AI Database 26ai. However, the SYSDG role remains the same as in earlier releases. If no AS clause is specified for the CONNECT command, the connection is first attempted AS SYSDG and then AS SYSDBA before returning an error if still unsuccessful.

Creating a Configuration Task 3: Clear Existing Remote Redo Transport Destinations on Standbys and Far Sync Instances To Be Added.

You must clear any remote redo transport destinations on standby databases and far sync instances before those standbys and far syncs can be added to a configuration.

If the remote redo transport destinations are not cleared, then the following error message is returned when you attempt to create the configuration:

ORA-16698: LOG_ARCHIVE_DEST_n parameter set for object to be added
 
Failed.

To clear LOG_ARCHIVE_DEST_n settings, use the ALTER SYSTEM SET LOG_ARCHIVE_DEST_n=" " SQL*Plus command.

Remote redo transport destinations on the primary (whether they have the REGISTER or NOREGISTER attribute) can be left as is.

Creating a Configuration Task 4: Create the Broker Configuration

A broker configuration is initially created with just a primary database.

In this case, the primary is called North_Sales. In a later command, you will add the standby database, South_Sales.

Note:

The names for the primary and standby databases must match their database unique names. Fetch these from their DB_UNIQUE_NAME initialization parameter as follows:

SQL> SHOW PARAMETER DB_UNIQUE_NAME;

Use the CREATE CONFIGURATION command to create the DRSolution configuration containing primary database North_Sales. The name North_Sales is the value of the primary database’s DB_UNIQUE_NAME initialization parameter and north_sales is a tns alias that resolves to a connect identifier for the primary database on all systems hosting members of the configuration.:

DGMGRL> CREATE CONFIGURATION 'DRSolution' AS
> PRIMARY DATABASE IS 'North_Sales'
> CONNECT IDENTIFIER IS north_sales;
Connected to "North_Sales"
Configuration "DRSolution" created with primary database "North_Sales"

The name North_Sales is the value of this database's DB_UNIQUE_NAME initialization parameter.

Creating a Configuration Task 5: Show the Configuration Information

Use the SHOW CONFIGURATION command to display a summary of the current state of the configuration:

DGMGRL> SHOW CONFIGURATION;

DGMGRL returns the following information:

Configuration - DRSolution

  Protection Mode: MaxPerformance
  Members:
  North_Sales - Primary database

Fast-Start Failover:  Disabled

Configuration Status:
DISABLED

Creating a Configuration Task 6: Add a Standby Database to the Configuration

To add a standby database to the DRSolution configuration, use the ADD DATABASE command.

Use the ADD DATABASE command to add standby database South_Sales associated with primary database North_Sales to the configuration. The name South_Sales is the value of the standby database’s DB_UNIQUE_NAME initialization parameter and south_sales is a tns alias that resolves to a connect identifier for the standby database on all systems hosting members of the configuration.:

DGMGRL> ADD DATABASE 'South_Sales' AS
> CONNECT IDENTIFIER IS south_sales; 
Database "South_Sales" added

Use the SHOW CONFIGURATION to show the updated configuration state:

DGMGRL> SHOW CONFIGURATION;

DGMGRL returns the following information:

Configuration - DRSolution

  Protection Mode: MaxPerformance
  Members:
  North_Sales - Primary database
    South_Sales - Physical standby database 

Fast-Start Failover:  Disabled

Configuration Status:
DISABLED