Oracle 21c Cluster Setup & DB Creation on OEL-8.4 using Virtual-box
Moto: This document is created on traditional way to Install and configure Oracle Rac 21c without using Vagrant or Cloud. Don’t worry, I’ll make another documents using Vagrant.
Here I’ll provide all steps only. You just need to follow the process to success.
Step#1: Prepared your VM
H/W requirements: RAM 8GB*2=16GB for two node RAC
OS: OHEL 7.4+ (Here I used 8.4)
Storage: 200 GB Total
Edit the Hostfie
Vi /etc/hosts
# Public
192.168.56.10 rac01.localdomain rac01
192.168.56.20 rac02.localdomain rac02
# Private
192.168.55.10 rac01-priv.localdomain rac01-priv
192.168.55.20 rac02-priv.localdomain rac02-priv
# Virtual
192.168.56.11 rac01-vip.localdomain rac01-vip
192.168.56.21 rac02-vip.localdomain rac02-vip
# SCAN
192.168.56.105 scan.localdomain scan-ip
192.168.56.106 scan.localdomain scan-ip
192.168.56.107 scan.localdomain scan-ip
Configure YUM (Local) for smooth package installation.
1. rpm -Uvh vsftd
2. cp -r (-v) Pakage /var/ftp/pub/oel-8.4
3.[root@rac01 ~]# vi /etc/yum.repos.d/local.repo
[basic]
name=localrepo
baseurl= ftp://localhost/pub/oel-8.4/BaseOS
enable=1
gpgcheck=0
[root@erac01 ~]#
4. service vsftpd restart OR /bin/systemctl restart vsftpd.service
5. yum clean all
6. yum list
Disable FIREWALL
[root@rac01 ~]# systemctl stop firewalld
[root@rac01 ~]# systemctl disable firewalld
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@rac01 ~]#
Install required packages:
yum install binutils* -y
yum install compat-libstdc* -y
yum install compat-libstdc*.i686 -y
yum install gcc* -y
yum install gcc-c* -y
yum install glibc -y
yum install glibc*.i686 -y
yum install glibc*-devel -y
yum install glibc*-devel.i686 -y
yum install ksh* -y
yum install libgcc* -y
yum install libgcc*.i686 -y
yum install libstdc* -y
yum install libstd*.i686 -y
yum install libstdc*devel -y
yum install libstdc*devel.i686 -y
yum install libaio* -y
yum install libaio*.i686 -y
yum install libaio*devel -y
yum install libaio*devel.i686 -y
yum install libXext* -y
yum install libXext*.i686 -y
yum install libXtst* -y
yum install libXtst*.i686 -y
yum install libX11* -y
yum install libX11*.i686 -y
yum install libXau* -y
yum install libXau*.i686 -y
yum install libxcb* -y
yum install libxcb*.i686 -y
yum install libXi* -y
yum install libXi*.i686 -y
yum install make* -y
yum install sysstat* -y
yum install unixODBC* -y
yum install unixODBC*devel -y
yum install zlib*devel -y
yum install zlib*devel.i686 -y
[root@rac01 Packages]# yum localinstall oracleasmlib-2.0.17-1.el8.x86_64.rpm
[root@rac01 Packages]# yum localinstall oracleasm-support-2.1.12-1.el8.x86_64.rpm
Now created to required user Groups and needed directory
groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
groupadd -g 54327 asmdba
groupadd -g 54328 asmoper
groupadd -g 54329 asmadmin
useradd -u 54321 -g oinstall -G dba,oper,asmdba oracle
useradd -u 54333 -g oinstall -G dba,asmadmin,asmdba,asmoper grid
usermod -u 54321 -g oinstall -G dba,oper,asmdba oracle
usermod -u 54333 -g oinstall -G dba,asmadmin,asmdba,asmoper grid
useradd -u 54321 -g oinstall -G dba,oper,backupdba,dgdba,kmdba,asmdba,asmoper,asmadmin,racdba oracle
passwd oracle
passwd grid
Create the proper Directory and provide the ownership and permissions
mkdir -p /u01/app/grid
mkdir -p /u01/app/21c/gridhome_1
mkdir -p /u01/app/oraInventory
chown -R grid:oinstall /u01
chown -R grid:oinstall /u01/app/oraInventory
chmod -R 775 /u01/
mkdir -p /u02/app/oracle
mkdir -p /u02/app/oracle/product/21c/dbhome_1
---mkdir -p /u02/app/oracle/oraInventory
chown -R oracle:oinstall /u02
chmod -R 775 /u02/
Modify the limits configuration files for Oracle & Grid users
vi /etc/security/limits.conf
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 134217728
oracle soft memlock 134217728
grid soft nofile 1024
grid hard nofile 65536
grid soft nproc 16384
grid hard nproc 16384
grid soft stack 10240
grid hard stack 32768
grid hard memlock 134217728
grid soft memlock 134217728
Insert the following entry to /etc/sysctl.conf files
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
Disable the SELINUX
/etc/selinux/config
SELINUX=disabled
Now set the profile for Grid & oracle users
# Grid Settings
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=rac01.localdomain
export GRID_BASE=/u01/app/grid
export GRID_HOME=/u01/app/21c/gridhome_1
export ORACLE_SID=+ASM1
export ORACLE_TERM=xterm
export BASE_PATH=/usr/sbin:$PATH
export PATH=$GRID_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$GRID_HOME/lib:/lib:/usr/lib
export CLASSPATH=$GRID_HOME/JRE:$GRID_HOME/jlib:$GRID_HOME/rdbms/jlib
# User specific environment and startup programs
mkdir -p /u02/app/oracle/product/21c/dbhome_1
------------------
# Oracle Settings
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=rac01.localdomain
export ORACLE_UNQNAME=CDBRAC
export ORACLE_BASE=/u02/app/oracle
export DB_HOME=$ORACLE_BASE/product/21c/dbhome_1
export ORACLE_HOME=$DB_HOME
export ORACLE_SID=cdb21c1
export ORACLE_TERM=xterm
export BASE_PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
NTP (Chrony on OL7/RHEL7) is enabled.
# systemctl enable chronyd.service
# systemctl restart chronyd.service
# chronyc -a 'burst 4/4'
# chronyc -a makestep
#Start The AVAHI Demon
[root@rac02 ~]# systemctl start avahi-daemon
[root@rac02 ~]# systemctl status avahi-daemon
# Now Shutdown the Node and clone the VM
# After Successful cloning, you just need to do change few things before starting first node.
--Change Hostname---
nmcli general hostname
nmcli general hostname rac02.localdomain
nmcli general hostname
service system-hostnamed restart
Now Add The Shared Disk
"D:\VirtualBox\VBoxManage" createhd --filename asm1.vdi --size 20480 --format VDI --variant Fixed
"D:\VirtualBox\VBoxManage" createhd --filename asm2.vdi --size 20480 --format VDI --variant Fixed
"D:\VirtualBox\VBoxManage" createhd --filename asm3.vdi --size 20480 --format VDI --variant Fixed
"D:\VirtualBox\VBoxManage" createhd --filename asm4.vdi --size 20480 --format VDI --variant Fixed
"D:\VirtualBox\VBoxManage" storageattach OELHA-01 --storagectl "SATA" --port 1 --device 0 --type hdd --medium asm1.vdi --mtype shareable
"D:\VirtualBox\VBoxManage" storageattach OELHA-01 --storagectl "SATA" --port 2 --device 0 --type hdd --medium asm2.vdi --mtype shareable
"D:\VirtualBox\VBoxManage" storageattach OELHA-01 --storagectl "SATA" --port 3 --device 0 --type hdd --medium asm3.vdi --mtype shareable
"D:\VirtualBox\VBoxManage" storageattach OELHA-01 --storagectl "SATA" --port 4 --device 0 --type hdd --medium asm4.vdi --mtype shareable
"D:\VirtualBox\VBoxManage" modifyhd asm1.vdi --type shareable
"D:\VirtualBox\VBoxManage" modifyhd asm2.vdi --type shareable
"D:\VirtualBox\VBoxManage" modifyhd asm3.vdi --type shareable
"D:\VirtualBox\VBoxManage" modifyhd asm4.vdi --type shareable
"D:\VirtualBox\VBoxManage" storageattach OELHA-02 --storagectl "SATA" --port 1 --device 0 --type hdd --medium asm1.vdi --mtype shareable
"D:\VirtualBox\VBoxManage" storageattach OELHA-02 --storagectl "SATA" --port 2 --device 0 --type hdd --medium asm2.vdi --mtype shareable
"D:\VirtualBox\VBoxManage" storageattach OELHA-02 --storagectl "SATA" --port 3 --device 0 --type hdd --medium asm3.vdi --mtype shareable
"D:\VirtualBox\VBoxManage" storageattach OELHA-02 --storagectl "SATA" --port 4 --device 0 --type hdd --medium asm4.vdi --mtype shareable
Configure the RAW disk
[root@rac01 ~]# fdisk -l
fdisk /dev/sdb
fdisk /dev/sdc
fdisk /dev/sdd
fdisk /dev/sde
fdisk /dev/sdf
[root@rac01 scripts]# /usr/sbin/oracleasm configure -i
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface []: grid
Default group to own the driver interface []: oinstall
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
/usr/sbin/oracleasm configure -i
/usr/sbin/oracleasm init
/usr/sbin/oracleasm createdisk DISKOCR1 /dev/sdb1
/usr/sbin/oracleasm createdisk DISKOCR2 /dev/sdc1
/usr/sbin/oracleasm createdisk DISKOCR3 /dev/sdd1
/usr/sbin/oracleasm createdisk DISKARC4 /dev/sde1
/usr/sbin/oracleasm createdisk DISKDAT5 /dev/sdf1
/usr/sbin/oracleasm scandisks
/usr/sbin/oracleasm listdisks
Configure ASMLIB on second Node
[root@rac02 ~]# /usr/sbin/oracleasm configure -i
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface []: grid
Default group to own the driver interface []: oinstall
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
[root@rac02 ~]# /usr/sbin/oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Configuring "oracleasm" to use device physical block size
Mounting ASMlib driver filesystem: /dev/oracleasm
[root@rac02 ~]# /usr/sbin/oracleasm init
[root@rac02 ~]# /usr/sbin/oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "DISKOCR2"
Instantiating disk "DISKOCR3"
Instantiating disk "DISKARC4"
Instantiating disk "DISKDAT5"
Instantiating disk "DISKOCR1"
[root@rac02 ~]# /usr/sbin/oracleasm listdisks
DISKARC4
DISKDAT5
DISKOCR1
DISKOCR2
DISKOCR3
[root@rac01 ~]# ls -lart /dev/oracleasm/disks/
total 0
drwxr-xr-x 4 root root 0 Sep 21 12:00 ..
drwxr-xr-x 1 root root 0 Sep 21 12:00 .
brw-rw---- 1 grid oinstall 8, 49 Sep 21 12:22 DISKOCR3
brw-rw---- 1 grid oinstall 8, 33 Sep 21 12:22 DISKOCR2
brw-rw---- 1 grid oinstall 8, 17 Sep 21 12:22 DISKOCR1
brw-rw---- 1 grid oinstall 8, 81 Sep 21 12:22 DISKDAT5
brw-rw---- 1 grid oinstall 8, 65 Sep 21 12:22 DISKARC4
# Now check the network connectivity and if you succeed in network connectivity then you can proceed with the rest:
GRID Installation:
To make password less SSH Connectivity you can do the following steps:
----PasswordLess—SSH---This may configure by your system administrator
--For GRID users, go to the following directory as GRID user
/u01/app/21c/gridhome_1/deinstall
./sshUserSetup.sh -user grid -hosts "rac01 rac02" -noPromptPassphrase -confirm -advanced
----For Oracle & ROOT
--Go to following directory as Oracle User
/u02/app/oracle/product/21c/dbhome_1/deinstall
./sshUserSetup.sh -user oracle -hosts "rac01 rac02" -noPromptPassphrase -confirm -advanced
---For ROOT
cp /u01/app/21c/gridhome_1/deinstall/sshUserSetup.sh .
./sshUserSetup.sh -user root -hosts "rac01 rac02" -noPromptPassphrase -confirm -advanced
Go to grid home and run ./gridSetup.sh
[grid@rac02 ~]$ crsctl check cluster -all
**************************************************************
rac01:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
rac02:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
[grid@rac02 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
ONLINE ONLINE rac01 STABLE
ONLINE ONLINE rac02 STABLE
ora.chad
ONLINE ONLINE rac01 STABLE
ONLINE ONLINE rac02 STABLE
ora.net1.network
ONLINE ONLINE rac01 STABLE
ONLINE ONLINE rac02 STABLE
ora.ons
ONLINE ONLINE rac01 STABLE
ONLINE ONLINE rac02 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
1 ONLINE ONLINE rac01 STABLE
2 ONLINE ONLINE rac02 STABLE
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac01 STABLE
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE rac01 STABLE
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE rac02 STABLE
ora.OCR.dg(ora.asmgroup)
1 ONLINE ONLINE rac01 STABLE
2 ONLINE ONLINE rac02 STABLE
ora.asm(ora.asmgroup)
1 ONLINE ONLINE rac01 Started,STABLE
2 ONLINE ONLINE rac02 Started,STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
1 ONLINE ONLINE rac01 STABLE
2 ONLINE ONLINE rac02 STABLE
ora.cdp1.cdp
1 ONLINE ONLINE rac01 STABLE
ora.cdp2.cdp
1 ONLINE ONLINE rac01 STABLE
ora.cdp3.cdp
1 ONLINE ONLINE rac02 STABLE
ora.cvu
1 ONLINE ONLINE rac01 STABLE
ora.qosmserver
1 ONLINE ONLINE rac01 STABLE
ora.rac01.vip
1 ONLINE ONLINE rac01 STABLE
ora.rac02.vip
1 ONLINE ONLINE rac02 STABLE
ora.scan1.vip
1 ONLINE ONLINE rac01 STABLE
ora.scan2.vip
1 ONLINE ONLINE rac01 STABLE
ora.scan3.vip
1 ONLINE ONLINE rac02 STABLE
[grid@rac02 ~]$ asmcmd
ASMCMD> lsdg
State Type Rebal Sector Logical_Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 512 4096 4194304 20476 20136 0 20136 0 Y OCR/
ASMCMD> lsdg
State Type Rebal Sector Logical_Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 512 4096 4194304 40952 40800 0 40800 0 N DATA/
MOUNTED EXTERN N 512 512 4096 4194304 20476 20336 0 20336 0 N FRA/
MOUNTED EXTERN N 512 512 4096 4194304 20476 20136 0 20136 0 Y OCR/
ASMCMD>
Now Configure Your ASM Disk for Database,
Now Install DB software only:
Install Database using DBCA:
[grid@rac01 ~]$ srvctl status database -d CDBRAC
Instance CDBRAC1 is running on node rac01
Instance CDBRAC2 is running on node rac02