2. Oracle Database 12c Release 1 (12.1) Installation on Oracle Linux 8 (OL8)

 

Oracle Database 12c Release 1 (12.1) Installation on Oracle Linux 8 (OL8)

Introduction

This article provides a complete, step-by-step guide for installing Oracle Database 12c Release 1 (12.1) 64-bit on Oracle Linux 8 (OL8) 64-bit. The guide covers everything from downloading the software to creating a database and performing post-installation tasks.

The installation is based on a server configuration with a minimum of 2 GB swap space and secure Linux set to permissive. This guide assumes a basic familiarity with Linux command-line operations.

Note: Oracle Database 12.1 is not officially certified on Oracle Linux 8. However, by faking the OS version using the CV_ASSUME_DISTID environment variable, the installation can be made to work. For production environments, always use a certified combination of Oracle Database and Oracle Linux.


Overview of the Installation Process

#PhaseDescription
1Download SoftwareObtain the Oracle 12.1 installation media
2Unpack FilesExtract the installation files
3Hosts FileConfigure the server's hostname
4Oracle Installation PrerequisitesAutomatic or manual setup
5Additional SetupSteps required for all installations
6InstallationRun the Oracle Universal Installer (OUI)
7Database CreationCreate a database using DBCA
8Post InstallationConfigure automatic startup

Phase 1: Download Software

Download the Oracle Database 12c Release 1 (12.1.0.2) software from one of the following sources:

SourceDescription
OTNOracle Technology Network — Oracle Database 12c Release 1 (12.1.0.2) Software (64-bit)
eDeliveryOracle Software Delivery Cloud — Oracle Database 12c Release 1 (12.1.0.2) Software (64-bit)

Note: Access to OTN is free, but access to eDelivery may require a support contract.


Phase 2: Unpack Files

Unzip the downloaded files:

bash
unzip linuxamd64_12102_database_1of2.zip
unzip linuxamd64_12102_database_2of2.zip

Result: You should now have a single directory called database containing the installation files.


Phase 3: Configure the Hosts File

The /etc/hosts file must contain a fully qualified name for the server.

Format:

text
<IP-address>  <fully-qualified-machine-name>  <machine-name>

Example:

text
127.0.0.1       localhost localhost.localdomain localhost4 localhost4.localdomain4
192.168.0.215   ol8.localdomain  ol8

Set the hostname in /etc/hostname:

text
ol8.localdomain

Important: The hostname must be resolvable both forward and backward. Verify with hostname and ping ol8.localdomain.


Phase 4: Oracle Installation Prerequisites

You can perform the prerequisites either automatically (using a preinstall package) or manually.

Option A: Automatic Setup

At the time of writing, there is no preinstall package for 12.1, but the 19c preinstall package can be used:

bash
# Install the preinstall package
yum install -y oracle-database-preinstall-19c

# Perform a full system update
yum update -y

Tip: It is worth running all the YUM commands listed in the manual setup section as well, since some additional packages may be needed depending on your OS package groups.

Option B: Manual Setup

If you have not used the preinstall package, perform the following steps manually.

Step 1: Configure Kernel Parameters

Add the following lines to /etc/sysctl.conf (or create a file called /etc/sysctl.d/98-oracle.conf):

bash
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
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.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500

Apply the changes:

bash
/sbin/sysctl -p
# Or
/sbin/sysctl -p /etc/sysctl.d/98-oracle.conf

Step 2: Configure User Limits

Create a file called /etc/security/limits.d/oracle-rdbms-server-12cR1-preinstall.conf with the following content:

bash
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

Step 3: Install Required Packages

Install the required packages, including the 32-bit versions where applicable:

bash
yum install binutils -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
yum install zlib-devel -y
yum install zlib-devel.i686 -y

Step 4: Create Groups and Users

Create the required groups and users:

bash
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 asmdba
#groupadd -g 54328 asmoper
#groupadd -g 54329 asmadmin

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

Note: Uncomment the extra groups you require (e.g., backupdba, dgdba, kmdba for advanced features).


Phase 5: Additional Setup

The following steps are required regardless of whether you performed the manual or automatic setup.

Step 1: Set the Oracle User Password

bash
passwd oracle

Step 2: Set SELinux to Permissive

Edit /etc/selinux/config and set:

text
SELINUX=permissive

Apply the change:

bash
# setenforce Permissive

Note: Alternatively, restart the server for the change to take effect.

Step 3: Disable the Firewall

bash
# systemctl stop firewalld
# systemctl disable firewalld

Note: In production environments, configure the firewall to allow Oracle ports instead of disabling it entirely.

Step 4: Create Oracle Directories

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

Important: Mount points should ideally be separate disks rather than directories under /. Putting mount points directly under root is done here for simplicity, but for a real installation, / storage should be reserved for the OS.

Step 5: Configure X11 Access (If Using GUI)

If you are not working from the console or using SSH tunnelling, log in as root and issue:

bash
xhost +<machine-name>

Step 6: Create Environment Scripts

Create a scripts directory:

bash
mkdir /home/oracle/scripts

Create setEnv.sh:

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

export ORACLE_HOSTNAME=ol8-121.localdomain
export ORACLE_UNQNAME=cdb1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=\$ORACLE_BASE/product/12.1.0.2/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

Note: The $ characters are escaped using \ because the script is created using the cat command. If you create the file manually, remove the escape characters.

Add a reference to .bash_profile:

bash
echo ". /home/oracle/scripts/setEnv.sh" >> /home/oracle/.bash_profile

Create start_all.sh and stop_all.sh:

bash
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

chown -R oracle:oinstall /home/oracle/scripts
chmod u+x /home/oracle/scripts/*.sh

Result: Once the installation is complete and /etc/oratab is edited, you can start/stop the database with:

bash
~/scripts/start_all.sh
~/scripts/stop_all.sh

Phase 6: Installation

Step 1: Log In as Oracle User

bash
su - oracle

If using X emulation, set the DISPLAY variable:

bash
DISPLAY=<machine-name>:0.0; export DISPLAY

Step 2: Unzip the Installation Media

bash
cd /u01/software
unzip -oq "linuxamd64_12102_database_*of2.zip"

Step 3: Fake the OS Version

bash
export CV_ASSUME_DISTID=OEL7.6

Important: This step is required because Oracle Database 12.1 is not certified on Oracle Linux 8. The CV_ASSUME_DISTID environment variable tricks the installer into thinking it's running on Oracle Linux 7.6.

Step 4: Run the Installer

Interactive Mode (GUI):

bash
./runInstaller

Silent Mode:

bash
./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

Step 5: Run the Root Scripts

When prompted, run the following scripts as root:

bash
/u01/app/oraInventory/orainstRoot.sh
/u01/app/oracle/product/12.1.0.2/dbhome_1/root.sh

Note: The exact paths may vary depending on your ORACLE_HOME and inventory location.

Tip: It's better to patch the installation first if you have access to Oracle Support before creating the database.


Phase 7: Database Creation

Create a database using the Database Configuration Assistant (DBCA).

Step 1: Start the Listener

bash
lsnrctl start

Step 2: Run DBCA

Interactive Mode (GUI):

bash
dbca

Silent Mode:

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

Note: Replace SysPassword1 and PdbPassword1 with secure passwords of your choice. The -totalMemory 2000 parameter sets the total memory to 2 GB; adjust based on your server's resources.


Phase 8: Post Installation

Edit the /etc/oratab file and set the restart flag for each instance to Y:

text
cdb1:/u01/app/oracle/product/12.1.0.2/db_1:Y

Purpose: The Y flag enables automatic startup of the database when the server boots, using the dbstart utility.


The Complete Installation Flow

text
┌─────────────────────────────────────────────────────────────────┐
│  1. DOWNLOAD SOFTWARE                                           │
│     Oracle Database 12c Release 1 (12.1.0.2) 64-bit             │
└──────────────────────────┬──────────────────────────────────────┘
                           │
                           ▼
┌─────────────────────────────────────────────────────────────────┐
│  2. UNPACK FILES                                                │
│     unzip linuxamd64_12102_database_1of2.zip                    │
│     unzip linuxamd64_12102_database_2of2.zip                    │
└──────────────────────────┬──────────────────────────────────────┘
                           │
                           ▼
┌─────────────────────────────────────────────────────────────────┐
│  3. HOSTS FILE                                                  │
│     Configure /etc/hosts and /etc/hostname                      │
└──────────────────────────┬──────────────────────────────────────┘
                           │
                           ▼
┌─────────────────────────────────────────────────────────────────┐
│  4. PREREQUISITES                                               │
│     Automatic: yum install oracle-database-preinstall-19c       │
│     Manual: sysctl, limits, packages, groups, users             │
└──────────────────────────┬──────────────────────────────────────┘
                           │
                           ▼
┌─────────────────────────────────────────────────────────────────┐
│  5. ADDITIONAL SETUP                                            │
│     Password, SELinux, firewall, directories, scripts           │
└──────────────────────────┬──────────────────────────────────────┘
                           │
                           ▼
┌─────────────────────────────────────────────────────────────────┐
│  6. INSTALLATION                                                │
│     export CV_ASSUME_DISTID=OEL7.6                              │
│     ./runInstaller (interactive or silent)                      │
│     Run root scripts                                            │
└──────────────────────────┬──────────────────────────────────────┘
                           │
                           ▼
┌─────────────────────────────────────────────────────────────────┐
│  7. DATABASE CREATION                                           │
│     lsnrctl start                                               │
│     dbca (interactive or silent)                                │
└──────────────────────────┬──────────────────────────────────────┘
                           │
                           ▼
┌─────────────────────────────────────────────────────────────────┐
│  8. POST INSTALLATION                                           │
│     Edit /etc/oratab and set the restart flag to Y              │
└─────────────────────────────────────────────────────────────────┘

Key Configuration Files

FilePurpose
/etc/hostsHostname resolution
/etc/hostnameServer hostname
/etc/sysctl.confKernel parameters
/etc/security/limits.d/oracle-rdbms-server-12cR1-preinstall.confUser limits
/etc/selinux/configSELinux mode
/home/oracle/scripts/setEnv.shOracle environment variables
/home/oracle/.bash_profileShell profile
/etc/oratabDatabase startup configuration

Best Practices

PracticeDescription
Use Certified CombinationsFor production, use certified OS and database versions
Use Separate Mount PointsMount /u01, /u02, etc. on separate disks
Configure the FirewallInstead of disabling, configure ports (1521, etc.)
Set Secure PasswordsUse strong passwords for SYS, SYSTEM, and PDB admin
Patch Before Creating DBApply the latest patches before creating the database
Use Silent Mode for AutomationSilent installs are ideal for scripting and automation
Test the InstallationVerify connectivity and basic operations after installation
Document ConfigurationKeep a record of all parameters and settings

Troubleshooting Common Issues

IssuePossible CauseSolution
Prerequisite check failsMissing packagesInstall required packages via yum
Installer won't startDISPLAY not setSet the DISPLAY variable or use silent mode
OS version not supportedOracle Linux 8 not certifiedUse CV_ASSUME_DISTID=OEL7.6
Root script failsWrong permissionsRun as root and verify paths
DBCA failsListener not runningStart the listener with lsnrctl start
Database won't startWrong ORACLE_HOMEVerify environment variables
Memory errorsInsufficient memoryIncrease server memory or reduce SGA
Firewall blocks connectionsFirewall enabledConfigure or disable the firewall

Summary

Installing Oracle Database 12c Release 1 (12.1) on Oracle Linux 8 involves the following key phases:

  1. Download Software: Obtain the installation media from OTN or eDelivery

  2. Unpack Files: Extract the installation files

  3. Hosts File: Configure the server's hostname

  4. Prerequisites: Install required packages, kernel parameters, and user limits

  5. Additional Setup: Set passwords, SELinux, firewall, directories, and scripts

  6. Installation: Run the Oracle Universal Installer (OUI) with CV_ASSUME_DISTID=OEL7.6

  7. Database Creation: Use DBCA to create a container database with a PDB

  8. Post Installation: Configure automatic startup via /etc/oratab

Key Points to Remember

  • Oracle Database 12.1 is not certified on Oracle Linux 8 — use CV_ASSUME_DISTID=OEL7.6 to work around this

  • The 19c preinstall package can be used to automate prerequisite setup

  • Kernel parameters and user limits must be configured for optimal performance

  • SELinux should be set to permissive during installation

  • The root scripts must be run after the installer completes

  • DBCA creates the database with a container (CDB) and pluggable database (PDB)

  • The /etc/oratab file controls automatic startup

Why This Matters

Proper installation and configuration of Oracle Database 12c is essential for:

  • Reliable Performance: Correct kernel parameters and user limits ensure optimal database performance

  • Security: Proper user/group setup and SELinux configuration protect the database

  • Manageability: Environment scripts and automatic startup simplify administration

  • Scalability: A well-configured database can handle growing workloads

  • Compatibility: Correct setup ensures compatibility with Oracle E-Business Suite and other applications

By following this guide, you can successfully install Oracle Database 12c Release 1 on Oracle Linux 8, providing a solid foundation for your Oracle applications.


References

  • Oracle Database Documentation: Database Installation Guide for Linux

  • Oracle Database Documentation: Database Administrator's Reference

  • My Oracle Support: Oracle Database 12c Release 1 Certification Matrix

  • Oracle Linux Documentation: Oracle Linux 8 Administrator's Guide

  • Related Articles: Oracle Universal Installations (OUI) Silent Installations, Database Configuration Assistant (DBCA): Creating Databases in Silent Mode

No comments:

Post a Comment