19c Container Database Data Guard Configuration
Purpose
This note outlines the steps to create an Oracle 19c Container Database via DBCA and then use the RMAN DUPLICATE command to create a physical
standby Container Database.
Data Guard Broker configuration steps are also shown in the note.
Environment
Primary database host: db22
Standby database host: db21
Primary CDB ORACLE_SID: crsacdb
Standby CDB ORACLE_SID: crsacdb
Primary CDB DB_UNIQUE_NAME: crsacdb
Standby CDB DB_UNIQUE_NAME: crsacdb_s
Data file location for Primary and Standby database is the same
Primary and Standby Listener: LISTENER_CRS on port 1512
Create the Primary CDB via DBCA
oracle@db22:~$ cd $ORACLE_HOME/bin
oracle@db22:/opt/oracle/product/19.0.0/dbhome_1/bin$ ./dbca
Oracle 19c Container Database Data Guard Configuration 1
Oracle 19c Container Database Data Guard Configuration 2
Oracle 19c Container Database Data Guard Configuration 3
Oracle 19c Container Database Data Guard Configuration 4
Oracle 19c Container Database Data Guard Configuration 5
Oracle 19c Container Database Data Guard Configuration 6
Oracle 19c Container Database Data Guard Configuration 7
Oracle 19c Container Database Data Guard Configuration 8
Oracle 19c Container Database Data Guard Configuration 9
Oracle 19c Container Database Data Guard Configuration 10
Oracle 19c Container Database Data Guard Configuration 11
Oracle 19c Container Database Data Guard Configuration 12
Oracle 19c Container Database Data Guard Configuration 13
Oracle 19c Container Database Data Guard Configuration 14
Oracle 19c Container Database Data Guard Configuration 15
Oracle 19c Container Database Data Guard Configuration 16
Oracle 19c Container Database Data Guard Configuration 17
Oracle 19c Container Database Data Guard Configuration 18
Oracle 19c Container Database Data Guard Configuration 19
Oracle 19c Container Database Data Guard Configuration 20
Oracle 19c Container Database Data Guard Configuration 21
Create PFILE
oracle@db22:/opt/oracle/product/19.0.0/dbhome_1/bin$ sqlplus sys as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jun 8 10:01:12 2020
Version 19.7.0.0.0
Copyright (c) 1982, 2020, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.7.0.0.0
SQL> create pfile from spfile;
File created.
Copy password file and init.ora to standby server
oracle@db22:/opt/oracle/product/19.0.0/dbhome_1/dbs$ scp -rp orapwcrsacdb oracle@db21:/opt/oracle/product/19.0.0/dbhome_1/dbs
Password:
orapwcrsacdb 100% 2048 2.2MB/s 00:00
oracle@db22:/opt/oracle/product/19.0.0/dbhome_1/dbs$ scp -rp initcrsacdb.ora oracle@db21:/opt/oracle/product/19.0.0/dbhome_1/dbs
Password:
initcrsacdb.ora
Configure Standby Listener
oracle@db21:/opt/oracle/product/19.0.0/dbhome_1/network/admin$ vi listener.ora
Oracle 19c Container Database Data Guard Configuration 22
LISTENER_CRS =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = db21)(PORT = 1512))
)
)
SID_LIST_LISTENER_CRS =
(SID_LIST =
(SID_DESC =
(SID_NAME = crsacdb)
(ORACLE_HOME = /opt/oracle/product/19.0.0/dbhome_1)
(GLOBAL_DBNAME = crsacdb_s.intranet)
)
)
oracle@db21:/opt/oracle/product/19.0.0/dbhome_1/network/admin$ lsnrctl start listener_crs
LSNRCTL for Solaris: Version 19.0.0.0.0 - Production on 08-JUN-2020 10:09:19
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Starting /opt/oracle/product/19.0.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Solaris: Version 19.0.0.0.0 - Production
System parameter file is /opt/oracle/product/19.0.0/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/db21/listener_crs/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db21)(PORT=1512)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db21)(PORT=1512)))
STATUS of the LISTENER
------------------------
Oracle 19c Container Database Data Guard Configuration 23
Alias listener_crs
Version TNSLSNR for Solaris: Version 19.0.0.0.0 - Production
Start Date 08-JUN-2020 10:09:19
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/19.0.0/dbhome_1/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/db21/listener_crs/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db21)(PORT=1512)))
Services Summary...
Service "crsacdb_s.intranet" has 1 instance(s).
Instance "crsacdb", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
Add entries to tnsnames.ora (on BOTH primary and standby database servers)
CRSACDB.INTRANET =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = db22.intranet)(PORT = 1512) (SEND_BUF_SIZE = 10485760) (RECV_BUF_SIZE = 10485760))
)
(SDU = 65535)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = CRSACDB.intranet)
)
)
Oracle 19c Container Database Data Guard Configuration 24
CRSACDB_S.INTRANET =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = db21.intranet)(PORT = 1512) (SEND_BUF_SIZE = 10485760) (RECV_BUF_SIZE = 10485760))
)
(SDU = 65535)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = CRSACDB_S.intranet)
)
)
Update Standby Database init.ora with DB_UNIQUE_NAME
oracle@db21:/opt/oracle/product/19.0.0/dbhome_1/dbs$ vi initcrsacdb.ora
*.db_unique_name='crsacdb_s'
Create required directories on standby server
oracle@db21:/opt/oracle/product/19.0.0/dbhome_1/dbs$ mkdir -p /opt/oracle/admin/crsacdb/adump
Start the standby database instance
oracle@db21:/opt/oracle/product/19.0.0/dbhome_1/dbs$ export ORACLE_SID=crsacdb
oracle@db21:/opt/oracle/product/19.0.0/dbhome_1/dbs$ sqlplus sys as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jun 8 10:28:21 2020
Version 19.6.0.0.0
Oracle 19c Container Database Data Guard Configuration 25
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Enter password:
Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 2147482416 bytes
Fixed Size 9116464 bytes
Variable Size 654311424 bytes
Database Buffers 1476395008 bytes
Redo Buffers 7659520 bytes
Create Standby Database via RMAN DUPLICATE command
oracle@db21:/opt/oracle/product/19.0.0/dbhome_1/dbs$ rman target sys/Dreamliner787##@crsacdb auxiliary sys/Dreamliner787##@crsacdb_s
Recovery Manager: Release 19.0.0.0.0 - Production on Mon Jun 8 10:29:35 2020
Version 19.6.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: CRSACDB (DBID=2345870114)
connected to auxiliary database: CRSACDB (not mounted)
RMAN> run {
allocate channel c1 type disk;
allocate channel c2 type disk;
Oracle 19c Container Database Data Guard Configuration 26
allocate auxiliary channel c3 type disk;
allocate auxiliary channel c4 type disk;
allocate auxiliary channel c5 type disk;
allocate auxiliary channel c6 type disk;
duplicate target database for standby from active database nofilenamecheck dorecover;
}
using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=1219 device type=DISK
allocated channel: c2
channel c2: SID=1462 device type=DISK
allocated channel: c3
channel c3: SID=3 device type=DISK
allocated channel: c4
channel c4: SID=246 device type=DISK
allocated channel: c5
channel c5: SID=489 device type=DISK
allocated channel: c6
channel c6: SID=731 device type=DISK
Starting Duplicate Db at 08-JUN-20
current log archived
contents of Memory Script:
{
backup as copy reuse
passwordfile auxiliary format '/opt/oracle/product/19.0.0/dbhome_1/dbs/orapwcrsacdb' ;
Oracle 19c Container Database Data Guard Configuration 27
}
executing Memory Script
Starting backup at 08-JUN-20
Finished backup at 08-JUN-20
duplicating Online logs to Oracle Managed File (OMF) location
contents of Memory Script:
{
restore clone from service 'crsacdb' standby controlfile;
}
executing Memory Script
Starting restore at 08-JUN-20
channel c3: starting datafile backup set restore
channel c3: using network backup set from service crsacdb
channel c3: restoring control file
channel c3: restore complete, elapsed time: 00:00:01
output file name=/d_data/acpt/CRSACDB/control01.ctl
output file name=/d_fra/acpt/CRSACDB/control02.ctl
Finished restore at 08-JUN-20
contents of Memory Script:
{
sql clone 'alter database mount standby database';
}
executing Memory Script
sql statement: alter database mount standby database
RMAN-05158: WARNING: auxiliary (datafile) file name /d_data/acpt/CRSACDB/system01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /d_data/acpt/CRSACDB/sysaux01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /d_data/acpt/CRSACDB/undotbs01.dbf conflicts with a file used by the target database
Oracle 19c Container Database Data Guard Configuration 28
RMAN-05158: WARNING: auxiliary (datafile) file name /d_data/acpt/CRSACDB/pdbseed/system01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /d_data/acpt/CRSACDB/pdbseed/sysaux01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /d_data/acpt/CRSACDB/users01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /d_data/acpt/CRSACDB/pdbseed/undotbs01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (tempfile) file name /d_data/acpt/CRSACDB/temp01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (tempfile) file name /d_data/acpt/CRSACDB/pdbseed/temp012020-06-08_09-39-23-298-AM.dbf conflicts with a file
used by the target database
contents of Memory Script:
{
set newname for tempfile 1 to
"/d_data/acpt/CRSACDB/temp01.dbf";
set newname for tempfile 2 to
"/d_data/acpt/CRSACDB/pdbseed/temp012020-06-08_09-39-23-298-AM.dbf";
switch clone tempfile all;
set newname for datafile 1 to
"/d_data/acpt/CRSACDB/system01.dbf";
set newname for datafile 3 to
"/d_data/acpt/CRSACDB/sysaux01.dbf";
set newname for datafile 4 to
"/d_data/acpt/CRSACDB/undotbs01.dbf";
set newname for datafile 5 to
"/d_data/acpt/CRSACDB/pdbseed/system01.dbf";
set newname for datafile 6 to
"/d_data/acpt/CRSACDB/pdbseed/sysaux01.dbf";
set newname for datafile 7 to
"/d_data/acpt/CRSACDB/users01.dbf";
set newname for datafile 8 to
"/d_data/acpt/CRSACDB/pdbseed/undotbs01.dbf";
restore
from nonsparse from service
'crsacdb' clone database
;
Oracle 19c Container Database Data Guard Configuration 29
sql 'alter system archive log current';
}
executing Memory Script
executing command: SET NEWNAME
executing command: SET NEWNAME
renamed tempfile 1 to /d_data/acpt/CRSACDB/temp01.dbf in control file
renamed tempfile 2 to /d_data/acpt/CRSACDB/pdbseed/temp012020-06-08_09-39-23-298-AM.dbf in control file
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 08-JUN-20
channel c3: starting datafile backup set restore
channel c3: using network backup set from service crsacdb
channel c3: specifying datafile(s) to restore from backup set
channel c3: restoring datafile 00001 to /d_data/acpt/CRSACDB/system01.dbf
channel c4: starting datafile backup set restore
channel c4: using network backup set from service crsacdb
Oracle 19c Container Database Data Guard Configuration 30
channel c4: specifying datafile(s) to restore from backup set
channel c4: restoring datafile 00003 to /d_data/acpt/CRSACDB/sysaux01.dbf
channel c5: starting datafile backup set restore
channel c5: using network backup set from service crsacdb
channel c5: specifying datafile(s) to restore from backup set
channel c5: restoring datafile 00004 to /d_data/acpt/CRSACDB/undotbs01.dbf
channel c6: starting datafile backup set restore
channel c6: using network backup set from service crsacdb
channel c6: specifying datafile(s) to restore from backup set
channel c6: restoring datafile 00005 to /d_data/acpt/CRSACDB/pdbseed/system01.dbf
channel c3: restore complete, elapsed time: 00:00:08
channel c3: starting datafile backup set restore
channel c3: using network backup set from service crsacdb
channel c3: specifying datafile(s) to restore from backup set
channel c3: restoring datafile 00006 to /d_data/acpt/CRSACDB/pdbseed/sysaux01.dbf
channel c4: restore complete, elapsed time: 00:00:08
channel c4: starting datafile backup set restore
channel c4: using network backup set from service crsacdb
channel c4: specifying datafile(s) to restore from backup set
channel c4: restoring datafile 00007 to /d_data/acpt/CRSACDB/users01.dbf
channel c5: restore complete, elapsed time: 00:00:08
channel c5: starting datafile backup set restore
channel c5: using network backup set from service crsacdb
channel c5: specifying datafile(s) to restore from backup set
channel c5: restoring datafile 00008 to /d_data/acpt/CRSACDB/pdbseed/undotbs01.dbf
channel c6: restore complete, elapsed time: 00:00:08
channel c4: restore complete, elapsed time: 00:00:00
channel c3: restore complete, elapsed time: 00:00:03
channel c5: restore complete, elapsed time: 00:00:03
Finished restore at 08-JUN-20
sql statement: alter system archive log current
current log archived
Oracle 19c Container Database Data Guard Configuration 31
contents of Memory Script:
{
restore clone force from service 'crsacdb'
archivelog from scn 2449709;
switch clone datafile all;
}
executing Memory Script
Starting restore at 08-JUN-20
channel c3: starting archived log restore to default destination
channel c3: using network backup set from service crsacdb
channel c3: restoring archived log
archived log thread=1 sequence=14
channel c4: starting archived log restore to default destination
channel c4: using network backup set from service crsacdb
channel c4: restoring archived log
archived log thread=1 sequence=15
channel c3: restore complete, elapsed time: 00:00:00
channel c4: restore complete, elapsed time: 00:00:01
Finished restore at 08-JUN-20
datafile 1 switched to datafile copy
input datafile copy RECID=4 STAMP=1042541489 file name=/d_data/acpt/CRSACDB/system01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=5 STAMP=1042541489 file name=/d_data/acpt/CRSACDB/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=6 STAMP=1042541489 file name=/d_data/acpt/CRSACDB/undotbs01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=7 STAMP=1042541489 file name=/d_data/acpt/CRSACDB/pdbseed/system01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=8 STAMP=1042541489 file name=/d_data/acpt/CRSACDB/pdbseed/sysaux01.dbf
Oracle 19c Container Database Data Guard Configuration 32
datafile 7 switched to datafile copy
input datafile copy RECID=9 STAMP=1042541489 file name=/d_data/acpt/CRSACDB/users01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=10 STAMP=1042541489 file name=/d_data/acpt/CRSACDB/pdbseed/undotbs01.dbf
contents of Memory Script:
{
set until scn 2449806;
recover
standby
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 08-JUN-20
starting media recovery
archived log for thread 1 with sequence 14 is already on disk as file /d_fra/acpt/CRSACDB_S/archivelog/2020_06_08/o1_mf_1_14_hfv9xj57_.arc
archived log for thread 1 with sequence 15 is already on disk as file /d_fra/acpt/CRSACDB_S/archivelog/2020_06_08/o1_mf_1_15_hfv9xjbl_.arc
archived log file name=/d_fra/acpt/CRSACDB_S/archivelog/2020_06_08/o1_mf_1_14_hfv9xj57_.arc thread=1 sequence=14
archived log file name=/d_fra/acpt/CRSACDB_S/archivelog/2020_06_08/o1_mf_1_15_hfv9xjbl_.arc thread=1 sequence=15
media recovery complete, elapsed time: 00:00:01
Finished recover at 08-JUN-20
contents of Memory Script:
{
delete clone force archivelog all;
}
Oracle 19c Container Database Data Guard Configuration 33
executing Memory Script
deleted archived log
archived log file name=/d_fra/acpt/CRSACDB_S/archivelog/2020_06_08/o1_mf_1_15_hfv9xjbl_.arc RECID=2 STAMP=1042541488
Deleted 1 objects
deleted archived log
archived log file name=/d_fra/acpt/CRSACDB_S/archivelog/2020_06_08/o1_mf_1_14_hfv9xj57_.arc RECID=1 STAMP=1042541488
Deleted 1 objects
Finished Duplicate Db at 08-JUN-20
released channel: c1
released channel: c2
released channel: c3
released channel: c4
released channel: c5
released channel: c6
Restart the standby database
SQL> select database_role,open_mode from v$database;
DATABASE_ROLE OPEN_MODE
---------------- --------------------
PHYSICAL STANDBY MOUNTED
SQL> create spfile from pfile;
File created.
SQL> shutdown immediate;
Oracle 19c Container Database Data Guard Configuration 34
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 2147482416 bytes
Fixed Size 9116464 bytes
Variable Size 654311424 bytes
Database Buffers 1476395008 bytes
Redo Buffers 7659520 bytes
Database mounted.
Configure Data Guard related parameters (on standby)
SQL> alter system set log_archive_config='dg_config=( CRSACDB, CRSACDB_S)' scope=both sid='*';
System altered.
SQL> alter system set log_archive_dest_1='location=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,all_roles) db_unique_name=CRSACDB_S'
scope=both sid='*';
System altered.
SQL> alter system set log_Archive_dest_2='service=CRSACDB async noaffirm reopen=15 valid_for=(all_logfiles,primary_role)
db_unique_name=CRSACDB' scope=both sid='*';
System altered.
Oracle 19c Container Database Data Guard Configuration 35
SQL> alter system set fal_server='CRSACDB' scope=both sid='*';
System altered.
SQL> alter system set fal_client='CRSACDB_S' scope=both sid='*';
System altered.
SQL> alter system set standby_file_management=auto scope=both;
System altered.
Configure Data Guard related parameters (on primary)
SQL> alter system set log_archive_config='dg_config=( CRSACDB, CRSACDB_S)' scope=both sid='*';
System altered.
SQL> alter system set log_archive_dest_1='location=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,all_roles) db_unique_name=CRSACDB'
scope=both sid='*';
System altered.
SQL> alter system set log_Archive_dest_2='service=CRSACDB_S async noaffirm reopen=15 valid_for=(all_logfiles,primary_role)
db_unique_name=CRSACDB_S' scope=both sid='*';
System altered.
SQL> alter system set fal_server='CRSACDB_S' scope=both sid='*';
Oracle 19c Container Database Data Guard Configuration 36
System altered.
SQL> alter system set fal_client='CRSACDB' scope=both sid='*';
System altered.
SQL> alter system set standby_file_management=auto scope=both;
System altered.
Create standby redo log files (on primary)
SQL> select group#,thread#,bytes/1048576 from v$log;
GROUP# THREAD# BYTES/1048576
---------- ---------- -------------
1 1 200
2 1 200
3 1 200
SQL> alter database add standby logfile thread 1 group 4 size 200m;
Database altered.
SQL> alter database add standby logfile thread 1 group 5 size 200m;
Database altered.
SQL> alter database add standby logfile thread 1 group 6 size 200m;
Database altered.
Oracle 19c Container Database Data Guard Configuration 37
SQL> alter database add standby logfile thread 1 group 7 size 200m;
Database altered.
Create standby redo log files (on standby)
SQL> alter database add standby logfile thread 1 group 4 size 200m;
Database altered.
SQL> alter database add standby logfile thread 1 group 5 size 200m;
Database altered.
SQL> alter database add standby logfile thread 1 group 6 size 200m;
Database altered.
SQL> alter database add standby logfile thread 1 group 7 size 200m;
Database altered.
Verify Standby Database connectivity from Primary Database
SQL> alter system set log_archive_dest_state_2=defer;
System altered.
Oracle 19c Container Database Data Guard Configuration 38
SQL> alter system set log_archive_dest_state_2=enable;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> select destination,status,error from v$archive_dest_status where rownum < 3;
DESTINATION
--------------------------------------------------------------------------------
STATUS ERROR
--------- -----------------------------------------------------------------
VALID
CRSACDB_S
VALID
Configure parameters for Data Guard Broker (on BOTH primary and standby databases)
SQL> alter system set dg_broker_start=TRUE scope=both;
System altered.
SQL> alter system set log_archive_dest_2='' scope=both;
Oracle 19c Container Database Data Guard Configuration 39
System altered.
Add Data Guard Broker static entry to listener.ora (on standby)
oracle@db21:/opt/oracle/product/19.0.0/dbhome_1/network/admin$ vi listener.ora
LISTENER_CRS =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = db21)(PORT = 1512))
)
)
SID_LIST_LISTENER_CRS =
(SID_LIST =
(SID_DESC =
(SID_NAME = crsacdb)
(ORACLE_HOME = /opt/oracle/product/19.0.0/dbhome_1)
(GLOBAL_DBNAME = crsacdb_s.intranet)
)
(SID_DESC =
(GLOBAL_DBNAME = CRSACDB_S_DGMGRL.intranet)
(ORACLE_HOME = /opt/oracle/product/19.0.0/dbhome_1)
(SID_NAME = crsacdb)
)
)
oracle@db21:/opt/oracle/product/19.0.0/dbhome_1/network/admin$ lsnrctl reload listener_crs
LSNRCTL for Solaris: Version 19.0.0.0.0 - Production on 08-JUN-2020 11:14:35
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Oracle 19c Container Database Data Guard Configuration 40
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db21)(PORT=1512)))
The command completed successfully
Add Data Guard Broker static entry to listener.ora (on primary)
oracle@db22:/opt/oracle/product/19.0.0/dbhome_1/network/admin$ vi listener.ora
LISTENER_CRS =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = db22.intranet)(PORT = 1512))
)
)
SID_LIST_LISTENER_CRS =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = CRSACDB_DGMGRL.intranet)
(ORACLE_HOME = /opt/oracle/product/19.0.0/dbhome_1)
(SID_NAME = crsacdb)
)
)
oracle@db22:/opt/oracle/product/19.0.0/dbhome_1/network/admin$ lsnrctl reload listener_crs
LSNRCTL for Solaris: Version 19.0.0.0.0 - Production on 08-JUN-2020 11:12:17
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Oracle 19c Container Database Data Guard Configuration 41
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db22.intranet)(PORT=1512)))
The command completed successfully
Create Data Guard Broker Configuration
oracle@db22:/opt/oracle/product/19.0.0/dbhome_1/network/admin$ dgmgrl
DGMGRL for Solaris: Release 19.0.0.0.0 - Production on Mon Jun 8 11:15:30 2020
Version 19.7.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect / as sysdg
Connected to "crsacdb"
Connected as SYSDG.
DGMGRL> create configuration 'CRSACDB_DG'
> as primary database is 'CRSACDB'
> connect identifier is 'CRSACDB';
Configuration "CRSACDB_DG" created with primary database "CRSACDB"
DGMGRL> add database 'CRSACDB_S'
> as connect identifier is 'CRSACDB_S';
Database "CRSACDB_S" added
DGMGRL> enable configuration;
Enabled.
DGMGRL> show configuration;
Oracle 19c Container Database Data Guard Configuration 42
Configuration - CRSACDB_DG
Protection Mode: MaxPerformance
Members:
CRSACDB - Primary database
CRSACDB_S - Physical standby database
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 24 seconds ago)
Validate Data Guard Broker Configuration
DGMGRL> connect sys/Dreamliner787##
Connected to "crsacdb"
Connected as SYSDBA.
DGMGRL> validate network configuration for all;
Connecting to instance "crsacdb" on database "CRSACDB" ...
Connected to "crsacdb"
Checking connectivity from instance "crsacdb" on database "CRSACDB to instance "crsacdb" on database "CRSACDB_S"...
Succeeded.
Connecting to instance "crsacdb" on database "CRSACDB_S" ...
Connected to "crsacdb_s"
Checking connectivity from instance "crsacdb" on database "CRSACDB_S to instance "crsacdb" on database "CRSACDB"...
Succeeded.
Oracle Clusterware is not configured on database "CRSACDB".
Oracle 19c Container Database Data Guard Configuration 43
Connecting to database "CRSACDB" using static connect identifier "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db22)(PORT=1512))
(CONNECT_DATA=(SERVICE_NAME=crsacdb_DGMGRL.intranet)(INSTANCE_NAME=crsacdb)(SERVER=DEDICATED)(STATIC_SERVICE=TRUE)))" ...
Succeeded.
The static connect identifier allows for a connection to database "CRSACDB".
Oracle Clusterware is not configured on database "CRSACDB_S".
Connecting to database "CRSACDB_S" using static connect identifier "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db21)(PORT=1512))
(CONNECT_DATA=(SERVICE_NAME=crsacdb_s_DGMGRL.intranet)(INSTANCE_NAME=crsacdb)(SERVER=DEDICATED)(STATIC_SERVICE=TRUE)))" ...
Succeeded.
The static connect identifier allows for a connection to database "CRSACDB_S".
Test Switchover Operation
DGMGRL> switchover to 'CRSACDB_S'
Performing switchover NOW, please wait...
Operation requires a connection to database "CRSACDB_S"
Connecting ...
Connected to "crsacdb_s"
Connected as SYSDBA.
New primary database "CRSACDB_S" is opening...
Operation requires start up of instance "crsacdb" on database "CRSACDB"
Starting instance "crsacdb"...
Connected to an idle instance.
ORACLE instance started.
Connected to "crsacdb"
Database mounted.
Connected to "crsacdb"
Switchover succeeded, new primary is "CRSACDB_S"
DGMGRL> switchover to 'CRSACDB';
Performing switchover NOW, please wait...
Oracle 19c Container Database Data Guard Configuration 44
Operation requires a connection to database "CRSACDB"
Connecting ...
Connected to "crsacdb"
Connected as SYSDBA.
New primary database "CRSACDB" is opening...
Operation requires start up of instance "crsacdb" on database "CRSACDB_S"
Starting instance "crsacdb"...
Connected to an idle instance.
ORACLE instance started.
Connected to "crsacdb_s"
Database mounted.
Connected to "crsacdb_s"
Switchover succeeded, new primary is "CRSACDB"
Oracle 19c Container Database Data Guard Configuration 45