Oracle 19c RAC Deployment in CentOS7.6(1)

Introduction of hardware and software

There are 2 nodes(virtual machine) included in this rac cluster. The details about them as shown in following table.

Basic system preparation

Package selection

Partition selection

Network configuration

Network configuration for node1

Network configuration for node2

Continue system pareparation

set password for root user

system installation

The system installation will finish a moment later, and system will reboot. Please be patient.

Set hostname “rac1” for node1 and “rac2” for node2. For the detals, maybe you can refer to URL: https://www.roamway.com/3256.html

Check network configuration of host rac1 and rac2. Execute command “ip a”

So far ,we have completed basic system preparation.

system environment preparation

Disable firewall service

Execute the following 2 commands on terminal of each node

systemctl stop firewalld.service
systemctl disable firewalld.service

Disable iptables service

Execute the following 2 commands on terminal of each node

systemctl stop iptables.service
systemctl disable iptables.service

Disable avahi-daemon service

Execute the following commands on terminal of each node.

systemctl stop avahi-daemon.socket
systemctl disable avahi-daemon.service

Enable NTP service

Execute the following commnds

yum install ntpd -y
systemctl enable ntpd.service

Obtain ip address of ntp server “cn.pool.ntp.org”

Execute command “ping cn.pool.ntp.org”, then the ip address will appear, such as ” 139.199.214.202 “

Edit file “/etc/ntp.conf” for each node,enable ntp server 139.199.214.202, as shown in the following figure.

save and exit.

startup ntp service by command “systemctl start ntpd.service”

check status of ntp service by command “ntpstat -t”. as shown in below.

Disable selinux

Execute the following commands on terminal of each node

sed -e ‘s/enforcing/disabled/g’ /etc/selinux/config
setenforce 0
reboot

Edit hosts file for each node

Adding the following content to file /etc/hosts

192.168.137.171 rac1
192.168.137.172 rac2
192.168.137.173 rac1-vip
192.168.137.174 rac2-vip
192.168.119.171 rac1-prv
192.168.119.172 rac2-prv
192.168.137.178 rac-scan

Create user “oracle”,”grid” and their user groups

Execute the following commands on terminal of each node.

/usr/sbin/groupadd -g 50001 oinstall
/usr/sbin/groupadd -g 50002 dba
/usr/sbin/groupadd -g 50003 oper
/usr/sbin/groupadd -g 50004 backupdba
/usr/sbin/groupadd -g 50005 dgdba
/usr/sbin/groupadd -g 50006 kmdba
/usr/sbin/groupadd -g 50007 asmdba
/usr/sbin/groupadd -g 50008 asmoper
/usr/sbin/groupadd -g 50009 asmadmin
/usr/sbin/groupadd -g 50010 racdba
/usr/sbin/useradd -u 50011 -g oinstall -G dba,asmdba,asmoper,asmadmin,racdba grid
/usr/sbin/useradd -u 50012 -g oinstall -G dba,oper,backupdba,dgdba,kmdba,asmdba,racdba oracle

Set password for users grid and oracle

passwd grid
passwd oracle

Create related directory for user grid and oracle

Execute the following commands on terminal of each node.

mkdir -p /u01/app/19.0.0/grid
mkdir -p /u01/app/grid
mkdir -p /u01/app/oracle
mkdir -p /u01/app/oracle/product/19.0.0/db_1
chown -R grid:oinstall /u01
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/

Modify file “20-nproc.conf” for each node

vim /etc/security/limits.d/20-nproc.conf
add “#” in front of “* soft nproc 4096”and“* nproc 4096” at the end of last line, as shown in the following figure.

Modify file “limits.conf” for each node

Adding the following content to file /etc/security/limits.conf

grid soft nproc 16384
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240
grid hard stack 32768
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 3145728
oracle soft memlock 3145728

Modify file “login” for each node.

vim /etc/pam.d/login

Add the following content at the end of last line

#ORACLE SETTING
session required pam_limits.so

Edit file “sysctl.conf” for each node

Add the following content at the end of last line

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmax = 15461882265
kernel.shmall = 3774873
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586

Edit file “network” for each node

vim /etc/sysconfig/network
Add “NOZEROCONF=yes” to the end of last line,as shown in the following figure.

Configure environment variables for each node

node1

user grid

Add the following content to file /home/grid/.bash_profile

export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_SID=+ASM1
export ORACLE_TERM=xterm
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/19.0.0/grid
export NLS_DATE_FORMAT=’yyyy-mm-dd HH24:MI:SS’
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
THREADS_FLAG=native; export THREADS_FLAG
if [ $USER = “oracle” ] || [ $USER = “grid” ]; then
if [ $SHELL = “/bin/ksh” ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi

user oracle

Add the following content to file /home/oracle/.bash_profile

export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/19.0.0/db_1; export ORACLE_HOME
ORACLE_SID=rac1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT=”yyyy-mm-dd HH24:MI:SS”; export NLS_DATE_FORMAT
NLS_LANG=AMERICAN_AMERICA.AL32UTF8;export NLS_LANG
PATH=.:$PATH:$HOME/bin:$ORACLE_BASE/product/19.0.0/db_1/bin:$ORACLE_HOME/bin; export PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
THREADS_FLAG=native; export THREADS_FLAG
if [ $USER = “oracle” ] || [ $USER = “grid” ]; then
if [ $SHELL = “/bin/ksh” ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi

user root

Add the following content to file /root/.bash_profile

PATH=$PATH:/u01/app/19.0.0/grid/bin:$HOME/bin
export PATH

node1

user grid

Add the following content to file /home/grid/.bash_profile

export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_SID=+ASM2
export ORACLE_TERM=xterm
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/19.0.0/grid
export NLS_DATE_FORMAT=’yyyy-mm-dd HH24:MI:SS’
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
THREADS_FLAG=native; export THREADS_FLAG
if [ $USER = “oracle” ] || [ $USER = “grid” ]; then
if [ $SHELL = “/bin/ksh” ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi

user oracle

Add the following content to file /home/oracle/.bash_profile

export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/19.0.0/db_1; export ORACLE_HOME
ORACLE_SID=rac2; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT=”yyyy-mm-dd HH24:MI:SS”; export NLS_DATE_FORMAT
NLS_LANG=AMERICAN_AMERICA.AL32UTF8;export NLS_LANG
PATH=.:$PATH:$HOME/bin:$ORACLE_BASE/product/19.0.0/db_1/bin:$ORACLE_HOME/bin; export PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
THREADS_FLAG=native; export THREADS_FLAG
if [ $USER = “oracle” ] || [ $USER = “grid” ]; then
if [ $SHELL = “/bin/ksh” ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi

user root

Add the following content to file /root/.bash_profile

PATH=$PATH:/u01/app/19.0.0/grid/bin:$HOME/bin
export PATH

SSH configuration between node1 and node2

generate public key

Exectue the following command in node1

user root

ssh-keygen -t rsa
ssh-keygen -t dsa

public key of user root

user grid

execute the same command of root user to generate public key.

user oracle

execute the same command of root user to generate public key.

node2

perform the same operation of node1 to create public key for user root,grid,oracle.

Duplicate public key of every user to another node

user root of node1

cat ~/.ssh/id_rsa_pub >> ~/.ssh/authorized_keys
cat ~/.ssh/id_dsa_pub >> ~/.ssh/authorized_keys
ssh root@rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh root@rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

Duplicate authorize file from node1 to node2

scp authorized_keys root@rac2:~/.ssh/authorized_keys

user grid of node1

Execute the same command of user root, duplicating public key to user grid of node2.

user oracle of node1

Execute the same command of user root, duplicating public key to user oracle of node2.

node2

Perform the same operation of node1 to duplicate public key of each user to node1.

You can also check out this article https://www.roamway.com/922.html for details.

At the end of ssh configuration,you must validate whether node1 can login node2 without password. All the user(root,grid,oracle) must be validated. SSH configuration is successful if the result is sure.

Leave a Reply