Oracle Database 18cR3 Silent Installation on Oracle Linux 7.6

This blog post describes the installation of Oracle Database 18c 64-bit on Oracle Linux 7 (OL7).
An example of the Linux installation can be seen HERE
We will begin by downloading and installing the software required before we can create an Oracle database. This process involves several steps.

Before we begin with the installation we need to verify and configure the required OS components:

  • Memory and swap space
  • System architecture(processor)
  • Free disk space ( Oracle now takes almost 15GB of space to install)
  • Operating system version and kernel
  • Operating system software (required packages and patches)


-- Check Physical RAM.
# grep MemTotal /proc/meminfo    { We need at least 3192 MB of physical RAM. }

-- Check Swap Space.
# grep SwapTotal /proc/meminfo/*
RAM up to 1024MB then swap = 2 times the size of RAM
RAM between 2049MB and 8192MB then swap = equal to the size of RAM

-- Check space available in /tmp
# df -h /tmp/*
We need to have at least 2048 MB of space in the /tmp directory.

-- Check space for Oracle Software and pre-configured database.
# df -h
Space requirement for Oracle 18c Software: EE -> 14G

-- Verify OS version
[oracle@arandy ~]$ cat /etc/oracle-release
Oracle Linux Server release 7.6

STEP 1: Installing Oracle Prerequisites

Perform either the Automatic Setup or the Manual Setup to complete the basic prerequisites.  We will be using the automatic setup which involves installing the "oracle-database-preinstall-18c" package to perform all our prerequisite setup.

Issue the following command as root:

# yum install -y oracle-database-preinstall-18c

It is probably worth doing a full update as well, but this is not strictly necessary.

# yum update -y

STEP 2: Setting Host File

Open “/etc/hosts” file and add a fully qualified hostname for the server.

IP-address  fully-qualified-machine-name  machine-name

Issue the following command as root:
# vi /etc/hosts 
Add the following line at the bottom of the file: (NB! Follow the format above when setting the host file)
192.168.56.101 arandy.cm  arandy


NB!! Make sure you can ping the hostname you added in the host file.

If you can’t ping your hostname make sure you go through the steps again carefully and troubleshot before moving forward.

Step 3: Additional Setup

The following steps must be performed, after the automatic setup.

- Set the password for the "oracle" user.

Issue the following command as root:
# passwd oracle ( This command will prompt for the new password twice)


- Set secure Linux to permissive by editing the "/etc/selinux/config" file, making sure the SELINUX flag is set as follows

SELINUX=permissive

Issue the following command as root:
# vi /etc/selinux/config
change SELINUX=enforcing to SELINUX=permissive


- Disable the Linux firewall
Issue the following command as root:

# systemctl stop firewalld
# systemctl disable firewalld


- Create the directories in which the Oracle software will be installed.
Issue the following command as root:

# mkdir -p /u01/app/oracle/product/18.3.0/dbhome_1
# mkdir -p /u02/oradata
# chown -R oracle:oinstall /u01 /u02
# chmod -R 775 /u01 /u02

- Reboot the server and login in with the oracle user using the password that we set above. Hope you haven’t forgotten your password if you have don’t worry just log in as the root user and reset the password again with passwd command.

 # reboot

- Set Environment variables.
Create a "scripts" directory.
$ mkdir /home/oracle/scripts
Create an environment file called "setEnv.sh".
Issue the following command as oracle: ( you can just copy and paste in the terminal)

cat > /home/oracle/scripts/setEnv.sh <
# Oracle Settings
export TMP=/tmp
export TMPDIR=\$TMP

export ORACLE_HOSTNAME=arandy.cm
export ORACLE_UNQNAME=cdb1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=\$ORACLE_BASE/product/18.3.0/dbhome_1
export ORA_INVENTORY=/u01/app/oraInventory
export ORACLE_SID=cdb1
export PDB_NAME=pdb1
export DATA_DIR=/u02/oradata

export PATH=/usr/sbin:/usr/local/bin:\$PATH
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

- Add a reference to the "setEnv.sh" file at the end of the "/home/oracle/.bash_profile" file.

$ vi /home/oracle/.bash_profile



Step 4: Download Oracle Installation Software

Download the Oracle software from Edelivery: Oracle Database 18c (18.3) Software (64-bit)

Step 4: Unzip the File 

Switch to the ORACLE_HOME directory, unzip the software directly into this path.
(Please note that after you must have downloaded the installation file you have to transfer them into the VM. This can be done with Filezilla or by using the scp command in the terminal.)
I transferred the installation file using the scp command.

Use the unzip command for unbundling zipped file.

$ cd $ORACLE_HOME
$ unzip -oq /home/oracle/orainst/18.3.0/LINUX.X64_180000_db_home.zip

Step 5: Run the Installer

For interactive mode installation, start the Oracle Universal Installer (OUI) by issuing the following command and follow the GUI guided steps

$ ./runInstaller

For silent installation mode which is our method of choice, run the following command in the terminal:

$ ./runInstaller -ignorePrereq -waitforcompletion -silent                        \
    -responseFile ${ORACLE_HOME}/install/response/db_install.rsp               \
    oracle.install.option=INSTALL_DB_SWONLY                                    \
    ORACLE_HOSTNAME=${ORACLE_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.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

Run the root scripts when prompted.
As a root user, execute the following script(s):


Login as root using another terminal and execute the two scripts.

We are now ready to create a database.

Step 6: Database creation

You create a database using the Database Configuration Assistant (DBCA). The interactive mode will display GUI screens to allow user input, while the silent mode will create the database without displaying any screens, as all required options are already specified on the command line.

After successfully installing the database software, start the listener:

$ lsnrctl start



To create the database using the interactive mode, start the Database Configuration Assistance (dbca) by issuing the following command and follow the GUI guided steps
$ dbca


For silent installation mode which is our method of choice, run the following command in the terminal:

$ dbca -silent -createDatabase                                                                                      \
     -templateName General_Purpose.dbc                                                                      \
     -gdbname ${ORACLE_SID} -sid  ${ORACLE_SID} -responseFile NO_VALUE        \
     -characterSet AL32UTF8                                                                                           \
     -sysPassword SysOracle_47                                                                                     \
     -systemPassword SysOracle_47                                                                               \
     -createAsContainerDatabase true                                                                             \
     -numberOfPDBs 1                                                                                                     \
     -pdbName ${PDB_NAME}                                                                                        \
     -pdbAdminPassword PdbPassword1                                                                       \
     -databaseType MULTIPURPOSE                                                                             \
     -automaticMemoryManagement false                                                                      \
     -totalMemory 1536                                                                                                   \
     -storageType FS                                                                                                       \
     -datafileDestination "${DATA_DIR}"                                                                         \
     -redoLogFileSize 50                                                                                                 \
     -emConfiguration NONE                                                                                          \
     -ignorePreReqs



Once the Database 18c successfully created, validate the database using the following command.

SQL> select banner_full from v$version;

BANNER_FULL
----------------------------------------------------------------------------------------------------
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0


SQL> select name,user,created,cdb from v$database;

NAME   USER        CREATED CDB
---------       --------------------     ---------                 ---
CDB1   SYS        25-FEB-19          YES


SQL> select instance_name,status from v$instance;

INSTANCE_NAME STATUS
----------------              ------------
cdb1           OPEN




Hope this helps!!

Caution: Any information or materials on this blog 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.

Thanks,
randyDBA { serving to discover }

Comments