Tag Archives: DBCA silent mode

DBCA silent mode

Create Database in silent mode

1. Overview
2. Set the Environment
3. Create Database using DBCA silent mode
4. Verify


1. Overview

Usually to create database we will use DBCA graphical user interface.

Some times may not have access to a graphical user interface then we can use the DBCA silent mode to create a database.


2. Set the Environment

[oracle@rac2 ~]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/db_1
[oracle@rac2 ~]$ export PATH=$ORACLE_HOME/bin:$PATH
[oracle@rac2 ~]$ which dbca
/u01/app/oracle/product/11.2.0.4/db_1/bin/dbca
[oracle@rac2 ~]$

[oracle@rac2 ~]$ mkdir -p /u01/app/oracle/oradata
[oracle@rac2 ~]$
-- No need to create folder POCNDEV, it will create automatically by dbca


3. Create Database using DBCA silent mode

[oracle@rac2 ~]$ dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbName POCNDEV.rajasekhar.com -sid POCNDEV -sysPassword sys -systemPassword sys -emConfiguration NONE -datafileDestination /u01/app/oracle/oradata -storageType FS -characterSet AL32UTF8
Copying database files
1% complete
3% complete
35% complete
Creating and starting Oracle instance
37% complete
42% complete
47% complete
52% complete
53% complete
56% complete
58% complete
Registering database with Oracle Restart
64% complete
Completing Database Creation
68% complete
71% complete
75% complete
85% complete
96% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/POCNDEV/POCNDEV.log" for further details.
[oracle@rac2 ~]$


4. Verify

[oracle@rac2 ~]$ cat /etc/oratab | grep -i POCNDEV
POCNDEV:/u01/app/oracle/product/11.2.0.4/db_1:N         # line added by Agent
[oracle@rac2 ~]$

[oracle@rac2 ~]$ . oraenv
ORACLE_SID = [oracle] ? POCNDEV
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@rac2 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Wed Dec 21 05:36:47 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select name, open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
POCNDEV   READ WRITE

SQL> archive log list
Database log mode              No Archive Mode <---
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     3
Current log sequence           5
SQL>
SQL> select file_name from dba_data_files;

FILE_NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/POCNDEV/users01.dbf
/u01/app/oracle/oradata/POCNDEV/undotbs01.dbf
/u01/app/oracle/oradata/POCNDEV/sysaux01.dbf
/u01/app/oracle/oradata/POCNDEV/system01.dbf

SQL> select name from v$tempfile;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/POCNDEV/temp01.dbf

SQL>

[oracle@rac2 ~]$ . oraenv
ORACLE_SID = [POCNDEV] ? +ASM
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@rac2 ~]$ lsnrctl status LISTENER | grep -i POCNDEV
Service "POCNDEV.rajasekhar.com" has 1 instance(s).
  Instance "POCNDEV", status READY, has 1 handler(s) for this service...
Service "POCNDEVXDB.rajasekhar.com" has 1 instance(s).
  Instance "POCNDEV", status READY, has 1 handler(s) for this service...
[oracle@rac2 ~]$

TNS Entry Automatically will be added to TNSNAMES.ORA

POCNDEV =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac2.rajasekhar.com)(PORT = 1522))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = POCNDEV.rajasekhar.com)
    )
  )

Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.

Thank you,
Rajasekhar