Instruction

Installing Oracle Database 12c Release 2 on Oracle Linux 7 (Silent Method)

Assumptions

This instruction assumes:

  • Oracle Linux 7.2 or later (x86_64) is installed with a minimal or server profile
  • The kernel is UEK3 (3.8.13-35.3.1 or later), UEK4 (4.1.12-32.2.3 or later), or RHCK (3.10.0-123 or later)
  • Root access is available
  • The server has internet access to Oracle Linux YUM repositories (or is subscribed to ULN)
  • At least 10 GB of free disk space in /u01 for the Oracle home and software
  • At least 1 GB of free space in /tmp
  • At least 2 GB of RAM (4 GB recommended)
  • The linuxx64_12201_database.zip file has been downloaded from oracle.com and transferred to the server
  • No prior Oracle Database installation exists on this host
  • Filesystem storage is used (not ASM -- ASM requires Grid Infrastructure, covered in a separate instruction)
  • This is a single-instance installation

Prerequisites

Automatic setup

The oracle-database-server-12cR2-preinstall RPM configures the OS for Oracle Database installation.

As root:

yum install -y oracle-database-server-12cR2-preinstall

This package creates:

  • The oracle user (UID 54321) and groups: oinstall (54321), dba (54322), oper (54323), backupdba (54324), dgdba (54325), kmdba (54326), racdba (54327)
  • Kernel parameters in /etc/sysctl.d/ including fs.file-max=6815744, kernel.sem=250 32000 100 128, kernel.shmmax=4398046511104, kernel.shmall=2097152, kernel.shmmni=4096, fs.aio-max-nr=1048576, net.ipv4.ip_local_port_range=9000 65500, net.core.rmem_default=262144, net.core.rmem_max=4194304, net.core.wmem_default=262144, net.core.wmem_max=1048576
  • Resource limits in /etc/security/limits.d/oracle-database-server-12cR2-preinstall.conf: nofile (1024/65536), nproc (16384/16384), stack (10240/32768), memlock (134217728/134217728)
  • Required OS packages: binutils, compat-libcap1, compat-libstdc++-33, gcc, gcc-c++, glibc, glibc-devel, ksh, libaio, libaio-devel, libgcc, libstdc++, libstdc++-devel, libXi, libXtst, make, sysstat, zip, unzip

Manual setup

For environments where the preinstall RPM is unavailable (RHEL 7, policy restrictions), perform these steps as root.

  1. Create OS groups
groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
groupadd -g 54324 backupdba
groupadd -g 54325 dgdba
groupadd -g 54326 kmdba
groupadd -g 54327 racdba
  1. Create the oracle user
useradd -u 54321 -g oinstall -G dba,oper,backupdba,dgdba,kmdba,racdba oracle
  1. Install required packages
yum -y install binutils compat-libcap1 compat-libstdc++-33 \
  gcc gcc-c++ glibc glibc.i686 glibc-devel glibc-devel.i686 \
  ksh libaio libaio.i686 libaio-devel libaio-devel.i686 \
  libgcc libgcc.i686 libstdc++ libstdc++.i686 \
  libstdc++-devel libstdc++-devel.i686 \
  libXi libXi.i686 libXtst libXtst.i686 \
  make sysstat zip unzip
  1. Set kernel parameters
cat > /etc/sysctl.d/98-oracle-database-sysctl.conf <<'EOF'
fs.file-max = 6815744
fs.aio-max-nr = 1048576
kernel.shmmax = 4398046511104
kernel.shmall = 2097152
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.ip_local_port_range = 9000 65500
EOF
sysctl --system

Expected output:

* Applying /etc/sysctl.d/98-oracle-database-sysctl.conf ...
fs.file-max = 6815744
fs.aio-max-nr = 1048576
...
  1. Configure resource limits
cat > /etc/security/limits.d/98-oracle-database-limits.conf <<'EOF'
oracle soft nofile  1024
oracle hard nofile  65536
oracle soft nproc   16384
oracle hard nproc   16384
oracle soft stack   10240
oracle hard stack   32768
oracle hard memlock 134217728
oracle soft memlock 134217728
EOF

Additional setup

These steps are required regardless of whether you used the automatic or manual setup above. Perform all steps as root unless noted otherwise.

  1. Set the oracle user password

The preinstall RPM creates the oracle user without a password.

passwd oracle
  1. Configure the hostname
hostnamectl set-hostname {HOSTNAME}.localdomain

{HOSTNAME} -- the short hostname for this server (e.g., ol7-122).

  1. Add the hostname to /etc/hosts
echo "{IP_ADDRESS}  {HOSTNAME}.localdomain  {HOSTNAME}" >> /etc/hosts

{IP_ADDRESS} -- the server's primary IP address (e.g., 192.168.1.100).

Verify:

hostname -f

Expected output:

ol7-122.localdomain
  1. Set SELinux to permissive
sed -i 's/^SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config
setenforce Permissive

Verify:

getenforce

Expected output:

Permissive
  1. Disable firewalld or open port 1521

To disable firewalld:

systemctl stop firewalld
systemctl disable firewalld

Alternatively, to keep firewalld enabled and open the listener port:

firewall-cmd --permanent --add-port=1521/tcp
firewall-cmd --reload
  1. Configure RemoveIPC

Warning: On Oracle Linux 7.2 and later, systemd removes IPC resources (shared memory segments and semaphores) when the last session for a non-system user ends. This will crash a running Oracle Database instance. This setting is mandatory.

sed -i '/^[#]*RemoveIPC/d' /etc/systemd/logind.conf
echo 'RemoveIPC=no' >> /etc/systemd/logind.conf

Verify the setting:

grep RemoveIPC /etc/systemd/logind.conf

Expected output:

RemoveIPC=no

Restart the systemd-logind service:

systemctl restart systemd-logind
  1. Configure swap space
RAM Required Swap
Up to 2 GB 1x RAM
2 GB -- 8 GB 1x RAM
8 GB -- 16 GB 1x RAM
Greater than 16 GB 16 GB

Check current swap:

free -h

If swap is insufficient, add a swap file (example for 4 GB):

dd if=/dev/zero of=/swapfile bs=1M count=4096
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap sw 0 0' >> /etc/fstab
  1. Create directory structure
mkdir -p /u01/app/oracle/product/12.2.0.1/db_1
mkdir -p /u01/app/oraInventory
mkdir -p /u02/oradata
chown -R oracle:oinstall /u01 /u02
chmod -R 775 /u01 /u02
  1. Create the environment script

As the oracle user:

su - oracle
mkdir -p /home/oracle/scripts
cat > /home/oracle/scripts/setEnv.sh <<'EOF'
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0.1/db_1
export ORA_INVENTORY=/u01/app/oraInventory
export ORACLE_SID=orcl
export DATA_DIR=/u02/oradata
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
EOF

The script above uses orcl as the database instance name (ORACLE_SID). Edit ORACLE_SID and DATA_DIR in the script if you want different names or paths. The remaining environment variables (ORACLE_HOME, ORACLE_BASE) match the directory structure created in step 8.

  1. Source the environment script from .bash_profile

As the oracle user:

echo '. /home/oracle/scripts/setEnv.sh' >> /home/oracle/.bash_profile
source /home/oracle/.bash_profile

Verify:

echo $ORACLE_HOME

Expected output:

/u01/app/oracle/product/12.2.0.1/db_1

Installation

Step 1: Extract the software

As the oracle user, extract the ZIP file to a staging directory. The archive creates a database/ directory containing the installer.

cd /tmp
unzip -oq /path/to/linuxx64_12201_database.zip

Replace /path/to/linuxx64_12201_database.zip with the actual path to the downloaded file.

Verify:

ls /tmp/database/runInstaller

Expected output:

/tmp/database/runInstaller

Step 2: Run the silent installer

As the oracle user, run the software-only installation from the staging directory:

cd /tmp/database
./runInstaller -ignoreSysPrereqs -ignorePrereq -waitforcompletion \
  -showProgress -silent \
  -responseFile /tmp/database/response/db_install.rsp \
  oracle.install.option=INSTALL_DB_SWONLY \
  ORACLE_HOSTNAME=${HOSTNAME} \
  UNIX_GROUP_NAME=oinstall \
  INVENTORY_LOCATION=${ORA_INVENTORY} \
  SELECTED_LANGUAGES=en,en_GB \
  ORACLE_HOME=${ORACLE_HOME} \
  ORACLE_BASE=${ORACLE_BASE} \
  oracle.install.db.InstallEdition=EE \
  oracle.install.db.OSDBA_GROUP=dba \
  oracle.install.db.OSOPER_GROUP=oper \
  oracle.install.db.OSBACKUPDBA_GROUP=dba \
  oracle.install.db.OSDGDBA_GROUP=dba \
  oracle.install.db.OSKMDBA_GROUP=dba \
  oracle.install.db.OSRACDBA_GROUP=dba \
  SECURITY_UPDATES_VIA_MYORACLESUPPORT=false \
  DECLINE_SECURITY_UPDATES=true

The installer runs prerequisite checks and installs the software. This takes several minutes.

Expected output:

Starting Oracle Universal Installer...

Checking Temp space: must be greater than 500 MB.   Actual 5800 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 4096 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall...
...
You can find the log of this install session at:
 /u01/app/oraInventory/logs/installActions2026-02-24_10-00-00AM.log

...
Successfully Setup Software with warning(s).
As a root user, execute the following script(s):
	1. /u01/app/oraInventory/orainstRoot.sh
	2. /u01/app/oracle/product/12.2.0.1/db_1/root.sh

Step 3: Execute the root scripts

As root, run the two scripts in order:

/u01/app/oraInventory/orainstRoot.sh

Expected output:

Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
/u01/app/oracle/product/12.2.0.1/db_1/root.sh

Expected output:

Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/12.2.0.1/db_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:

Press Enter to accept the default /usr/local/bin.

Step 4: Start the listener

As the oracle user, create and start a default listener using NetCA with the response file from the staging directory (the /tmp/database directory from Step 1 must still be present):

netca -silent -responseFile /tmp/database/response/netca.rsp

Expected output:

Parsing command line arguments:
    Parameter "silent" = true
    Parameter "responsefile" = /tmp/database/response/netca.rsp
Done parsing command line arguments.
...
Listener Control:
  Status READY
  Listener LISTENER is already running.
Oracle Net Listener Startup:
    Running Listener Control:
      /u01/app/oracle/product/12.2.0.1/db_1/bin/lsnrctl start LISTENER
    Listener Control complete.
    Listener started successfully.
Listener configuration complete.
...
Oracle Net Services configuration successful. The exit code is 0

Verify:

lsnrctl status

Expected output:

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 24-FEB-2026 10:20:00

...

Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ol7-122.localdomain)(PORT=1521)))
The listener supports no services
The command completed successfully

The listener shows "no services" because no database has been created yet.

Step 5: Create the database

Warning: The -characterSet AL32UTF8 parameter sets the database character set. This choice is permanent and cannot be changed after database creation. AL32UTF8 supports all Unicode characters and is the recommended choice.

Warning: The passwords below will be visible in ps output and shell history while the command runs. To suppress history recording, run unset HISTFILE before executing the command.

As the oracle user:

dbca -silent -createDatabase \
  -templateName General_Purpose.dbc \
  -gdbname ${ORACLE_SID} \
  -sid ${ORACLE_SID} \
  -characterSet AL32UTF8 \
  -sysPassword {SYS_PASSWORD} \
  -systemPassword {SYSTEM_PASSWORD} \
  -databaseType MULTIPURPOSE \
  -memoryMgmtType auto_sga \
  -totalMemory 2048 \
  -storageType FS \
  -datafileDestination "${DATA_DIR}" \
  -redoLogFileSize 50 \
  -emConfiguration NONE \
  -ignorePreReqs

{SYS_PASSWORD} -- password for the SYS account (minimum 8 characters, must include uppercase, lowercase, and digit).

{SYSTEM_PASSWORD} -- password for the SYSTEM account (same requirements).

The -totalMemory 2048 parameter allocates 2048 MB to the database instance. On systems with more RAM, increase this value (e.g., 4096 for 8 GB RAM, 8192 for 16 GB RAM).

Database creation takes 10-30 minutes depending on hardware.

Expected output:

Copying database files
1% complete
...
Creating and starting Oracle instance
...
50% complete
...
Completing Database Creation
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details.

Step 6: Edit /etc/oratab

Switch to the root user (exit the oracle user session or open a new terminal as root). Edit /etc/oratab and change the restart flag from N to Y. If you changed ORACLE_SID from orcl, replace orcl in this command with your chosen SID.

sed -i 's|^orcl:/u01/app/oracle/product/12.2.0.1/db_1:N|orcl:/u01/app/oracle/product/12.2.0.1/db_1:Y|' /etc/oratab

Verify:

grep -v "^#" /etc/oratab | grep -v "^$"

Expected output:

orcl:/u01/app/oracle/product/12.2.0.1/db_1:Y

Post-installation

Step 1: Create startup and shutdown scripts

As the oracle user:

cat > /home/oracle/scripts/start_all.sh <<'EOF'
#!/bin/bash
. /home/oracle/scripts/setEnv.sh

export ORAENV_ASK=NO
. oraenv
export ORAENV_ASK=YES

dbstart $ORACLE_HOME
EOF
cat > /home/oracle/scripts/stop_all.sh <<'EOF'
#!/bin/bash
. /home/oracle/scripts/setEnv.sh

export ORAENV_ASK=NO
. oraenv
export ORAENV_ASK=YES

dbshut $ORACLE_HOME
EOF
chmod u+x /home/oracle/scripts/start_all.sh /home/oracle/scripts/stop_all.sh

These scripts use dbstart and dbshut, which read /etc/oratab to determine which instances to start and stop. The Y flag set in Step 6 enables this.

Step 2: Clean up the staging directory

After confirming the installation and database creation succeeded, remove the staging directory to free disk space:

rm -rf /tmp/database

Verify:

ls /tmp/database 2>/dev/null && echo "Directory still exists" || echo "Cleanup complete"

Expected output:

Cleanup complete

Validation

Quick check

As the oracle user:

sqlplus / as sysdba <<'EOF'
SELECT banner FROM v$version WHERE ROWNUM = 1;
EXIT;
EOF

Expected output:

BANNER
--------------------------------------------------------------------------------
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

Full validation

  1. Verify database status
sqlplus / as sysdba <<'EOF'
SELECT name, open_mode FROM v$database;
EXIT;
EOF

Expected output:

NAME      OPEN_MODE
--------- --------------------
ORCL      READ WRITE
  1. Verify the compatible parameter
sqlplus / as sysdba <<'EOF'
SHOW PARAMETER compatible;
EXIT;
EOF

Expected output:

NAME        TYPE   VALUE
----------- ------ ----------
compatible  string 12.2.0
  1. Verify data file locations
sqlplus / as sysdba <<'EOF'
SELECT name FROM v$datafile;
EXIT;
EOF

Expected output:

NAME
----------------------------------------------------------------------
/u02/oradata/orcl/system01.dbf
/u02/oradata/orcl/sysaux01.dbf
/u02/oradata/orcl/undotbs01.dbf
/u02/oradata/orcl/users01.dbf

All data files should be under /u02/oradata.

  1. Verify listener status
lsnrctl status

Expected output:

...
Services Summary...
Service "orcl" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
  1. Verify network connectivity through the listener
sqlplus sys/{SYS_PASSWORD}@//localhost:1521/orcl as sysdba <<'EOF'
SELECT 'Listener connection successful' AS status FROM dual;
EXIT;
EOF

Replace {SYS_PASSWORD} with the SYS password set during database creation.

Expected output:

STATUS
------------------------------
Listener connection successful
  1. Verify oratab entry
grep -v "^#" /etc/oratab | grep -v "^$"

Expected output:

orcl:/u01/app/oracle/product/12.2.0.1/db_1:Y

Troubleshooting

Problem Cause Solution
[INS-13001] Environment does not meet minimum requirements Kernel parameters or package dependencies are missing Install the preinstall RPM: yum install -y oracle-database-server-12cR2-preinstall and re-run
[INS-30131] Initial setup required for the execution of installer validations ORACLE_HOME directory is not owned by the oracle user Run chown -R oracle:oinstall /u01 as root
ORA-01034: ORACLE not available Database instance is not started Run sqlplus / as sysdba then STARTUP;
ORA-12162: TNS:net service name is incorrectly specified ORACLE_SID environment variable is not set Run source /home/oracle/scripts/setEnv.sh
TNS-12541: TNS:no listener Listener is not running Start with lsnrctl start
DBCA fails: Insufficient memory -totalMemory exceeds available RAM Reduce the -totalMemory value or add more RAM/swap
ORA-27301: OS failure message: No such file or directory / ORA-27302: failure occurred at: sskgpshm RemoveIPC=yes in /etc/systemd/logind.conf caused systemd to remove shared memory Set RemoveIPC=no in /etc/systemd/logind.conf and run systemctl restart systemd-logind
Listener running but no services registered Database was created before listener was started, or dynamic registration has not occurred Restart the listener: lsnrctl stop && lsnrctl start, or run ALTER SYSTEM REGISTER; in sqlplus
Permission denied running runInstaller from staging directory The staging directory or runInstaller does not have execute permission for the oracle user Run chmod -R 755 /tmp/database as the oracle user
root.sh prompts for local bin directory Normal behavior Press Enter to accept the default /usr/local/bin

References