Article Directory
-
-
- 0. Operating system deployment
- 1. Host name configuration
- 2. SELINUX and firewall closed
- 3. Turn off unnecessary services
- 4. Dependent package installation
- 5. User and user group creation
- 6. User environment information configuration
- 7. Directory and permissions creation
- 8. Kernel parameter configuration
-
0. Operating system deployment
Operating system version: CentOS Linux release 7.8.2003 (Core)
<Omitted>
Local Disk Planning:
Shared Disk Planning:
Network Information Planning:
It is recommended not to choose minimal deployment, it is best to deploy [GNOME Desktop] together. Avoid all kinds of problems in the system during manual installation later, especially if there is no external network and you need to build the YUM source yourself.
1. Host name configuration
hostnamectl set-hostname RACNode01
hostnamectl set-hostname RACNode02
2. SELINUX and firewall closed
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
systemctl stop firewalld.service
systemctl disable firewalld.service
3. Turn off unnecessary services
- It is recommended to disable this service in the ORACLE environment. Oracle has reported that avahi-daemon may interfere with the multicast heartbeat signal of Oracle RAC, causing the application layer interface to assume that it has been disconnected on the node and restarted.
systemctl stop avahi-daemon.socket avahi-daemon.service
systemctl disable avahi-daemon.socket avahi-daemon.service
- After Oracle RAC 11.2, the database has two time synchronization methods. Method 1: Configure the NTP service in the operating system; Method 2: Oracle Cluster Time Synchronization Service (ctssd). If the former access fails, the latter will be automatically adopted.
systemctl status chronyd.service
systemctl disable chronyd.service
systemctl stop chronyd.service
mv /etc/ntp.conf /etc/ntp.conf.bak
4. Dependent package installation
yum -y install binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libgcc libstdc++ libstdc++-devel libaio libaio-devel libXext libXtst libX11 libXau libxcb libXi make sysstat libXmu libXt libXv libXxf86dga libdmx libXxf86misc libXxf86vm xorg-x11-utils xorg-x11-xauth nfs-utils smartmontools xclock xterm
5. User and user group creation
groupadd -g 1000 oinstall
groupadd -g 1100 asmadmin
groupadd -g 1200 dba
groupadd -g 1201 oper
groupadd -g 1300 asmdba
groupadd -g 1301 asmoper
useradd -u 1100 -g oinstall -G asmadmin,asmdba,asmoper -d /home/grid -m grid && echo "grid" | passwd --stdin grid
useradd -u 1101 -g oinstall -G dba,asmdba,oper -d /home/oracle -m oracle && echo "oracle" | passwd --stdin oracle
6. User environment information configuration
- [Node One]
su - oracle
{
echo
echo \#\# Changes done for to support Oracle RAC
echo "umask=022"
echo "export ORACLE_BASE=/u01/app/oracle"
echo "export ORACLE_HOME=/u01/app/oracle/product/12.2.0/db_1"
echo "export ORACLE_SID=RACDB1"
echo "NLS_LANG=AMERICAN_AMERICA.UTF8"
echo "NLS_DATE_FORMAT=\"yyyy-mm-dd hh24:mi:ss\""
echo "export PATH=\$ORACLE_HOME/bin:\$ORACLE_HOME/OPatch:\$PATH"
echo "alias sqlplus=\"rlwrap sqlplus\""
echo "alias rman=\"rlwrap rman\""
echo \#\# End
echo
} >> /home/oracle/.bash_profile
exit
su - grid
{
echo
echo \#\# Changes done for to support Oracle RAC
echo "umask=022"
echo "export ORACLE_BASE=/u01/app/grid"
echo "export ORACLE_HOME=/u01/app/12.2.0/grid"
echo "export ORACLE_SID=+ASM1"
echo "export PATH=\$ORACLE_HOME/bin:\$ORACLE_HOME/OPatch:\$PATH"
echo \#\# End
echo
} >> /home/grid/.bash_profile
exit
- [Node Two]
su - oracle
{
echo
echo \#\# Changes done for to support Oracle RAC
echo "umask=022"
echo "export ORACLE_BASE=/u01/app/oracle"
echo "export ORACLE_HOME=/u01/app/oracle/product/12.2.0/db_1"
echo "export ORACLE_SID=RACDB2"
echo "NLS_LANG=AMERICAN_AMERICA.UTF8"
echo "NLS_DATE_FORMAT=\"yyyy-mm-dd hh24:mi:ss\""
echo "export PATH=\$ORACLE_HOME/bin:\$ORACLE_HOME/OPatch:\$PATH"
echo "alias sqlplus=\"rlwrap sqlplus\""
echo "alias rman=\"rlwrap rman\""
echo \#\# End
echo
} >> /home/oracle/.bash_profile
exit
su - grid
{
echo
echo \#\# Changes done for to support Oracle RAC
echo "umask=022"
echo "export ORACLE_BASE=/u01/app/grid"
echo "export ORACLE_HOME=/u01/app/12.2.0/grid"
echo "export ORACLE_SID=+ASM2"
echo "export PATH=\$ORACLE_HOME/bin:\$ORACLE_HOME/OPatch:\$PATH"
echo \#\# End
echo
} >> /home/grid/.bash_profile
exit
7. Directory and permissions creation
mkdir -p /u01/app/grid
mkdir -p /u01/app/12.2.0/grid
mkdir -p /u01/app/oracle
chown -R grid:oinstall /u01
chown oracle:oinstall /u01/app/oracle
chmod -R 775 /u01
8. Kernel parameter configuration
- In order to improve the performance of the software on the Linux system, the shell limit for grid and oracle users must be increased
{
echo
echo \#\# Changes done for to support Oracle RAC
echo "grid soft nproc 2047"
echo "grid hard nproc 16384"
echo "grid soft nofile 131072"
echo "grid hard nofile 131072"
echo "grid soft core unlimited"
echo "grid hard core unlimited"
echo "oracle soft nofile 131072"
echo "oracle hard nofile 131072"
echo "oracle soft nproc 131072"
echo "oracle hard nproc 131072"
echo "oracle soft core unlimited"
echo "oracle hard core unlimited"
echo "oracle soft memlock 61644800"
echo "oracle hard memlock 61644800"
echo \#\# End
echo
} >> /etc/security/limits.conf
- Make the following changes to the default shell startup file
{
echo
echo \#\# Changes done for to support Oracle RAC
echo "if [ $USER="oracle" ] || [ $USER="grid" ]; then"
echo " if [ $SHELL="/bin/ksh" ]; then"
echo " ulimit -p 16384"
echo " ulimit -n 65536"
echo " else"
echo " ulimit -u 16384 -n 65536"
echo " fi"
echo " umask 022"
echo "fi"
echo \#\# End
echo
} >> /etc/profile
- Increase pam login parameters
{
echo
echo \#\# Changes done for to support Oracle RAC
echo "session required pam_limits.so"
echo \#\# End
echo
} >> /etc/pam.d/login
- sysctl parameter configuration
This configuration is suitable for 16GB environment, please adjust and modify other environments according to actual conditions. Official reference information:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/cwlin/changing-kernel-parameter-values.html
{
echo
echo \#\# Changes done for to support Oracle RAC
echo "fs.aio-max-nr=3145728"
echo "fs.file-max=6815744"
echo "net.ipv4.ip_local_port_range=9000 65500"
echo "net.core.rmem_max=4194304"
echo "net.core.rmem_default=262144"
echo "net.core.wmem_max=1048576"
echo "net.core.wmem_default=262144"
echo "net.ipv4.tcp_wmem=262144 262144 262144"
echo "net.ipv4.tcp_rmem=262144 262144 262144"
echo "# SHMALL configured for 16GB SGA. To calculate SGA(KB)/4."
echo "kernel.shmall=4456448"
echo "kernel.shmmni=4096"
echo "kernel.shmmax=18253611008"
echo "kernel.sem=250 32000 100 128"
echo \#\# End
echo
} > /etc/sysctl.d/97-oracle-database-sysctl.conf
/sbin/sysctl --system
/sbin/sysctl -p
- Hugepages and Transparent HugePages configuration
refer to < Hugepages and Transparent HugePages configuration impact on Oracle >