OEL Base Config for Oracle DB

OpenSSH

Packages & Config

12.1.0.2

Check:

yum list oracle-rdbms-server-12cR1-preinstall

Install:

yum install oracle-rdbms-server-12cR1-preinstall -y

12.2.0.1

Check:

yum list oracle-database-server-12cR2-preinstall

Install:

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

18.1

Linux is assumed to be Oracle Enterprise Linux 7

As root:

yum install oracle-database-preinstall-18c.x86_64 –y 

To check if it is already installed use:

yum list oracle-database-preinstall-18c.x86_64

Linux is assumed to be Oracle Enterprise Linux 7, 8 or 9 or RHEL 7, 8 or 9.


You can only download this script if you have an active ULN subscription.


As root:

dnf install oracle-database-preinstall-19c

To check if it is already installed use:

dnf list oracle-database-preinstall-19c

If you cannot use the preinstall rpm. The list of required packages is...


rpm -q bcrpm -q binutilsrpm -q compat-openssl10rpm -q elfutils-libelfrpm -q elfutils-libelf-develrpm -q fontconfigrpm -q glibcrpm -q glibc-develrpm -q kshrpm -q libaiorpm -q libaio-develrpm -q libXrenderrpm -q libX11rpm -q libXaurpm -q libXirpm -q libXtstrpm -q libgccrpm -q libnslrpm -q librdmacmrpm -q libstdc++rpm -q libstdc++-develrpm -q libxcbrpm -q libibverbsrpm -q libasanrpm -q liblsanrpm -q makerpm -q policycoreutilsrpm -q policycoreutils-python-utilsrpm -q smartmontoolsrpm -q sysstat
TIP: Paste the above into a temporary file and run (as shown below) to report only missing packages...sh /tmp/tmp.sh | grep not

To install, if necessary...

dnf install bcdnf install binutilsdnf install compat-openssl10dnf install elfutils-libelfdnf install elfutils-libelf-develdnf install fontconfigdnf install glibcdnf install glibc-develdnf install kshdnf install libaiodnf install libaio-develdnf install libXrenderdnf install libX11dnf install libXaudnf install libXidnf install libXtstdnf install libgccdnf install libnsldnf install librdmacmdnf install libstdc++dnf install libstdc++-develdnf install libxcbdnf install libibverbsdnf install libasandnf install liblsandnf install makednf install policycoreutilsdnf install policycoreutils-python-utilsdnf install smartmontoolsdnf install sysstat
GCC is not required for 12.2 and later

Clock Source

Oracle recommeds using tsc as the clock source.

Check

cat /sys/devices/system/clocksource/clocksource0/current_clocksource

cat /sys/devices/system/clocksource/clocksource0/available_clocksource

lscpu | grep "tsc"

Set

echo tsc > /sys/devices/system/clocksource/clocksource0/current_clocksource 

cat /sys/devices/system/clocksource/clocksource0/current_clocksource

GRUB_CMDLINE_LINUX="rd.lvm.lv=ol/root rd.lvm.lv=ol/swap rhgb quiet numa=off transparent_hugepage=never clocksource=tsc"

grub2-mkconfig -o /boot/grub2/grub.cfg 

Limits

Add the following lines to the /etc/security/limits.conf file:

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

Transparent Huge Pages

Check Transparent Huge Pages

Check (Red Hat Kernel):

cat /sys/kernel/mm/redhat_transparent_hugepage/enabled

Check (Oracle Kernel):

cat /sys/kernel/mm/transparent_hugepage/enabled


NOTE: If Transparent HugePages is removed from the kernel, then neither /sys/kernel/mm/transparent_hugepage nor /sys/kernel/mm/redhat_transparent_hugepage files exist. 

Output as shown below indicates that transparent hugepages are disabled

always madvise [never]

Output as shown below indicates that transparent hugepages is being used and is set to madvise...

always [madvise] never

Disable Transparent Huge Pages

You SHOULD DISABLE Transparent Huge Pages BEFORE installing Oracle Database where the kernel is NOT UEK7 or above

Update the /etc/default/grub file to include "transparent_hugepage=never"...

GRUB_TIMEOUT=5

GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"

GRUB_DEFAULT=saved

GRUB_DISABLE_SUBMENU=true

GRUB_TERMINAL_OUTPUT="console"

GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet numa=off transparent_hugepage=never"

GRUB_DISABLE_RECOVERY="true"

grub2-mkconfig -o /boot/grub2/grub.cfg

Set Transparent HugePages to madvise

UEK7 and later

Update the /etc/default/grub file to include "transparent_hugepage=madvise"...

GRUB_TIMEOUT=5

GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"

GRUB_DEFAULT=saved

GRUB_DISABLE_SUBMENU=true

GRUB_TERMINAL_OUTPUT="console"

GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet numa=off transparent_hugepage=madvise"

GRUB_DISABLE_RECOVERY="true"

Oracle Linux 8

grub2-mkconfig -o /boot/grub2/grub.cfg 

Oracle Linux 9

grub2-mkconfig -o /boot/grub2/grub.cfg --update-bls-cmdline

Huge Pages

Configure Huge Pages

Check if the kernal supports HugePages...

grep Huge /proc/meminfo

Edit the memlock settings in /etc/security/limits.conf.
Set the maximum locked memory to 90% of physical RAM in KB.

*   soft   memlock    60397977

*   hard   memlock    60397977

64GB (67,108,864KB) - 60,397,977KB (90%)32GB (33,554,432KB) - 30,198,988KB (90%)16GB (16,777,216KB) - 15,099,494KB (90%) 8GB ( 8,388,608KB) -  7,549,747KB (90%)

Users & Groups

Check

Add

/usr/sbin/groupadd -g 54321 oinstall

/usr/sbin/groupadd -g 54322 dba

/usr/sbin/groupadd -g 54323 oper

/usr/sbin/groupadd -g 54324 backupdba

/usr/sbin/groupadd -g 54325 dgdba

/usr/sbin/groupadd -g 54326 kmdba 

/usr/sbin/groupadd -g 54327 asmdba 

/usr/sbin/groupadd -g 54328 asmoper 

/usr/sbin/groupadd -g 54330 racdba 

/usr/sbin/useradd -u 54321 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba oracle 

/usr/sbin/useradd -u 54331 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba grid 

You should change the passwords to known values:

passwd oracle

passwd grid

Oracle Inventory

If this is a fresh install on an empty server, the Oracle Inventory should not exist.

Runlevel

To run the installer, runlevel must be 3 or 5...

runlevel

Bibliography