In today’s article, we will install Oracle RAC 19c on Linux. Our installation will be on Oracle Linux 8.
What is Oracle RAC?
Oracle Real Application Cluster is a cluster structure in which multiple servers work for a single service using shared disk technology prepared for an uninterrupted database access. Thanks to this structure that works with a minimum of two servers, we aim for uninterrupted service at maximum efficiency in production environments.
For Real Application Cluster installation, we will use two Oracle Linux operating systems, two ethernet cards connected to these operating systems and a shared disk that can be seen by both operating systems.
Install Oracle RAC 19c on Linux
Installation Steps:
Our installation steps will be as follows;
Step1: How To Install Oracle Linux
Step2: How To Install Oracle Grid Infrastructure 19c on Linux
Step3: How To Install Oracle 19c Database on Linux
First you should read Step1: How To Install Oracle Linux. If you already have Oracle Linux, you should configure your operating systems as follows.
Network Configuration for Oracle RAC
We install our operating system by following the steps on the link above. In this way, we need to use two operations. I’ll use the names node1.bugraparlayan.local for the first operating system and node2.bugraparlayan.local for the second operating system.
Now that the operating system is ready, let’s edit the network and packages.
First of all, we make our Network settings. In this way, my servers can be accessed via the relevant ip address.
Public IP Definitions for Node1:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
IP Address : 192.168.132.130 Subnet : 255.255.255.0 Gateway : 192.168.132.2 # nano /etc/sysconfig/network-scripts/ifcfg-ens160 PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=none DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=ens160 UUID=2c37e065-760b-460c-a0eb-6d388b6c7134 DEVICE=ens160 ONBOOT=yes IPADDR=192.168.132.130 PREFIX=24 GATEWAY=192.168.132.2 DNS1=192.168.132.2 |
Public IP Definitions for Node2:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
IP Address : 192.168.132.131 Subnet : 255.255.255.0 Gateway : 192.168.132.2 # nano /etc/sysconfig/network-scripts/ifcfg-ens160 PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=none DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=ens160 UUID=2c37e065-760b-460c-a0eb-6d388b6c7134 DEVICE=ens160 ONBOOT=yes IPADDR=192.168.132.1301 PREFIX=24 GATEWAY=192.168.132.2 DNS1=192.168.132.2 |
We configure our second ethernet card for interconnect connections.
Private IP Definitions for Node1:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
IP Address : 172.16.132.130 Subnet : 255.255.255.0 Gateway : 172.16.132.2 #nano /etc/sysconfig/network-scripts/ifcfg-ens224 TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=none DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=ens224 UUID=e0338812-35e5-48ad-b139-987da44807ed DEVICE=ens224 ONBOOT=no IPADDR=172.16.132.130 PREFIX=24 GATEWAY=172.16.132.2 DNS1=172.16.132.2 |
Private IP Definitions for Node2:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
IP Address : 172.16.132.130 Subnet : 255.255.255.0 Gateway : 172.16.132.2 #nano /etc/sysconfig/network-scripts/ifcfg-ens224 TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=none DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=ens224 UUID=e0338812-35e5-48ad-b139-987da44807ed DEVICE=ens224 ONBOOT=no IPADDR=172.16.132.131 PREFIX=24 GATEWAY=172.16.132.2 DNS1=172.16.132.2 |
Restart NetworkManager Service on Oracle Linux
Since we have added public and private ip information on both our servers, we can restart our network service.
Disable Selinux on Oracle Linux
We disable Selinux on Node1 and Node2.
1 2 3 |
# nano /etc/selinux/config SELINUX=disable |
Disable Firewall on Oracle Linux
We disable Firewall services on Node1 and Node2.
1 2 3 |
# systemctl stop firewalld.service # systemctl disable firewalld.service |
NTP Configuration on Oracle Linux
We do our NTP configuration for node 1 and node 2 and restart the service.
1 2 3 4 5 6 |
nano /etc/chrony.conf server tr.pool.ntp.org iburst # systemctl restart chronyd.service # systemctl enable chronyd.service |
Install Packages
We install our packages required for installations. The preinstall package will automatically create priority users for us. We run it for Node1 and Node2.
1 2 3 4 |
# yum install oracle-database-preinstall-19c # yum install oracleasm-support # reboot |
Create Users
I create the following users on Node1 and Node2 and assign them to groups.
1 2 3 4 5 6 7 |
# groupadd -g 54333 asmdba # groupadd -g 54334 asmoper # groupadd -g 54335 asmadmin # useradd -m -u 54341 -g oinstall -G dba,asmadmin,asmdba,asmoper -d /home/grid -s /bin/bash grid # usermod -a -G asmdba oracle # passwd oracle # passwd grid |
I create the following folders on Node1 and Node2 and configure the related rights.
1 2 3 4 5 6 |
mkdir -p /u01/app/grid/19.3.0/gridhome_1 mkdir -p /u01/app/grid/gridbase/ mkdir -p /u01/app/oracle/database/19.3.0/dbhome_1 chown -R oracle.oinstall /u01/ chown -R grid.oinstall /u01/app/grid chmod -R 775 /u01/ |
Now we will make our profile definitions. This process will again be for Node1 and Node2.
I am making the .bash_profile definitions for the “oracle” user on Node 1.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# nano /home/oracle/.bash_profile # Oracle Settings export TMP=/tmp export TMPDIR=$TMP export ORACLE_HOSTNAME=node1.bugraparlayan.local export ORACLE_UNQNAME=BUGRA19C export ORACLE_BASE=/u01/app/oracle/database/19.3.0/ export DB_HOME=$ORACLE_BASE/dbhome_1 export ORACLE_HOME=$DB_HOME export ORACLE_SID=BUGRA19C1 export ORACLE_TERM=xterm export PATH=/usr/sbin:/usr/local/bin:$PATH export PATH=$ORACLE_HOME/bin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib |
I make the .bash_profile definitions for the “grid” user on Node 1.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# nano /home/grid/.bash_profile # Grid Settings export TMP=/tmp export TMPDIR=$TMP export ORACLE_HOSTNAME=node1.bugraparlayan.local export ORACLE_BASE=/u01/app/grid/gridbase/ export ORACLE_HOME=/u01/app/grid/19.3.0/gridhome_1 export GRID_BASE=/u01/app/grid/gridbase/ export GRID_HOME=/u01/app/grid/19.3.0/gridhome_1 export ORACLE_SID=+ASM1 export ORACLE_TERM=xterm export PATH=/usr/sbin:/usr/local/bin:$PATH export PATH=$ORACLE_HOME/bin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib |
I am making my .bash_profile definitions for the “oracle” user on Node2.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#nano /home/oracle/.bash_profile export TMP=/tmp export TMPDIR=$TMP export ORACLE_HOSTNAME=node2.bugraparlayan.local export ORACLE_UNQNAME=BUGRA19C export ORACLE_BASE=/u01/app/oracle/database/19.3.0/ export DB_HOME=$ORACLE_BASE/dbhome_1 export ORACLE_HOME=$DB_HOME export ORACLE_SID=BUGRA19C2 export ORACLE_TERM=xterm export PATH=/usr/sbin:/usr/local/bin:$PATH export PATH=$ORACLE_HOME/bin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib |
Node2 üzerindeki ” grid ” kullanıcısı için .bash_profile tanımlarımı yapıyorum.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
# Grid Settings export TMP=/tmp export TMPDIR=$TMP export ORACLE_HOSTNAME=rac2.bugraparlayan.local export ORACLE_BASE=/u01/app/grid/gridbase/ export ORACLE_HOME=/u01/app/grid/19.3.0/gridhome_1 export GRID_BASE=/u01/app/grid/gridbase/ export GRID_HOME=/u01/app/grid/19.3.0/gridhome_1 export ORACLE_SID=+ASM2 export ORACLE_TERM=xterm export PATH=/usr/sbin:/usr/local/bin:$PATH export PATH=$ORACLE_HOME/bin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib |
We add the following information to the Node1 and Node2 hosts file.
1 2 3 4 5 6 7 8 9 10 11 |
# nano /etc/hosts 192.168.132.130 node1 node1.bugraparlayan.local 192.168.132.131 node2 node2.bugraparlayan.local 192.168.132.132 node1-vip node1-vip.bugraparlayan.local 192.168.132.133 node2-vip node2-vip.bugraparlayan.local 192.168.132.134 bgrdb-scan bgrdb-scan.bugraparlayan.local 192.168.132.135 bgrdb-scan bgrdb-scan.bugraparlayan.local 192.168.132.136 bgrdb-scan bgrdb-scan.bugraparlayan.local 172.16.132.10 node1-priv node1-priv.bugraparlayan.local 172.16.132.11 node2-priv node2-priv.bugraparlayan.local |
Step1 is completed. Now you should read below article to install oracle grid 19c.
Step2:How To Install Oracle Grid Infrastructure 19c on Linux
Step3:
How To Install Oracle 19c on Linux
In Step1 and Step2, I explained the operating system and Grid installation. In this section, I will explain Oracle 19c Database installation on Grid infrastructure.
We can quickly start our Oracle Database installation. First we will just install the software and then create the Database.
1 2 3 |
[root@node1 ~]# su - oracle [oracle@node1 ~]$ cd $ORACLE_HOME [oracle@node1 ~]$ ./runInstaller |
Since I will need some technical requirements, I want to take advantage of the “Enterprise Edition” benefits. For this reason, I will continue with “Enterprise Edition” selected.
In the last step, it will ask us to run a script. You can make the script run automatically by selecting the pointed section below.
In this step, the “root.sh” script will be run on both servers.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
[root@node1 dbhome_1]# /u01/app/oracle/database/19.3.0/dbhome_1/root.sh Performing root user operation. The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/database/19.3.0/dbhome_1/ Enter the full pathname of the local bin directory: [/usr/local/bin]: The contents of “dbhome” have not changed. No need to overwrite. The contents of “oraenv” have not changed. No need to overwrite. The contents of “coraenv” have not changed. No need to overwrite. Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root script. Now product-specific root actions will be performed. |
1 2 3 4 5 6 7 8 9 10 11 |
p/oracle/database/19.3.0/dbhome_1/ Enter the full pathname of the local bin directory: [/usr/local/bin]: The contents of “dbhome” have not changed. No need to overwrite. The contents of “oraenv” have not changed. No need to overwrite. The contents of “coraenv” have not changed. No need to overwrite. Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root script. Now product-specific root actions will be performed. |
Create Oracle 19c Database
1 2 3 4 5 6 7 8 9 10 11 12 13 |
[oracle@node1 ~]$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Thu Oct 1 10:34:28 2020 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 SQL> |
Hope to see you again,