- Deploy a hybrid DR topology for an on-premises database
- Complete the Configuration
Complete the Configuration
Configure Oracle Data Guard, register the standby database, and synchronize the on-premises and standby database passwords.
Configure Oracle Data Guard Broker
Configure Oracle Data Guard by enabling the dg_broker_config_file
parameter on the primary
and standby databases. For Oracle Automatic Storage Management (Oracle ASM), place the broker configuration files on separate disk groups. For Oracle Real Application Clusters (Oracle RAC), broker configuration files must be on shared storage.
- Check the
dg_broker_start
value for the on-premises database host. It should be set to false.SQL> show parameter dg_broker_start;
The output will look similar to the following:NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ dg_broker_start boolean FALSE
- Check the Oracle Data Guard files for the on-premises database.
SQL> show parameter dg_broker_config_file1; SQL> show parameter dg_broker_config_file2;
- If you have Oracle RAC or Oracle ASM, then you can change the configuration file
location.
SQL> alter system set dg_broker_config_file1=broker_config_file location; SQL> alter system set dg_broker_config_file2=broker_config_file location;
- Start the Oracle Data Guard Broker process on the primary database.
SQL> alter system set dg_broker_start=true; SQL> show parameter dg_broker_start
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ dg_broker_start boolean TRUE
SQL> select pname from v$process where pname like 'DMON%';
PNAME ----- DMON
- Check the
dg_broker_start
value for the standby database host. It should be set tofalse
.SQL> show parameter dg_broker_start;
The output will look similar to the following:NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ dg_broker_start boolean FALSE
- Check the Oracle Data Guard files on the standby database.
SQL> show parameter dg_broker_config_file1; SQL> show parameter dg_broker_config_file2;
- If you have Oracle RAC or Oracle ASM, then you can change the configuration file
location.
SQL> alter system set dg_broker_config_file1=broker_config_file location; SQL> alter system set dg_broker_config_file2=broker_config_file location;
- Start the Oracle Data Guard Broker process on the standby database.
SQL> alter system set dg_broker_start=true; SQL> show parameter dg_broker_start
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ dg_broker_start boolean TRUE
SQL> select pname from v$process where pname like 'DMON%';
PNAME ----- DMON
Register the Standby Database
Use the Oracle Data Guard command-line interface (DGMGRL) to register, or add, the standby database profile to the broker configuration on the primary, on-premises host.
- Log into the primary host as
sys
.$ dgmgrl sys/sys password@net service name for primary database
- Create a configuration that uses the primary database name.
DGMGRL> CREATE CONFIGURATION configuration_name AS PRIMARY DATABASE IS primary database name CONNECT IDENTIFIER IS primary database name;
- Add the standby database.
DGMGRL> ADD DATABASE standby unique database name AS CONNECT IDENTIFIER IS standby unique database name MAINTAINED AS PHYSICAL;
- Enable the configuration.
DGMGRL> enable configuration;
- Display the configuration.
DGMGRL> show configuration;
The output will look similar to the following:Configuration - OnPremDr Protection Mode: MaxPerformance Members: ORCLCDB - Primary database Warning: ORA-16789: standby redo logs configured incorrectly orclcdb_iad1s3 - Physical standby database Error: ORA-16810: multiple errors or warnings detected for the member Fast-Start Failover: Disabled Configuration Status: ERROR (status updated 10 seconds ago)
Copy the Redo Log Files from On-Premises to OCI
Copy the redo
log files and other database files from the
on-premises database onto the Oracle Cloud
Infrastructure (OCI) instance.
- View the on-premises database files.
select name from v$datafile;
The output will look similar to the following:NAME -------------------------------------------------------------------- /opt/oracle/oradata/ORCLCDB/system01.dbf /opt/oracle/oradata/ORCLCDB/sysaux01.dbf /opt/oracle/oradata/ORCLCDB/undotbs01.dbf /opt/oracle/oradata/ORCLCDB/pdbseed/system01.dbf /opt/oracle/oradata/ORCLCDB/pdbseed/sysaux01.dbf /opt/oracle/oradata/ORCLCDB/users01.dbf /opt/oracle/oradata/ORCLCDB/pdbseed/undotbs01.dbf /opt/oracle/oradata/ORCLCDB/ORCLPDB1/system01.dbf /opt/oracle/oradata/ORCLCDB/ORCLPDB1/sysaux01.dbf /opt/oracle/oradata/ORCLCDB/ORCLPDB1/undotbs01.dbf /opt/oracle/oradata/ORCLCDB/ORCLPDB1/users01.dbf
- View the size of each group for the on-premises data
files.
select bytes, group# from v$log;
The output will look similar to the following:BYTES GROUP# ---------- ---------- 209715200 1 209715200 2 209715200 3
- View the
redo
logs for the on-premises data files.select member from v$logfile;
The output will look similar to the following:MEMBER --------------------------------------------------- /opt/oracle/oradata/ORCLCDB/redo03.log /opt/oracle/oradata/ORCLCDB/redo02.log /opt/oracle/oradata/ORCLCDB/redo01.log
- Add a standby log file group for each
redo
log.For example, if you have threeredo
log files, add three standby log file groups.SQL> alter database add standby logfile group 4('/opt/oracle/oradata/ORCLCDB/redo_sb04.log') size 209715200; Database altered. SQL> alter database add standby logfile group 5('/opt/oracle/oradata/ORCLCDB/redo_sb05.log') size 209715200; Database altered. SQL> alter database add standby logfile group 6('/opt/oracle/oradata/ORCLCDB/redo_sb06.log') size 209715200; Database altered.
- View the group number and members of the log file.
SQL> select group#,member from v$logfile;
The output will look similar to the following:GROUP# MEMBER -------------------------------------------------------------------- 3 /opt/oracle/oradata/ORCLCDB/redo03.log 2 /opt/oracle/oradata/ORCLCDB/redo02.log 1 /opt/oracle/oradata/ORCLCDB/redo01.log 4 /opt/oracle/oradata/ORCLCDB/redo_sb04.log 5 /opt/oracle/oradata/ORCLCDB/redo_sb05.log 6 /opt/oracle/oradata/ORCLCDB/redo_sb06.log 6 rows selected.
- View the configuration in Oracle Data Guard.
DGMGRL> show configuration
The output will look similar to the following:Configuration - OnPremDr Protection Mode: MaxPerformance Members: ORCLCDB - Primary database orclcdb_iad1s3 - Physical standby database Fast-Start Failover: Disabled Configuration Status: SUCCESS (status updated 60 seconds ago)
- View the redo logs on the standby OCI database instance.
select member from v$logfile;
The output will look similar to the following:MEMBER --------------------------------------------------- /opt/oracle/oradata/ORCLCDB/redo03.log /opt/oracle/oradata/ORCLCDB/redo02.log /opt/oracle/oradata/ORCLCDB/redo01.log
- Log into an Oracle Data Guard command-line interface (DGMGRL)
session on the standby OCI database instance with the
sys
user name and password.[oracle@droci admin]$ dgmgrl DGMGRL> connect Username: sys Password:
The output will look similar to the following:. . . Welcome to DGMGRL, type "help" for information. Connected to "ORCLCDB_iad1s3" Connected as SYSDBA.
- View the configuration on the standby database in OCI.
DGMGRL> show configuration;
The output will look similar to the following:Configuration - OnPremDr Protection Mode: MaxPerformance Members: ORCLCDB - Primary database orclcdb_iad1s3 - Physical standby database Warning: ORA-16809: multiple warnings detected for the member Fast-Start Failover: Disabled Configuration Status: WARNING (status updated 50 seconds ago)
- Edit the standby database instance in OCI and set the state to
apply-off
, then exit the command-line interface.DGMGRL> edit database orclcdb_iad1s3 set state=apply-off;
Succeeded.
DGMGRL> exit
- Log into the standby database instance in OCI.
[oracle@droci admin]$ sqlplus / as sysdba
- View the group number and members of the log file.
SQL> select group#,member from v$logfile;
The output will look similar to the following:GROUP# MEMBER -------------------------------------------------------------------- 3 /opt/oracle/oradata/ORCLCDB/redo03.log 2 /opt/oracle/oradata/ORCLCDB/redo02.log 1 /opt/oracle/oradata/ORCLCDB/redo01.log
- View the size of each group.
select bytes, group# from v$log;
The output will look similar to the following:BYTES GROUP# ---------- ---------- 209715200 1 209715200 3 209715200 2
- Add the standby log file groups to the database in OCI.
SQL> alter database add standby logfile group 4('/opt/oracle/oradata/ORCLCDB/redo_sb04.log') size 209715200; Database altered. SQL> alter database add standby logfile group 5('/opt/oracle/oradata/ORCLCDB/redo_sb05.log') size 209715200; Database altered. SQL> alter database add standby logfile group 6('/opt/oracle/oradata/ORCLCDB/redo_sb06.log') size 209715200; Database altered.
- View the group number and members of the log file.
SQL> select group#,member from v$logfile;
The output will look similar to the following:GROUP# MEMBER -------------------------------------------------------------------- 3 /opt/oracle/oradata/ORCLCDB/redo03.log 2 /opt/oracle/oradata/ORCLCDB/redo02.log 1 /opt/oracle/oradata/ORCLCDB/redo01.log 4 /opt/oracle/oradata/ORCLCDB/redo_sb04.log 5 /opt/oracle/oradata/ORCLCDB/redo_sb05.log 6 /opt/oracle/oradata/ORCLCDB/redo_sb06.log 6 rows selected.
- Log into an Oracle Data Guard command-line interface (DGMGRL)
session on the standby OCI database instance with the
sys
user name and password.[oracle@droci admin]$ dgmgrl DGMGRL> connect Username: sys Password:
. . . Welcome to DGMGRL, type "help" for information. Connected to "ORCLCDB_iad1s3" Connected as SYSDBA.
- Edit the standby database instance in OCI and set the state to
apply-on
.DGMGRL> edit database orclcdb_iad1s3 set state=apply-on;
- Edit the standby database instance in OCI and set the transport
state to
transport-on
, then exit the command-line interface.DGMGRL> edit database orclcdb_iad1s3 set state=transport-on;
Succeeded.
DGMGRL> exit
- View the standby log files in the standby database on
OCI.
SQL> select * from v$logfile where type='STANDBY';
The output will look similar to the following:GROUP# STATUS TYPE ---------- ------- ------- MEMBER -------------------------------------------------------------------- IS_ CON_ID --- ---------- 4 STANDBY /opt/oracle/oradata/ORCLCDB/redo_sb04.log NO 0 5 STANDBY /opt/oracle/oradata/ORCLCDB/redo_sb05.log NO 0 6 STANDBY /opt/oracle/oradata/ORCLCDB/redo_sb06.log NO 0
- View the redo log files in the standby database on OCI.
SQL> select member from v$logfile where type != 'STANDBY';
The output will look similar to the following:MEMBER -------------------------------------------------------------------- /opt/oracle/oradata/ORCLCDB/redo03.log /opt/oracle/oradata/ORCLCDB/redo02.log /opt/oracle/oradata/ORCLCDB/redo01.log
- Recover the managed standby database.
SQL> recover managed standby database cancel;
The output will look similar to the following:Media recovery complete
- View the files with the
convert
parameter.SQL> show parameter convert;
The output will look similar to the following:NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_file_name_convert string log_file_name_convert string pdb_file_name_convert string
- View the database files.
select name from v$datafile;
The output will look similar to the following:NAME -------------------------------------------------------------------- /opt/oracle/oradata/ORCLCDB/system01.dbf /opt/oracle/oradata/ORCLCDB/sysaux01.dbf /opt/oracle/oradata/ORCLCDB/undotbs01.dbf /opt/oracle/oradata/ORCLCDB/pdbseed/system01.dbf /opt/oracle/oradata/ORCLCDB/pdbseed/sysaux01.dbf /opt/oracle/oradata/ORCLCDB/users01.dbf /opt/oracle/oradata/ORCLCDB/pdbseed/undotbs01.dbf /opt/oracle/oradata/ORCLCDB/ORCLPDB1/system01.dbf /opt/oracle/oradata/ORCLCDB/ORCLPDB1/sysaux01.dbf /opt/oracle/oradata/ORCLCDB/ORCLPDB1/undotbs01.dbf /opt/oracle/oradata/ORCLCDB/ORCLPDB1/users01.dbf
- View the database system change number (SCN).
SQL> select current_scn from v$database;
The output will look similar to the following:CURRENT_SCN ----------- 2906060
- View the Oracle Data Guard archive details.
SQL> SELECT ROLE, THREAD#, SEQUENCE#, ACTION FROM V$DATAGUARD_PROCESS;
The output will look similar to the following:ROLE THREAD# SEQUENCE# ACTION ------------------------ ---------- ---------- ------------ RFS archive 0 0 IDLE RFS archive 0 0 IDLE RFS async 1 18 RECEIVING RFS ping 1 18 IDLE broker monitor 0 0 IDLE broker instance slave 0 0 IDLE archive redo 0 0 IDLE archive local 0 0 IDLE redo transport timer 0 0 IDLE gap manager 0 0 IDLE log writer 0 0 IDLE broker net slave 0 0 IDLE broker worker 0 0 IDLE archive redo 0 0 IDLE archive redo 0 0 IDLE redo transport monitor 0 0 IDLE 16 rows selected.
- Disable the recovery of the managed standby database using the
log file.
SQL> recover managed standby database using current logfile disconnect;
Media recovery complete.
- View the database system change number (SCN).
SQL> select current_scn from v$database;
The output will look similar to the following:CURRENT_SCN ----------- 2906060
- Display the files with the destination parameter.
SQL>show parameter dest;
The output will look similar to the following:NAME TYPE VALUE ------------------------------------ ----------- ------------------- cursor_bind_capture_destination string memory+disk db_create_online_log_dest_1 string /u03/app/oracle/redo/ db_create_online_log_dest_2 string db_create_online_log_dest_3 string db_create_online_log_dest_4 string db_create_online_log_dest_5 string db_recovery_file_dest_size big integer 238G log_archive_dest_1 string log_archive_dest_10 string log_archive_dest_11 string log_archive_dest_12 string
- Display the comments from the recovery.
SQL> select comments from v$recovery_progress;
The output will look similar to the following:COMMENTS -------------------------------------------------------------------- RCVID: 4165711446800375620 SCN: 2907015 COMMENTS -------------------------------------------------------------------- RCVID: 12395680609799335065 SCN: 2906061
- View the recovery date.
SQL> select START_TIME,comments from v$recovery_progress order by 1;
The output will look similar to the following:START_TIM --------- COMMENTS -------------------------------------------------------------------- 03-SEP-20 03-SEP-20 03-SEP-20 RCVID: 2657984638848411078 START_TIM --------- COMMENTS -------------------------------------------------------------------------------- 03-SEP-20