Skip to content
Home » Oracle Database » Installation and Upgrade » DBCA Silent Database Creation 19c

DBCA Silent Database Creation 19c

By design, we split the entire installation into several clear sections and make the job easy to troubleshoot.

This is the third section of Oracle installation in silent mode.

DBCA

After installing Oracle 19c software only with silent mode, you may like to create a database by Database Configuration Assistant (DBCA) with silent mode, too.

In this post, we'll talk about the following topics.

  1. Response File
  2. Command Line
  3. DB_UNIQUE_NAME
  4. Template File

Please make sure that the listener is configured and running, you may also configure the networking by NETCA in silent mode.

Response File

There're 2 major types of database 19c that should be considered.

  1. Non-Container Database (Non-CDB)
  2. Container Database (CDB)

Additionally, we may see the result of executing DBCA in silent mode.

  1. Create Database Silently

Non-Container Database (Non-CDB)

First of all, let's take a look at the content of the response file.

[oracle@test ~]$ vi ~/dbca.rsp
responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v12.2.0
gdbName=ORCL
databaseConfigType=SI
policyManaged=false
createServerPool=false
force=false
createAsContainerDatabase=false
numberOfPDBs=0
templateName=/u01/app/oracle/product/19.0.0/dbhome_1/assistants/dbca/templates/General_Purpose.dbc
sysPassword=welcome1
systemPassword=welcome1
emConfiguration=DBEXPRESS
emExpressPort=5500
runCVUChecks=FALSE
omsPort=0
dvConfiguration=false
olsConfiguration=false
datafileJarLocation={ORACLE_HOME}/assistants/dbca/templates/
datafileDestination={ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/
recoveryAreaDestination={ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME}
storageType=FS
characterSet=AL32UTF8
nationalCharacterSet=AL16UTF16
registerWithDirService=false
listeners=LISTENER
variables=ORACLE_BASE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1,ORACLE_BASE=/u01/app/oracle,PDB_NAME=,DB_NAME=ORCL,ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
initParams=undo_tablespace=UNDOTBS1,db_block_size=8192BYTES,nls_language=AMERICAN,dispatchers=(PROTOCOL=TCP) (SERVICE=ORCLXDB),diagnostic_dest={ORACLE_BASE},control_files=("{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/control01.ctl", "{ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME}/control02.ctl"),remote_login_passwordfile=EXCLUSIVE,audit_file_dest={ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump,processes=500,nls_territory=AMERICA,memory_target=1470MB,db_recovery_file_dest_size=50GB,open_cursors=300,log_archive_format=%t_%s_%r.dbf,compatible=19.0.0,db_name=ORCL,db_recovery_file_dest={ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME},audit_trail=db
sampleSchema=true
memoryPercentage=40
databaseType=MULTIPURPOSE
automaticMemoryManagement=true
totalMemory=0
redoLogFileSize=1024

Container Database (CDB)

Here we configure a multitenant database ORCLCDB with one pluggable database (PDB) called ORCLPDB in the response file.

[oracle@test ~]$ vi ~/dbca.rsp
responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v12.2.0
gdbName=ORCLCDB
sid=ORCLCDB
databaseConfigType=SI
policyManaged=false
createServerPool=false
force=false
createAsContainerDatabase=true
numberOfPDBs=1
pdbName=ORCLPDB
useLocalUndoForPDBs=true
pdbAdminPassword=welcome1
templateName=/u01/app/oracle/product/19.0.0/dbhome_1/assistants/dbca/templates/General_Purpose.dbc
sysPassword=welcome1
systemPassword=welcome1
emConfiguration=DBEXPRESS
emExpressPort=5500
runCVUChecks=FALSE
omsPort=0
dvConfiguration=false
olsConfiguration=false
datafileJarLocation={ORACLE_HOME}/assistants/dbca/templates/
datafileDestination={ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/
recoveryAreaDestination={ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME}
storageType=FS
characterSet=AL32UTF8
nationalCharacterSet=AL16UTF16
registerWithDirService=false
listeners=LISTENER
variables=ORACLE_BASE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1,DB_UNIQUE_NAME=ORCLCDB,ORACLE_BASE=/u01/app/oracle,PDB_NAME=,DB_NAME=ORCLCDB,ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1,SID=ORCLCDB
initParams=undo_tablespace=UNDOTBS1,sga_target=2550MB,db_block_size=8192BYTES,nls_language=AMERICAN,dispatchers=(PROTOCOL=TCP) (SERVICE=ORCLCDBXDB),diagnostic_dest={ORACLE_BASE},control_files=("{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/control01.ctl", "{ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME}/control02.ctl"),remote_login_passwordfile=EXCLUSIVE,audit_file_dest={ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump,processes=500,pga_aggregate_target=850MB,nls_territory=AMERICA,local_listener=LISTENER_ORCLCDB,db_recovery_file_dest_size=50GB,open_cursors=300,log_archive_format=%t_%s_%r.dbf,compatible=19.0.0,db_name=ORCLCDB,db_recovery_file_dest={ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME},audit_trail=db
sampleSchema=false
memoryPercentage=40
databaseType=MULTIPURPOSE
automaticMemoryManagement=false
totalMemory=0
redoLogFileSize=1024

Please note that, redoLogFileSize is the parameter that can set redo log size. In this case, we set them as 1024MB. On the other side, you can also change redo log size in DBCA or OUI interactive mode.

Next, we create a 19c database with silent mode.

Create Database Silently

To create a database, we need to notify DBCA our intention by specifying -createDatabase in the command.

[oracle@test ~]$ dbca -silent -createDatabase -responseFile ~/dbca.rsp
Prepare for db operation
10% complete
Copying database files
40% complete
Creating and starting Oracle instance
42% complete
46% complete
50% complete
54% complete
58% complete
60% complete
Completing Database Creation
66% complete
70% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /u01/app/oracle/cfgtoollogs/dbca/ORCL.
Database Information:
Global Database Name:ORCL
System Identifier(SID):ORCL
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/ORCL/ORCL.log" for further details.

For a CDB with only one PDB, it looks a little different.

[oracle@test ~]$ dbca -silent -createDatabase -responseFile ~/dbca.rsp
Prepare for db operation
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /u01/app/oracle/cfgtoollogs/dbca/ORCLCDB.
Database Information:
Global Database Name:ORCLCDB
System Identifier(SID):ORCLCDB
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log" for further details.

Please note that, if you saw error DBT-06208 like the following:

[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.

It's about password complexity and can be ignored.

Command Line

Without response file, we have to put all arguments in the command line in order to use DBCA with silent mode. Of course, we can mix response file and command line to formulate a more controllable result, but the rule is that arguments in command line override any other settings.

Non-Container Database (Non-CDB)

The following is the copy-able command.

dbca \
-silent \
-createDatabase \
-gdbName ORCL \
-databaseConfigType SI \
-numberOfPDBs 0 \
-templateName /u01/app/oracle/product/19.0.0/dbhome_1/assistants/dbca/templates/General_Purpose.dbc \
-sysPassword welcome1 \
-systemPassword welcome1 \
-emConfiguration DBEXPRESS \
-emExpressPort 5500 \
-omsPort 0 \
-datafileJarLocation {ORACLE_HOME}/assistants/dbca/templates/ \
-datafileDestination {ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/ \
-recoveryAreaDestination {ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME} \
-storageType FS \
-characterSet AL32UTF8 \
-nationalCharacterSet AL16UTF16 \
-listeners LISTENER \
-variables ORACLE_BASE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1,ORACLE_BASE=/u01/app/oracle,PDB_NAME=,DB_NAME=ORCL,ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1 \
-initParams db_unique_name=ORCL,undo_tablespace=UNDOTBS1,db_block_size=8192BYTES,nls_language=AMERICAN,dispatchers=\(PROTOCOL=TCP\) \(SERVICE=ORCLXDB\),diagnostic_dest={ORACLE_BASE},control_files=\("{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/control01.ctl", "{ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME}/control02.ctl"\),remote_login_passwordfile=EXCLUSIVE,audit_file_dest={ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump,processes=500,nls_territory=AMERICA,memory_target=1470MB,db_recovery_file_dest_size=50GB,open_cursors=300,log_archive_format=%t_%s_%r.dbf,compatible=19.0.0,db_name=ORCL,db_recovery_file_dest={ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME},audit_trail=db \
-sampleSchema true \
-memoryPercentage 40 \
-databaseType MULTIPURPOSE \
-automaticMemoryManagement true \
-redoLogFileSize 1024

Container Database (CDB)

The following is the copy-able command.

dbca \
-silent \
-createDatabase \
-gdbName ORCLCDB \
-sid ORCLCDB \
-databaseConfigType SI \
-createAsContainerDatabase true \
-numberOfPDBs 1 \
-pdbName ORCLPDB \
-useLocalUndoForPDBs true \
-pdbAdminPassword welcome1 \
-templateName /u01/app/oracle/product/19.0.0/dbhome_1/assistants/dbca/templates/General_Purpose.dbc \
-sysPassword welcome1 \
-systemPassword welcome1 \
-emConfiguration DBEXPRESS \
-emExpressPort 5500 \
-omsPort 0 \
-datafileJarLocation {ORACLE_HOME}/assistants/dbca/templates/ \
-datafileDestination {ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/ \
-recoveryAreaDestination {ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME} \
-storageType FS \
-characterSet AL32UTF8 \
-nationalCharacterSet AL16UTF16 \
-listeners LISTENER \
-variables ORACLE_BASE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1,DB_UNIQUE_NAME=ORCLCDB,ORACLE_BASE=/u01/app/oracle,PDB_NAME=,DB_NAME=ORCLCDB,ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1,SID=ORCLCDB \
-initParams undo_tablespace=UNDOTBS1,sga_target=2550MB,db_block_size=8192BYTES,nls_language=AMERICAN,dispatchers=\(PROTOCOL=TCP\) \(SERVICE=ORCLCDBXDB\),diagnostic_dest={ORACLE_BASE},control_files=\("{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/control01.ctl", "{ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME}/control02.ctl"\),remote_login_passwordfile=EXCLUSIVE,audit_file_dest={ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump,processes=500,pga_aggregate_target=850MB,nls_territory=AMERICA,local_listener=LISTENER_ORCLCDB,db_recovery_file_dest_size=50GB,open_cursors=300,log_archive_format=%t_%s_%r.dbf,compatible=19.0.0,db_name=ORCLCDB,db_recovery_file_dest={ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME},audit_trail=db \
-memoryPercentage 40 \
-databaseType MULTIPURPOSE \
-automaticMemoryManagement false \
-redoLogFileSize 1024

The result is the same as using a response file.

DB_UNIQUE_NAME

Yes, DB_UNIQUE_NAME can be different from DB_NAME. That's why DB_UNIQUE_NAME and SID configured in VARIABLE is useless. We should use -initParams db_unique_name in the command. For example, we'd like ORCX to be our DB_UNIQUE_NAME.

[oracle@test ~]$ dbca -silent -createDatabase -initParams db_unique_name=ORCX -responseFile ~/dbca.rsp

If you still have the problem to set a different DB_UNIQUE_NAME during database creation, you can also change DB_UNIQUE_NAME after the database created. To know the differences between DB_NAME and DB_UNIQUE_NAME, you may have a look at the post.

Oracle did mention the problem of naming a different DB_UNIQUE_NAME in the document: DBCA Silent Mode Is Not Setting DB_UNIQUE_NAME Even Though It Is Specified In DBCA Template File. (Doc ID 1508337.1).

It means that parameter in command line takes precedence over template file and response file.

Template File

If you want a more controllable database creation, you may additionally modify the template too. For example, if you want more redo groups 4, 5, and 6, you can add some elements before database creation:

[oracle@test ~]$ vi $ORACLE_HOME/assistants/dbca/templates/General_Purpose.dbc
...
      <RedoLogGroupAttributes id="4">
         <reuse>false</reuse>
         <fileSize unit="KB">1048576</fileSize>
         <Thread>1</Thread>
         <member ordinal="0" memberName="redo04.log" filepath="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/"/>
      </RedoLogGroupAttributes>
      <RedoLogGroupAttributes id="5">
         <reuse>false</reuse>
         <fileSize unit="KB">1048576</fileSize>
         <Thread>1</Thread>
         <member ordinal="0" memberName="redo05.log" filepath="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/"/>
      </RedoLogGroupAttributes>
      <RedoLogGroupAttributes id="6">
         <reuse>false</reuse>
         <fileSize unit="KB">1048576</fileSize>
         <Thread>1</Thread>
         <member ordinal="0" memberName="redo06.log" filepath="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/"/>

In my opinion, to use silent mode, you have to know every meaning of each parameters, furthermore, the interaction between parameters. So, silent mode is suitable for mass database creation only.

For single or few times creation, interactive mode is a reliable way to create databases, all variables are grouped into steps, which is more understandable and less error-prone, especially when we are in an unclear, doubtful or controversial environment.

Further Readings

Although I set sampleSchema=true, OUI installed only HR schema, if you want the rest sample schemas, you have to know how to install complete sample schemas.

To see a full example of installing Oracle database in silent mode, you may refer to the post: How to Install Oracle Database 19.18 on Linux.

4 thoughts on “DBCA Silent Database Creation 19c”

  1. Have you noticed that the response file produced by the dbca doesn’t include the dbptions parameters? As a result, the db contains all the options, unless you manually provide the dboptions to the command line.
    Another observation, you said the HR is installed when sampleSchema=true. Have you verified that? because in my testing environment, it wasn’t created.

    1. Thanks for your feedback! Response file and template are the main source of setting, the rest of parameters follow default values. As for sample schema, I didn’t notice that.

  2. Hello Ed,
    Could you try a silent creation with -emConfiguration CENTRAL?
    I have tried maybe 50 times to get the parameters correct but I still get errors.
    Either there’s a bug or I have something wrong here:

    > -emConfiguration CENTRAL \
    > -dbsnmpPassword “${P_DBSNMPPWD}” \
    > -omsHost “${P_OMSHOST}” \
    > -omsPort “${P_OMSPORT}” \
    > -emUser “${P_EMUSER}” \
    > -emPassword “${P_EMPWD}” \

    These get translated as:
    -emConfiguration CENTRAL -dbsnmpPassword dbsnmppwd -omsHost hn1627 -omsPort 7803 -emUser sysman -emPassword sysmanpwd

    Always results in :
    [FATAL] [DBT-07001] Specified credentials for Enterprise Manager Cloud Control configuration are invalid.

    I opened SR but there’s no answer there.

    Could you try and see if you get a db registered centrally?

    Thanks a lot,,
    Stuart

Leave a Reply

Your email address will not be published. Required fields are marked *