# Installing Oracle Database 10.2.0.5 on CentOS 7.9
Operating System: CentOS 7.9
Database Software: 10201_database_linux_x86_64.cpio
Database Patches: p8202632_10205_Linux-x86-64.zip
# Operating System Package Requirements
Checking Package Requirements.
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' \ | |
make gcc glibc glibc-devel compat-db compat-gcc compat-gcc-c++ \ | |
compat-libstdc++ compat-libstdc++-devel gnome-libs openmotif21 setarch \ | |
libaio libaio-devel |
Installing Packages.
yum -y install binutils compat-libstdc++-33 compat-libstdc++-33.i686 \ | |
elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc.i686 glibc-common \ | |
glibc-devel glibc-devel.i686 glibc-headers ksh libaio libaio.i686 libaio-devel \ | |
libaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel make sysstat |
# Setting Up a Working Environment for Oracle
Disable Firewall and SElinux.
echo "192.168.184.150 `hostname`" >> /etc/hosts | |
systemctl disable firewalld --now | |
sed -i '/SELINUX=/{s/enforcing/disabled/}' /etc/selinux/config |
Creating Oracle User Accounts.
groupadd -g 1000 oinstall | |
groupadd -g 1001 dba | |
useradd -u 1000 -c "Oracle software owner" -g oinstall -G dba oracle | |
echo oracle | passwd --stdin oracle |
Creating Oracle Directories.
mkdir -p /u01/app | |
chown -R oracle.oinstall /u01 | |
chmod 775 -R /u01 |
Setting Oracle Environment Variables.
cat >> /home/oracle/.bash_profile << 'EOF' | |
export ORACLE_SID=orcl | |
export ORACLE_BASE=/u01/app/oracle | |
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1 | |
export PATH=$ORACLE_HOME/bin:$PATH | |
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32 | |
EOF |
# Setting System Parameters
Changing system release.
sed -i -e 's/CentOS/# CentOS/' -e '1i redhat 4' /etc/redhat-release |
Setting kernel parameters.
cat >> /etc/sysctl.conf << EOF | |
kernel.shmall = 4294967296 | |
kernel.shmmax = 68719476736 | |
kernel.shmmni = 4096 | |
kernel.sem = 250 32000 100 128 | |
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 | |
# hugetlb_shm_group is dba group id | |
vm.hugetlb_shm_group = 1001 | |
EOF | |
sysctl --system |
Setting shell limits.
cat >> /etc/security/limits.conf << EOF | |
oracle soft nproc 2047 | |
oracle hard nproc 16384 | |
oracle soft nofile 1024 | |
oracle hard nofile 65536 | |
EOF |
Setting pam login.
cat >> /etc/pam.d/login << EOF | |
session required /lib64/security/pam_limits.so | |
session required pam_limits.so | |
EOF |
# Unpacking the Installation Files and starting runInstaller
chown -R oracle.oinstall /soft | |
chmod -R 775 /soft | |
# Login as oracle user | |
cd /soft | |
gunzip 10201_database_linux_x86_64.cpio.gz | |
cpio -idmv < 10201_database_linux_x86_64.cpio | |
database/runInstaller |
# Patching Oracle 10g to 10.2.0.5.19
Patching to 10.2.0.5.0.
# Login as oracle user | |
unzip p8202632_10205_Linux-x86-64.zip | |
/soft/Disk1/runInstaller |
Patching to 10.2.0.5.19.
・ patch p20299014
# Oracle Post Installation Tasks
Setting automatic restart.
sed -i 's/N$/Y/' /etc/oratab | |
cat >> /etc/rc.d/rc.local << EOF | |
su oracle -lc "/u01/app/oracle/product/10.2.0/db_1/bin/lsnrctl start" | |
su oracle -lc "/u01/app/oracle/product/10.2.0/db_1/bin/dbstart" | |
EOF | |
chmod +x /etc/rc.d/rc.local |
Setting EM.
emca -repos recreate | |
emca -config dbcontrol db -repos create | |
emca -deconfig dbcontrol db -repos drop |