The DBCA graphical user interface is normally used to create a new database, delete a database or configure other options of a database. But there may be times when you don’t want to use the graphical UI.
At times when you are working from a remote location and may not have access to a graphical user interface. In situations like this and others you can use the DBCA silent mode to create a database.
In this article we will look at how we can create a database using a non-interactive silent mode.
Creating Database Using DBCA Silent Mode
To create a database using silent mode you need to pass in the keyword “silent” as an argument to DBCA command. The other options like password for SYS and SYSTEM, which template to use and where to put data files etc. are also provided to the DBCA as an argument.
Most of the options are optional and you can skip them. But if you miss the mandatory option the DBCA command line will ask for their values before creating database.
Below is an explanation for some of the parameters which we will be used to create a database.
Will instruct the database configuration assistant to run in silent mode
The argument will instruct the DBCA to create a database.
The argument will specify the template that DBCA should use to create the database. Advantage of specifying a template is that you don’t have to specify the many other options like data file and control file locations.
The Database configuration assistant will get those values from the template. Although you can change the defaults of template during the initial steps.
The global database name is provided using this argument.
The database instance name which will be created and started as part of process.
You can also create a response file.
The character set that the newly created database will be using.
The argument will specify the percentage of total memory that can be use by Oracle SGA and PGA combined.
Whether the database should be configured to use Enterprise Manager or not. Valid config types are LOCAL, CENTRAL, NOBACKUP, NOEMAIL, and NONE.
Now that you have an idea of what options are available you can use the commands below to create the database in silent mode.
$ echo $ORACLE_BASE
$ echo $ORACLE_HOME
$ dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname dbase -sid dbase -responseFile NO_VALUE -characterSet AL32UTF8 -memoryPercentage 20 -emConfiguration NONE
Enter SYS user password:
Enter SYSTEM user password:
Copying database files
Creating and starting Oracle instance
Completing Database Creation
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/dbase/dbase.log" for further details.
The database has been created and started successfully.
Verify Database Creation
To verify that database has been created and is up and running you can use the following commands after logging in using SYS.
$ export ORACLE_SID=dbase
$ echo $ORACLE_SID
$ sqlplus / as sysdba
SQL*Plus: Release 22.214.171.124.0 Production on Sat Apr 27 22:31:37 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Oracle Database 11g Enterprise Edition Release 126.96.36.199.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select instance_name from v$instance;
SQL> select name from v$datafile;
SQL> select name from v$tempfile;