In the previous post https://gavinsoorma.com.au/knowledge-base/prepare-database-for-data-guard/, we saw how we can use the PREPARE DATABASE FOR DATA GUARD command to automate many of the manual steps which are prerequisites for configuring an Oracle Data Guard environment.
In this post we will look at how to create an Oracle Database 23ai physical standby database via the DBCA silent method.
The syntax to be used is shown below:
dbca -createDuplicateDB
-gdbName global_database_name
-primaryDBConnectionString easy_connect_string_to_primary
-sid database_system_identifier
[-createAsStandby
[-dbUniqueName db_unique_name_for_standby]]
[-customScripts scripts_list]
Example
In this example we have the following environment:
- Primary host: perth
- Standby host: sydney
- Listener port: 1521
- Database Name: orcl
- Database Unique Name (primary): orcl
- Database Unique Name (standby): orcl_sdb
Connect as the user SYS on the standby database server.
[oracle@sydney bin]$ ./dbca -silent -createDuplicateDB -gdbName orcl -primaryDBConnectionString perth:1521/orcl -sid orcl -createAsStandby -dbUniqueName orcl_sb
Enter Remote DB SYS user password:
Session ID of the current execution is: 2
Log file location: /u01/app/oracle/cfgtoollogs/dbca/orcl_sb/trace.log_2024-11-06_07-21-26AM_23332
-----------------
Running Initialize_variables job
Completed Initialize_variables job
5% complete
-----------------
Running Create_directories job
Completed Create_directories job
9% complete
-----------------
Running Create_static_listener job
Completed Create_static_listener job
12% complete
-----------------
Running Register_listeners job
Completed Register_listeners job
15% complete
-----------------
Running Add_service_alias_entry_for_RAC job
Skipping. Job is detected as not applicable.
18% complete
-----------------
Running Configure_tde_for_auxiliary_instance job
Completed Configure_tde_for_auxiliary_instance job
20% complete
-----------------
Running Create_auxiliary_instance_password_file job
Completed Create_auxiliary_instance_password_file job
23% complete
-----------------
Running Create_initial_RAC_or_SIHA_configuration job
Completed Create_initial_RAC_or_SIHA_configuration job
25% complete
-----------------
Running Auxiliary_instance_startup job
Completed Auxiliary_instance_startup job
27% complete
30% complete
33% complete
36% complete
37% complete
38% complete
39% complete
40% complete
41% complete
42% complete
43% complete
44% complete
45% complete
-----------------
Running Duplicate_database job
Completed Duplicate_database job
55% complete
56% complete
57% complete
58% complete
60% complete
61% complete
62% complete
64% complete
-----------------
Running Open_standby_database job
Completed Open_standby_database job
-----------------
Running Unlock_accounts job
Skipping. Job is detected as not applicable.
65% complete
-----------------
Running Process_redo_logs_and_undo_tablespaces_for_RAC job
Skipping. Job is detected as not applicable.
-----------------
Running Update_control_file_init_parameters job
Completed Update_control_file_init_parameters job
66% complete
-----------------
Running Create_TDE_wallet job
Skipping. Job is detected as not applicable.
-----------------
Running Create_init_file job
Completed Create_init_file job
67% complete
-----------------
Running Shutdown_auxiliary_instance job
Completed Shutdown_auxiliary_instance job
68% complete
-----------------
Running Create_SPFile job
Completed Create_SPFile job
-----------------
Running Create_service_alias_for_RAC job
Skipping. Job is detected as not applicable.
69% complete
-----------------
Running Create_SPFile_with_location_calculation job
Completed Create_SPFile_with_location_calculation job
-----------------
Running Set_master_key job
Skipping. Job is detected as not applicable.
70% complete
-----------------
Running Shutdown_database job
Completed Shutdown_database job
-----------------
Running Startup_database job
Completed Startup_database job
71% complete
-----------------
Running Open_wallet job
Skipping. Job is detected as not applicable.
72% complete
-----------------
Running Open_PDBs job
Completed Open_PDBs job
-----------------
Running Set_master_key_for_PDBs job
Skipping. Job is detected as not applicable.
73% complete
-----------------
Running Run_custom_sql_scripts job
Completed Run_custom_sql_scripts job
82% complete
83% complete
84% complete
85% complete
86% complete
88% complete
89% complete
90% complete
91% complete
92% complete
93% complete
94% complete
95% complete
96% complete
97% complete
98% complete
99% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/orcl_sb/orcl_sb0.log" for further details.
Connect to the standby database and verify the database role as well as the status of the Pluggable Databases.
SQL> select database_role,open_mode from v$database;
DATABASE_ROLE OPEN_MODE
---------------- --------------------
PHYSICAL STANDBY READ ONLY
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB1 READ ONLY NO
4 ORCLPDB2 READ ONLY NO
We can review the log file contents.
[oracle@sydney bin]$ cat /u01/app/oracle/cfgtoollogs/dbca/orcl/orcl0.log
[ 2025-04-22 01:23:37.667 UTC ] [WARNING] [DBT-06801] Specified Fast Recovery Area size (14,832 MB) is less than the recommended value.
[ 2025-04-22 01:23:37.976 UTC ] Session ID of the current execution is: 2
[ 2025-04-22 01:23:37.977 UTC ] Log file location: /u01/app/oracle/cfgtoollogs/dbca/orcl/trace.log_2025-04-22_01-23-18AM_5446
[ 2025-04-22 01:23:37.981 UTC ] -----------------
[ 2025-04-22 01:23:37.981 UTC ] Running Initialize_variables job
[ 2025-04-22 01:23:38.026 UTC ] Completed Initialize_variables job
DBCA_PROGRESS : 5%
[ 2025-04-22 01:23:38.455 UTC ] -----------------
[ 2025-04-22 01:23:38.455 UTC ] Running Create_directories job
[ 2025-04-22 01:23:38.491 UTC ] Completed Create_directories job
DBCA_PROGRESS : 9%
[ 2025-04-22 01:23:38.656 UTC ] -----------------
[ 2025-04-22 01:23:38.656 UTC ] Running Create_static_listener job
[ 2025-04-22 01:23:38.910 UTC ] Completed Create_static_listener job
DBCA_PROGRESS : 12%
[ 2025-04-22 01:23:38.995 UTC ] -----------------
[ 2025-04-22 01:23:38.995 UTC ] Running Register_listeners job
[ 2025-04-22 01:23:39.073 UTC ] Completed Register_listeners job
DBCA_PROGRESS : 15%
[ 2025-04-22 01:23:39.238 UTC ] -----------------
[ 2025-04-22 01:23:39.239 UTC ] Running Add_service_alias_entry_for_RAC job
[ 2025-04-22 01:23:39.239 UTC ] Skipping. Job is detected as not applicable.
DBCA_PROGRESS : 18%
[ 2025-04-22 01:23:39.402 UTC ] -----------------
[ 2025-04-22 01:23:39.403 UTC ] Running Configure_tde_for_auxiliary_instance job
[ 2025-04-22 01:23:39.447 UTC ] Completed Configure_tde_for_auxiliary_instance job
DBCA_PROGRESS : 20%
[ 2025-04-22 01:23:39.594 UTC ] -----------------
[ 2025-04-22 01:23:39.594 UTC ] Running Create_auxiliary_instance_password_file job
[ 2025-04-22 01:23:39.641 UTC ] Completed Create_auxiliary_instance_password_file job
DBCA_PROGRESS : 23%
[ 2025-04-22 01:23:39.712 UTC ] -----------------
[ 2025-04-22 01:23:39.713 UTC ] Running Create_initial_RAC_or_SIHA_configuration job
[ 2025-04-22 01:23:39.730 UTC ] Completed Create_initial_RAC_or_SIHA_configuration job
DBCA_PROGRESS : 25%
[ 2025-04-22 01:23:39.805 UTC ] -----------------
[ 2025-04-22 01:23:39.806 UTC ] Running Auxiliary_instance_startup job
[ 2025-04-22 01:23:47.007 UTC ] Completed Auxiliary_instance_startup job
DBCA_PROGRESS : 27%
DBCA_PROGRESS : 30%
DBCA_PROGRESS : 33%
DBCA_PROGRESS : 36%
DBCA_PROGRESS : 37%
DBCA_PROGRESS : 38%
DBCA_PROGRESS : 39%
DBCA_PROGRESS : 40%
DBCA_PROGRESS : 41%
DBCA_PROGRESS : 42%
DBCA_PROGRESS : 43%
DBCA_PROGRESS : 44%
DBCA_PROGRESS : 45%
[ 2025-04-22 01:23:47.269 UTC ] -----------------
[ 2025-04-22 01:23:47.270 UTC ] Running Duplicate_database job
[ 2025-04-22 01:25:24.424 UTC ] Completed Duplicate_database job
DBCA_PROGRESS : 55%
DBCA_PROGRESS : 56%
DBCA_PROGRESS : 57%
DBCA_PROGRESS : 58%
DBCA_PROGRESS : 60%
DBCA_PROGRESS : 61%
DBCA_PROGRESS : 62%
DBCA_PROGRESS : 64%
[ 2025-04-22 01:25:24.546 UTC ] -----------------
[ 2025-04-22 01:25:24.546 UTC ] Running Open_standby_database job
[ 2025-04-22 01:25:27.407 UTC ] Completed Open_standby_database job
[ 2025-04-22 01:25:27.488 UTC ] -----------------
[ 2025-04-22 01:25:27.488 UTC ] Running Unlock_accounts job
[ 2025-04-22 01:25:27.489 UTC ] Skipping. Job is detected as not applicable.
DBCA_PROGRESS : 65%
[ 2025-04-22 01:25:27.577 UTC ] -----------------
[ 2025-04-22 01:25:27.578 UTC ] Running Process_redo_logs_and_undo_tablespaces_for_RAC job
[ 2025-04-22 01:25:27.579 UTC ] Skipping. Job is detected as not applicable.
[ 2025-04-22 01:25:27.695 UTC ] -----------------
[ 2025-04-22 01:25:27.695 UTC ] Running Update_control_file_init_parameters job
[ 2025-04-22 01:25:27.695 UTC ] Completed Update_control_file_init_parameters job
DBCA_PROGRESS : 66%
[ 2025-04-22 01:25:27.739 UTC ] -----------------
[ 2025-04-22 01:25:27.740 UTC ] Running Create_TDE_wallet job
[ 2025-04-22 01:25:27.740 UTC ] Skipping. Job is detected as not applicable.
[ 2025-04-22 01:25:27.827 UTC ] -----------------
[ 2025-04-22 01:25:27.827 UTC ] Running Create_init_file job
[ 2025-04-22 01:25:27.863 UTC ] Completed Create_init_file job
DBCA_PROGRESS : 67%
[ 2025-04-22 01:25:28.077 UTC ] -----------------
[ 2025-04-22 01:25:28.077 UTC ] Running Shutdown_auxiliary_instance job
[ 2025-04-22 01:25:35.301 UTC ] Completed Shutdown_auxiliary_instance job
DBCA_PROGRESS : 68%
[ 2025-04-22 01:25:35.358 UTC ] -----------------
[ 2025-04-22 01:25:35.358 UTC ] Running Create_SPFile job
[ 2025-04-22 01:25:35.361 UTC ] Completed Create_SPFile job
[ 2025-04-22 01:25:35.419 UTC ] -----------------
[ 2025-04-22 01:25:35.419 UTC ] Running Create_service_alias_for_RAC job
[ 2025-04-22 01:25:35.419 UTC ] Skipping. Job is detected as not applicable.
DBCA_PROGRESS : 69%
[ 2025-04-22 01:25:35.464 UTC ] -----------------
[ 2025-04-22 01:25:35.464 UTC ] Running Create_SPFile_with_location_calculation job
[ 2025-04-22 01:25:40.389 UTC ] Completed Create_SPFile_with_location_calculation job
[ 2025-04-22 01:25:40.520 UTC ] -----------------
[ 2025-04-22 01:25:40.521 UTC ] Running Set_master_key job
[ 2025-04-22 01:25:40.523 UTC ] Skipping. Job is detected as not applicable.
DBCA_PROGRESS : 70%
[ 2025-04-22 01:25:40.656 UTC ] -----------------
[ 2025-04-22 01:25:40.662 UTC ] Running Shutdown_database job
[ 2025-04-22 01:25:41.735 UTC ] Completed Shutdown_database job
[ 2025-04-22 01:25:41.881 UTC ] -----------------
[ 2025-04-22 01:25:41.881 UTC ] Running Startup_database job
[ 2025-04-22 01:25:48.719 UTC ] Completed Startup_database job
DBCA_PROGRESS : 71%
[ 2025-04-22 01:25:48.833 UTC ] -----------------
[ 2025-04-22 01:25:48.834 UTC ] Running Open_wallet job
[ 2025-04-22 01:25:48.835 UTC ] Skipping. Job is detected as not applicable.
DBCA_PROGRESS : 72%
[ 2025-04-22 01:25:49.035 UTC ] -----------------
[ 2025-04-22 01:25:49.035 UTC ] Running Open_PDBs job
[ 2025-04-22 01:25:53.199 UTC ] Completed Open_PDBs job
[ 2025-04-22 01:25:53.365 UTC ] -----------------
[ 2025-04-22 01:25:53.365 UTC ] Running Set_master_key_for_PDBs job
[ 2025-04-22 01:25:53.366 UTC ] Skipping. Job is detected as not applicable.
DBCA_PROGRESS : 73%
[ 2025-04-22 01:25:53.440 UTC ] -----------------
[ 2025-04-22 01:25:53.441 UTC ] Running Run_custom_sql_scripts job
[ 2025-04-22 01:25:53.443 UTC ] Completed Run_custom_sql_scripts job
DBCA_PROGRESS : 82%
DBCA_PROGRESS : 83%
DBCA_PROGRESS : 84%
DBCA_PROGRESS : 85%
DBCA_PROGRESS : 86%
DBCA_PROGRESS : 88%
DBCA_PROGRESS : 89%
DBCA_PROGRESS : 90%
DBCA_PROGRESS : 91%
DBCA_PROGRESS : 92%
DBCA_PROGRESS : 93%
DBCA_PROGRESS : 94%
DBCA_PROGRESS : 95%
DBCA_PROGRESS : 96%
DBCA_PROGRESS : 97%
DBCA_PROGRESS : 98%
DBCA_PROGRESS : 99%
DBCA_PROGRESS : 100%
[oracle@sydney bin]$