Professional Documents
Culture Documents
In this example we will see how a 12.2.0.1 Data Guard environment is created via DBCA and
then Data Guard Broker (DGMGRL).
Primary database host name is host01 and the Standby database host name is host02.
-gdbName global_database_name
-primaryDBConnectionString easy_connect_string_to_primary
-sid database_system_identifier
[-createAsStandby
[-dbUniqueName db_unique_name_for_standby]]
We will run the command from the standby host host02 as shown below.
[oracle@host02 ~]$ dbca -silent -createDuplicateDB -gdbName salesdb
-primaryDBConnectionString host01:1521/salesdb -sid salesdb -createAsStandby
-dbUniqueName salesdb_sb
33% complete
66% complete
RMAN duplicate
100% complete
Look at the log file "/u02/app/oracle/cfgtoollogs/dbca/salesdb_sb/salesdb.log" for
further details.
Connect to the Standby Database and verify the role of the database
Note that the SPFILE and Password File for the Standby Database has been automatically
created
[oracle@host02 dbs]$ ls -l sp*
System altered.
SQL> quit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit
Production
DGMGRL for Linux: Release 12.2.0.1.0 - Production on Fri Mar 17 14:47:27 2017
connect /
Connected to "salesdb"
Connected as SYSDG.
Enabled.
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
/u03/app/oradata/salesdb/redo03.log
/u03/app/oradata/salesdb/redo02.log
/u03/app/oradata/salesdb/redo01.log
BYTES/1048576
-------------
200
200
200
Database altered.
SQL> alter database add standby logfile '/u03/app/oradata/salesdb/standy_redo2.log'
size 200m;
Database altered.
Database altered.
Database altered.
Create the Standby Redo Log Files on the standby database
DGMGRL> connect /
Connected to "salesdb"
Connected as SYSDG.
Succeeded.
Database closed.
Database dismounted.
ORACLE instance shut down.
Database mounted.
Database altered.
Database altered.
Database altered.
Database altered.
SQL>
Verify the Data Guard Configuration
DGMGRL> edit database 'salesdb_sb' set state='APPLY-ON';
Succeeded.
Configuration - salesdb_dg
Configuration Status:
Edit listener.ora on primary database host and add the lines shown below. Reload the
listener.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
)
)
Edit listener.ora on standby database host and add the lines shown below. Reload the
listener.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
)
)