Scenario 1: Prepare the Databases
Most of the usual Data Guard preparation steps apply when setting up a DG PDB environment. Notable differences are that standby redo logfiles (SRLs) are added later at the PDB level after the Data Guard DG PDB configuration has been created (instead of beforehand at the CDB level) and that CDB-level file name conversion initialization parameters are not used for DG PDB configurations.
For the source and target databases, use SQL*Plus to connect AS
SYSDBA
and perform the following actions (if they have not been
already) to support future PDB-level role transitions:
SQL> ALTER DATABASE FORCE LOGGING;
Database altered.
Enable
flashback database.
SQL> ALTER DATABASE FLASHBACK ON;
Database altered.
If
necessary, update the initialization parameters in the server parameter files for
each database. The CDB-level file name conversion initialization parameters
db_file_name_convert
and log_file_name_convert
are not used for DG PDB configurations, but the dg_broker_start
,
log_archive_dest_1
, and
standby_file_management
parameters should be set to the values
as show in the table below. In addition, if multi-instance databases are used, the
dg_broker_config_file1
and
dg_broker_config_file2
initialization parameters must be
updated to specify locations accessible by all instances. Because the source and
target container databases do not share the same db_name
value,
including the db_unique_name
parameter in the spfile is optional
for DG PDB configurations.
Configure the following initialization parameters on the source database
(using scope=both
):
dg_broker_start |
TRUE |
log_archive_dest_1 |
LOCATION=USE_DB_RECOVERY_FILE_DEST
VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
DB_UNIQUE_NAME=boston |
standby_file_management |
AUTO |
Configure the following initialization parameters on the target database:
dg_broker_start |
TRUE |
log_archive_dest_1 |
LOCATION=USE_DB_RECOVERY_FILE_DEST
VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
DB_UNIQUE_NAME=newyork |
standby_file_management |
AUTO |
DGMGRL must connect to the source and target container databases using an account with SYSDBA privileges to create and manage a DG PDB configuration. For the scenarios, the existing SYS user for each database will be used for this purpose. Optionally, a separate user can be created on each database and granted SYSDBA privileges. Note that because the source and target databases are not copies of each other, the passwords for the management accounts do not need to match on the source and target databases and the password file from the source database does not need to be copied to the target database as is required for CDB-level Data Guard protection.