The installation of the Oracle RAC involves many instance configurations. Configuration omission or error may cause installation failure. For more information on configuration, refer to the respective configuration manual or consult an Oracle expert. The example shows only the main steps to install Oracle RAC silently in CentOS7.
System and Software Information
In this example,
l the instance uses CentOS Linux release 7.6.1810 as the operating system and 3.10.0-957.el7.x86_64 as the kernel version.
l The Oracle RAC version is 19c (19.3) Linux x86-64.
NTP Configuration
The time of all instances in an Oracle RAC must be consistent. If the time difference is too large, cluster nodes cannot start properly. You can use the Internet or Intranet NTP server to synchronize the time of each instance in the cluster.
ntpdate <NTP_server>
Swap Space Configuration
As recommended in the Oracle documentation, for 4 GB to 16 GB instances, the swap space must be consistent with the memory space. For instances with more than 16 GB memory, the swap space must be configured as 16 GB.
fallocate -l 16G /swapfile # In this way, swapon may fail. You can directly run the "dd" command to copy and convert a file.dd if=/dev/zero of=/swapfile count=1024k bs=16384chmod 600 /swapfilemkswap /swapfileswapon /swapfile
/dev/shm Shared Memory Configuration
Ensure that the /dev/shm shared memory device is correctly mounted in /etc/fstab. The device type must be tmpfs.
Firewall
Check that Oracle-related services are not blocked by the firewall. We recommend that you do not disable the firewall service directly unless it is on an Intranet trusted network.
User Directory Configuration
Create Grid and Oracle users and change the password.
/usr/sbin/groupadd -g 501 oinstall/usr/sbin/groupadd -g 502 dba/usr/sbin/groupadd -g 503 oper/usr/sbin/groupadd -g 504 asmadmin/usr/sbin/groupadd -g 506 asmdba/usr/sbin/groupadd -g 507 asmoper/usr/sbin/useradd -u 5001 -g oinstall -G dba,asmadmin,asmdba,asmoper grid/usr/sbin/useradd -u 5002 -g oinstall -G dba,asmdba,oper oraclemkdir -p /home/gridmkdir -p /home/oraclechown grid:oinstall /home/gridchown oracle:oinstall /home/oraclepasswd gridpasswd oracle
/etc/hosts File Configuration
Modify the hosts file and add DNS
192.168.0.31 rac-node01192.168.0.32 rac-node02192.168.0.41 rac-node01-vip192.168.0.42 rac-node02-vip192.168.0.50 SCAN20192.168.100.31 rac-node01-priv192.168.100.32 rac-node02-priv
SSH Passwordless Configuration
You must configure passwordless login of Grid and Oracle users in cluster nodes to transmit installation files and collect machine information.
Modifying Kernel Parameters
cp /etc/sysctl.conf /etc/sysctl.conf.bakecho "#Oracle Parameter" >> /etc/sysctl.confecho kernel.shmmni = 4096 >> /etc/sysctl.confecho kernel.sem = 250 32000 100 128 >> /etc/sysctl.confecho fs.file-max = 6815744 >> /etc/sysctl.confecho fs.aio-max-nr = 1048576 >> /etc/sysctl.confecho net.ipv4.ip_local_port_range = 9000 65500 >> /etc/sysctl.confecho net.core.rmem_default = 262144 >> /etc/sysctl.confecho net.core.rmem_max = 4194304 >> /etc/sysctl.confecho net.core.wmem_default = 262144 >> /etc/sysctl.confecho net.core.wmem_max = 1048576 >> /etc/sysctl.confecho kernel.shmmax = 274877906944 >> /etc/sysctl.confecho net.ipv4.ping_group_range = 0 10000 >> /etc/sysctl.confecho net.ipv6.conf.all.disable_ipv6 = 1 >> /etc/sysctl.confcat /etc/sysctl.confsysctl -p
Note: The kernel.shmmax parameter must be modified according to the instance configuration. You can check the script to identify the values to modify.
Modifying Limits Configuration
This is to modify the limits configuration.
cp /etc/security/limits.conf /etc/security/limits.conf.bakecho "#Oracle Parameter" >> /etc/security/limits.confecho grid soft nproc 2047 >> /etc/security/limits.confecho grid hard nproc 16384 >> /etc/security/limits.confecho grid soft nofile 1024 >> /etc/security/limits.confecho grid hard nofile 65536 >> /etc/security/limits.confecho grid soft stack 10240 >> /etc/security/limits.confecho grid hard stack 32768 >> /etc/security/limits.confecho oracle soft nproc 2047 >> /etc/security/limits.confecho oracle hard nproc 16384 >> /etc/security/limits.confecho oracle soft nofile 1024 >> /etc/security/limits.confecho oracle hard nofile 65536 >> /etc/security/limits.confecho oracle soft stack 10240 >> /etc/security/limits.confecho oracle hard stack 32768 >> /etc/security/limits.confcat /etc/security/limits.conf
Creating Installation Directory
mkdir -p /u01/app/oraInventory
chown -R grid:oinstall /u01/app/oraInventory
chmod -R 775 /u01/app/oraInventory
mkdir -p /u01/app/grid
chown -R grid:oinstall /u01/app/grid
chmod -R 775 /u01/app/grid
mkdir -p /u01/app/grid_home
chown -R grid:oinstall /u01/app/grid_home
chmod -R 775 /u01/app/grid_home
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle
mkdir -p /u01/app/oracle_home
chown -R oracle:oinstall /u01/app/oracle_home
chmod -R 775 /u01/app/oracle_home
Setting Grid/Oracle Environment Variable (Varying with Nodes)
On all nodes, edit the profile script for the Grid user.
su - gridvi .bash_profileTMP=/tmp; export TMPTMPDIR=$TMP; export TMPDIR# node1: ORACLE_SID=+ASM1 ;# node2: ORACLE_SID=+ASM2 ;# node3: ORACLE_SID=+ASM3 ;ORACLE_SID=+ASM1; export ORACLE_SIDORACLE_BASE=/u01/app/grid/; export ORACLE_BASEORACLE_HOME=/u01/app/grid_home; export ORACLE_HOMENLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMATTHREADS_FLAG=native; export THREADS_FLAGPATH=$ORACLE_HOME/bin:$PATH; export PATHTHREADS_FLAG=native; export THREADS_FLAGPATH=$ORACLE_HOME/bin:$PATH; export PATHumask 022export DISPLAY=10.228.100.100:0.0
Note: ORACLE_SID is different for different nodes. To run Linux GUI, you can configure DISPLAY.
On all nodes, edit the profile script for the Oracle user.
su - oracle
vi .bash_profile
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/u01/app/oracle/; export ORACLE_BASE
ORACLE_HOME=/u01/app/oracle_home; export ORACLE_HOME
# node1: ORACLE_SID=racdb1 ;
# node2: ORACLE_SID=racdb2 ;
# node3: ORACLE_SID=racdb3 ;
ORACLE_SID=racdb1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export
CLASSPATH
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANG
umask 022
export DISPLAY=10.228.100.100:0.0
Note: ORACLE_SID is different for different nodes. To run Linux GUI, you can configure DISPLAY.
Modifying Hard Disk Property
Define the udev rule to automatically modify the hard disk property to be used by Oracle RAC. Modify the file: /etc/udev/rules.d/99-chown.rules
KERNEL=="vd[!a]*",OWNER="grid", GROUP="asmadmin", MODE="660"
Load the file again and check whether the /dev/vd* property is modified.
udevadm control --reload-rules
udevadm trigger
ls -al /dev/vd*
Hard Disk Partition
To partition hard disks, perform the following operations:
l Select hard disks to partition:
cat disk_list.txt/dev/vdb/dev/vdc/dev/vdd/dev/vde/dev/vdf/dev/vdg/dev/vdh/dev/vdi
l Format and partition hard disks in batches:
for Disk in `cat disk_list.txt`dofdisk $Disk <<EOFnp wEOFdone