Install Oracle 12.1 Software and Create database in Silent Mode

In this Topic, I will show how to install Oracle 12.1.0.2 Software only and Create database using DBCA by silent mode.

Oracle Installation Prerequisites:

Add following kernel parameters on /etc/sysctl.conf.

s.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500

Run following command to verify and output will be like below:

[root@proddb ~]# /sbin/sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576

Add following kernel parameters on /etc/security/limits.conf.

oracle   soft   nofile    1024
oracle   hard   nofile    65536
oracle   soft   nproc    16384
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768

Install oracle database related packages: If you have internet connection then you can install from public Yum.

yum install binutils -y
yum install compat-libcap1 -y
yum install compat-libstdc++-33 -y
yum install compat-libstdc++-33.i686 -y
yum install gcc -y
yum install gcc-c++ -y
yum install glibc -y
yum install glibc.i686 -y
yum install glibc-devel -y
yum install glibc-devel.i686 -y
yum install ksh -y
yum install libgcc -y
yum install libgcc.i686 -y
yum install libstdc++ -y
yum install libstdc++.i686 -y
yum install libstdc++-devel -y
yum install libstdc++-devel.i686 -y
yum install libaio -y
yum install libaio.i686 -y
yum install libaio-devel -y
yum install libaio-devel.i686 -y
yum install libXext -y
yum install libXext.i686 -y
yum install libXtst -y
yum install libXtst.i686 -y
yum install libX11 -y
yum install libX11.i686 -y
yum install libXau -y
yum install libXau.i686 -y
yum install libxcb -y
yum install libxcb.i686 -y
yum install libXi -y
yum install libXi.i686 -y
yum install make -y
yum install sysstat -y
yum install unixODBC -y
yum install unixODBC-devel -y

Create groups and user:

groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
# Below group can be created if you want to separate the responsibility like backup team need to access the database backup. 
groupadd -g 54324 backupdba
groupadd -g 54325 dgdba
groupadd -g 54326 kmdba
# Below group can be created if you use GRID Infrastructure even for Stand alone DB
groupadd -g 54327 asmdba
groupadd -g 54328 asmoper
groupadd -g 54329 asmadmin

useradd -u 54321 -g oinstall -G dba,oper oracle

Create required directories:

mkdir -p /u01/app/oracle/product/12.1.0.2/dbhome_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01

Set secure Linux to permissive by editing the “/etc/selinux/config” file or use “setenforce Permissive” and reboot the server.

[root@proddb ~]# setenforce Permissive
[root@proddb ~]# cat /etc/selinux/config | grep SELINUX
# SELINUX= can take one of these three values:
SELINUX=permissive
# SELINUXTYPE= can take one of these two values:
SELINUXTYPE=targeted

Install Oracle 12c Software in Silent Mode:

Prepare the response file with required Input:

Copy the response file from Software unzipped location to any other location and change the file.

[oracle@ocm12c response]$ pwd
/u01/software/database/response

[oracle@ocm12c response]$ ls -l
total 112
-rwxrwxr-x. 1 oracle oinstall 74822 Apr  4  2014 dbca.rsp
-rw-rw-r--. 1 oracle oinstall 25134 Aug 19 14:15 db_install.rsp
-rwxrwxr-x. 1 oracle oinstall  6038 Jan 24  2014 netca.rsp

[oracle@ocm12c response]$ cp db_install.rsp /u01/software/database

[oracle@ocm12c database]$ pwd
/u01/software/database
[oracle@ocm12c database]$ ls -l db_install.rsp
total 40
-rw-r--r--.  1 oracle oinstall  838 Aug 19 14:07 db_install.rsp

Provide values in below mentioned parameters:

## specify the installation option 
oracle.install.option=INSTALL_DB_SWONLY
 
# specify the Unix group for the inventory directory
UNIX_GROUP_NAME=dba
 
# specify the Inventory, Oracle Home and Base directories
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_2
ORACLE_BASE=/u01/app/oracle
 
# specify the installation edition (Enterprise Edition)
oracle.install.db.InstallEdition=EE

# specify Unix groups for DBA, OPER and BACKUPDBA privileges
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
oracle.install.db.BACKUPDBA_GROUP=dba
oracle.install.db.DGDBA_GROUP=dba
oracle.install.db.KMDBA_GROUP=dba

# specify whether to enable the user to provide the password for Oracle My Support credentials
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false

# specify whether user doesn’t want to configure security updates 
DECLINE_SECURITY_UPDATES=true

Trigger runInstaller using response file:

[oracle@ocm12c database]$ pwd
/u01/software/database
[oracle@ocm12c database]$ ls -l
total 40
-rw-r--r--.  1 oracle oinstall  838 Aug 19 14:07 db_install.rsp
drwxr-xr-x.  4 oracle oinstall 4096 Aug 18 19:48 install
drwxrwxr-x.  2 oracle oinstall 4096 Jul  7  2014 response
drwxr-xr-x.  2 oracle oinstall 4096 Jul  7  2014 rpm
-rwxr-xr-x.  1 oracle oinstall 8533 Jul  7  2014 runInstaller
drwxrwxr-x.  2 oracle oinstall 4096 Jul  7  2014 sshsetup
drwxr-xr-x. 14 oracle oinstall 4096 Jul  7  2014 stage
-rwxr-xr-x.  1 oracle oinstall  500 Feb  6  2013 welcome.html

[oracle@ocm12c database]$ ./runInstaller -silent -responseFile /u01/software/database/db_install.rsp -ignoreSysPrereqs
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 500 MB.   Actual 20703 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 4030 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2020-08-19_02-31-19PM. Please wait ...[oracle@ocm12c database]$ [WARNING] [INS-13014] Target environment does not meet some optional requirements.
   CAUSE: Some of the optional prerequisites are not met. See logs for details. /u01/app/oraInventory/logs/installActions2020-08-19_02-31-19PM.log
   ACTION: Identify the list of failed prerequisite checks from the log: /u01/app/oraInventory/logs/installActions2020-08-19_02-31-19PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
You can find the log of this install session at:
 /u01/app/oraInventory/logs/installActions2020-08-19_02-31-19PM.log
The installation of Oracle Database 12c was successful.
Please check '/u01/app/oraInventory/logs/silentInstall2020-08-19_02-31-19PM.log' for more details.

As a root user, execute the following script(s):
        1. /u01/app/oracle/product/12.1.0/dbhome_2/root.sh

Successfully Setup Software.
[oracle@ocm12c ~]$ su - root
Password:
[root@ocm12c ~]# /u01/app/oracle/product/12.1.0/dbhome_2/root.sh
Check /u01/app/oracle/product/12.1.0/dbhome_2/install/root_ocm12c.localdomain_2020-08-19_14-36-58.log for the output of root script
[root@ocm12c ~]# cat /u01/app/oracle/product/12.1.0/dbhome_2/install/root_ocm12c.localdomain_2020-08-19_14-36-58.log
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/12.1.0/dbhome_2
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.

Create Database Using DBCA with Silent Mode:

[oracle@ocm12c database]$ echo $PATH
/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin:/u01/app/oracle/product/12.1.0/dbhome_2/bin
[oracle@ocm12c database]$ echo $ORACLE_HOME
/u01/app/oracle/product/12.1.0/dbhome_2

[oracle@ocm12c dbhome_2]$ dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname mydb -sid mydb -createAsContainerDatabase true -responseFile NO_VALUE -characterSet AL32UTF8 -memoryPercentage 30 -emConfiguration LOCAL
Enter SYS user password: 
 
Enter SYSTEM user password: 
 
Copying database files
1% complete
3% complete
11% complete
18% complete
26% complete
37% complete
Creating and starting Oracle instance
40% complete
45% complete
46% complete
47% complete
52% complete
57% complete
58% complete
59% complete
62% complete
Completing Database Creation
66% complete
70% complete
74% complete
85% complete
96% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/mydb/mydb.log" for further details.
Create Database using DBCA Log:
[oracle@ocm12c database]$ cat /u01/app/oracle/cfgtoollogs/dbca/mydb/mydb.log

Unique database identifier check passed.

/ has enough space. Required space is 6900 MB , available space is 15367 MB.
File Validations Successful.
Copying database files
DBCA_PROGRESS : 1%
DBCA_PROGRESS : 3%
DBCA_PROGRESS : 11%
DBCA_PROGRESS : 18%
DBCA_PROGRESS : 26%
DBCA_PROGRESS : 37%
Creating and starting Oracle instance
DBCA_PROGRESS : 40%
DBCA_PROGRESS : 45%
DBCA_PROGRESS : 46%
DBCA_PROGRESS : 47%
DBCA_PROGRESS : 52%
DBCA_PROGRESS : 57%
DBCA_PROGRESS : 58%
DBCA_PROGRESS : 59%
DBCA_PROGRESS : 62%
Completing Database Creation
DBCA_PROGRESS : 66%
DBCA_PROGRESS : 70%
DBCA_PROGRESS : 74%
DBCA_PROGRESS : 85%
DBCA_PROGRESS : 96%
DBCA_PROGRESS : 100%
Database creation complete. For details check the logfiles at:
 /u01/app/oracle/cfgtoollogs/dbca/mydb.
Database Information:
Global Database Name:mydb
System Identifier(SID):mydb

2 comments

    • Philippe on at

    Hello,

    Very good note.
    Can you explain “kernel.sysrq = 0” parameter ?

    Best regards,

    Philippe

    • Philippe on at

    Hello,

    Can you explain kernel.sysrq = 0 ?

    does it prevent from unexpected reboot ?

    Best regards,

    Philippe

Comments have been disabled.