# Common tasks for prepping a Linux host for Oracle Database
# installation include the following.  However, refer to the
# details in the Oracle Database Installation Guide for Linux.
# Most of these tasks must be performed by the superuser, 'root'.

# As 'root':

# If needed, create operating system groups:
/usr/sbin/groupadd oinstall   # Software ownership group
/usr/sbin/groupadd dba        # OSDBA group
/usr/sbin/groupadd oper       # OSOPER group
/usr/sbin/groupadd asmadmin   # OSASM group

# If needed, create Oracle software administration account, 'oracle':
/usr/sbin/useradd -g oinstall -G dba,oper,asmadmin -d /home/oracle oracle

# If Oracle account already exists, but needs to be added to a group,
# first check existing group memberships:
id oracle
# uid=600(oracle) gid=600(oinstall) groups=600(oinstall),601(dba),602(oper)
# Make oracle a supplemental member of all current groups other than the
# primary group:
usermod -G dba,oper,asmadmin oracle

# Set a password for the 'oracle' account:
passwd oracle

# Set kernel parameters in /etc/sysctl.conf:
cat <<EoPaRaMs >> /etc/sysctl.conf
kernel.sem = 250     32000   100      128
kernel.shmmax = 2147483648
kernel.shmall = 2097152
kernel.shmmni = 4096
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
EoPaRaMs

# Update current kernel parameter settings:
sysctl -p /etc/sysctl.conf

