Post

Oracle 18c GI & RDMS on RHEL7

This post describes silent installation and configuration of Grid Infrastructure 18c (64bit) and Oracle Database 18c (64bit) on RHEL 7. The implementation described in this blog is based on a server installation with a minimum resource allocations required by Oracle.

Download Softwares

Download software from OTN

  • Database 18c (18.3) for Linux x86-64 (LINUX.X64_180000_db_home.zip)
  • Grid Infrastructure (18.3) for Linux x86-64 (LINUX.X64_180000_grid_home.zip)

Pre-Install Tasks

  • Pre-install tasks are performed as root OS user
  • Oracle recommends that you disable THP on all Oracle Database servers and rather use standard HugePages for enhanced performance. For Oracle Linux 7 and later, and Red Hat Enterprise Linux 7 and later, add transparent_hugepage=never in the /etc/default/grub file.
  • Ensure the /etc/hosts file to contain the IP and FQDN of the server.
  • Ensure the correct hostname in the /etc/hostname file

Identify your ASM disk by adding them to the to /etc/udev/rules.d/97-oracleasm.rules. It should look like this:

1
2
OWNER="grid", GROUP="asmadmin", MODE="0660", ENV{DEVTYPE}=="disk", KERNEL=="xvdca", SYMLINK+="oracleasm/disks/DATA1"
OWNER="grid", GROUP="asmadmin", MODE="0660", ENV{DEVTYPE}=="disk", KERNEL=="xvdcb", SYMLINK+="oracleasm/disks/FRA1"

Reload udev rules

1
2
udevadm control --reload-rules
udevadm trigger

Run the following command to initialize ASM disks

1
for dsk in `ls /dev/oracleasm/disks/*`; do echo 'initializing ',${dsk}; dd if=/dev/zero of=${dsk} bs=4096 count=1; done

Adjust your Linux kernels as needed for your environment by adding the necessary entries and values in the /etc/sysctl.conf. Reload the updated Linux kernels by running the following command:

1
sysctl -p

Adjust system resources available to oracle and grid OS user process by adding the necessary enrties and values in the /etc/security/limits.d/oracle-database-preinstall-18c.conf.

Install the following required OS packages required for RHEL 7.

1
yum install -y bc binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33.i686 elfutils-libelf.i686 elfutils-libelf elfutils-libelf-devel.i686 elfutils-libelf-devel fontconfig-devel glibc.i686 glibc glibc-devel.i686 glibc-devel ksh libaio.i686 libaio libaio-devel.i686 libaio-devel libX11.i686 libX11 libXau.i686 libXau libXi.i686 libXi libXtst.i686 libXtst libgcc.i686 libgcc librdmacm-devel libstdc++.i686 libstdc++ libstdc++-devel.i686 libstdc++-devel libxcb.i686 libxcb make nfs-utils net-tools python python-configshell python-rtslib python-six smartmontools sysstat targetcli unixODBC

Create the OS users and groups for the Oracle software stack

1
2
3
4
5
6
7
8
9
10
groupadd oinstall
groupadd dba
groupadd bckpdba
groupadd dgdba
groupadd kmdba
groupadd asmoper
groupadd asmadmin
groupadd asmdba
useradd -g oinstall -G dba,bckpdba,dgdba,kmdba,asmoper,asmadmin oracle
useradd -g oinstall -G dba,asmoper,asmadmin grid

Ensure secure Linux is set to targeted in /etc/selinux/config

1
2
3
4
5
6
7
8
9
10
SELINUX= can take one of these three values:
 enforcing - SELinux security policy is enforced.
 permissive - SELinux prints warnings instead of enforcing.
 disabled - No SELinux policy is loaded.
 SELINUX=enforcing
 SELINUXTYPE= can take one of three two values:
 targeted - Targeted processes are protected,
 minimum - Modification of targeted policy. Only selected processes are protected.
 mls - Multi Level Security protection.
 SELINUXTYPE=targeted

Create software directories as needed. In my case I will simply assign ownership of an entire mountpoint

1
2
3
mkdir /u01
chown -R oracle:oinstall /u01
chmod 770 /u01

Grid Infrastructure Installation & Configuration Tasks

GI installation tasks are performed as grid OS user

Add the following lines to the /home/grid/.bash_profile

1
2
3
4
5
ORACLE_BASE=/u01/grid/base; export ORACLE_BASE
GRID_HOME=/u01/grid/home; export GRID_HOME
ORACLE_HOME=$GRID_HOME; export ORACLE_HOME
ORACLE_SID=+ASM; export ORACLE_SID
PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch; export PATH

Source the grid OS user profile

1
source ~/.bash_profile

Add the following lines in /home/grid/gi_soft.rsp in-order to create the response file for silent software installation.

1
oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v18.0.0 INVENTORY_LOCATION=/u01/oraInventory oracle.install.option=HA_CONFIG ORACLE_BASE=/u01/grid/base oracle.install.asm.OSDBA=oinstall oracle.install.asm.OSASM=asmadmin oracle.install.asm.storageOption=ASM oracle.install.asm.SYSASMPassword=putYourPassword oracle.install.asm.diskGroup.name=DATA oracle.install.asm.diskGroup.redundancy=EXTERNAL oracle.install.asm.diskGroup.disks=/dev/oracleasm/disks/DATA1,/dev/oracleasm/disks/FRA1 oracle.install.asm.diskGroup.diskDiscoveryString=/dev/oracleasm/disks/* oracle.install.asm.monitorPassword=putYourPassword oracle.install.asm.configureAFD=false

Unzip GI 18c software

1
2
mkdir -p /u01/grid/home
unzip /software_download/LINUX.X64_180000_grid_home.zip -d /u01/grid/home

Invoke OUI silent installation

1
/u01/grid/home/gridSetup.sh -silent -responseFile /home/grid/gi_soft.rsp

Open another terminal, then run the post install scripts below as root OS user

1
2
/u01/oraInventory/orainstRoot.sh
/u01/grid/home/root.sh[

Run the following command to complete GI configuration

1
/u01/grid/home/gridSetup.sh -executeConfigTools -responseFile /home/grid/gi_soft.rsp -silent

Confirm +ASM instance is running

1
ps -ef | grep smon

Confirm +DATA diskgroup is created

1
asmcmd lsdg

Create remaining ASM diskgroups that will be used by the database

1
asmca -silent -createDiskGroup -diskString '/dev/oracleasm/disks/*' -diskGroupName FRA -disk '/dev/oracleasm/disks/FRA*' -redundancy EXTERNAL -au_size 4

Database Installation and Configuration Tasks

DB installation tasks are performed as oracle OS user

Add the following lines to the /home/oracle/.bash_profile

1
2
3
4
ORACLE_BASE=/u01/app; export ORACLE_BASE
ORACLE_HOME=/u01/app/18R3; export ORACLE_HOME
export ORACLE_SID=testdb
PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch; export PATH

Source the profile

1
source ~/.bash_profile

Add the following lines in /home/oracle/db_soft_only.rsp in-order to create the response file for silent software only installation

1
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v18.0.0 oracle.install.option=INSTALL_DB_SWONLY UNIX_GROUP_NAME=oinstall INVENTORY_LOCATION=/u01/oraInventory ORACLE_HOME=/u01/app/18R3 ORACLE_BASE=/u01/app oracle.install.db.InstallEdition=EE oracle.install.db.OSDBA_GROUP=dba oracle.install.db.OSOPER_GROUP=dba oracle.install.db.OSBACKUPDBA_GROUP=bckpdba oracle.install.db.OSDGDBA_GROUP=dgdba oracle.install.db.OSKMDBA_GROUP=kmdba oracle.install.db.OSRACDBA_GROUP=dba SECURITY_UPDATES_VIA_MYORACLESUPPORT=false DECLINE_SECURITY_UPDATES=true oracle.installer.autoupdates.option=SKIP_UPDATES

Unzip oracle Database 18c software

1
unzip /software_download/LINUX.X64_180000_db_home.zip -d /u01/app/18R3

Invoke OUI silent installation

1
u01/app/18R3/runInstaller -silent -responseFile ~/db_soft_only.rsp

Upon installation completion, execute the post installation scripts

1
/u01/app/18R3/root.sh

Use the command below to create a general purpose transaction database

1
dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbName $ORACLE_SID -sid $ORACLE_SID -sysPassword putYOURPASSWORD -systemPassword putYOURPASSWORD -storageType ASM -diskGroupName +DATA -recoveryGroupName +FRA -responseFile NO_VALUE -createAsContainerDatabase false -characterSet AL32UTF8 -nationalCharacterSet AL16UTF16 -archiveLogMode true -databaseType MULTIPURPOSE -emConfiguration NONE

Confirm database instance is running

1
ps -ef | grep smon

Confirm database is open

1
select open_mode from v$database;
This post is licensed under CC BY 4.0 by the author.