In this comprehensive guide, we’ll walk you through the process of installing and configuring a two-node Oracle Real Application Clusters (RAC) environment using Oracle Database 21c on the latest version of Oracle Linux. We’ll cover everything from hardware requirements and kernel parameters to installing binaries and configuring Automatic Storage Management (ASM).
Table of Contents
- Prerequisites
- Hardware Requirements
- Network Configuration
- Setting Kernel Parameters
- Creating Users and Groups
- Configuring Shared Storage with ASM
- Installing Oracle Grid Infrastructure
- Installing Oracle Database Software
- Creating a RAC Database
- Post-Installation Tasks
- Conclusion
Prerequisites
Before you begin, ensure you have the following:
- Access to two servers running the latest version of Oracle Linux.
- Oracle Database 21c software (both Grid Infrastructure and Database).
- Basic understanding of Oracle RAC concepts.
Hardware Requirements
Ensure that both nodes meet the minimum hardware requirements:
- CPU: At least 2 CPU cores per node.
- Memory: Minimum 8 GB RAM per node.
- Storage:
- At least 15 GB for Oracle Grid Infrastructure binaries.
- At least 20 GB for Oracle Database binaries.
- Shared storage for ASM disks.
- Network: At least two network interfaces per node (one for public network and one for private interconnect).
Network Configuration
Configure the network interfaces on both nodes:
- Public Interface: For client connections.
- Example:
eth0
- Example:
- Private Interface: For cluster interconnect.
- Example:
eth1
- Example:
Ensure that both nodes can resolve each other’s public and private hostnames via /etc/hosts
or DNS.
Editing /etc/hosts
192.168.1.101 racnode1.localdomain racnode1
192.168.1.102 racnode2.localdomain racnode2
10.0.0.1 racnode1-priv.localdomain racnode1-priv
10.0.0.2 racnode2-priv.localdomain racnode2-priv
Setting Kernel Parameters
Modify the kernel parameters on both nodes as per Oracle recommendations.
Editing /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 8589934592
# Set to half of your physical memory
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 = 1048576
Apply the changes:
# sysctl -p
Setting Shell Limits
Edit /etc/security/limits.conf
and add:
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
Creating Users and Groups
Create the necessary OS groups and user:
# groupadd -g 54321 oinstall
# groupadd -g 54322 dba
# groupadd -g 54323 asmadmin
# groupadd -g 54324 asmdba
# groupadd -g 54325 asmoper
# useradd -u 54321 -g oinstall -G dba,asmdba,asmadmin,asmoper oracle
# passwd oracle
Configuring Shared Storage with ASM
Configure shared disks for ASM on both nodes. For this guide, we’ll use udev rules to map the devices.
Identifying Shared Disks
Assuming the shared disks are /dev/sdb
and /dev/sdc
.
Setting Up Udev Rules
Create udev rules in /etc/udev/rules.d/99-oracle-asm.rules
:
KERNEL=="sd[b-c]", OWNER="oracle", GROUP="asmadmin", MODE="0660"
Reload udev rules:
# udevadm control --reload-rules
# udevadm trigger
Installing Oracle Grid Infrastructure
As the oracle
user, perform the following steps:
Setting Up Environment Variables
$ vi ~/.bash_profile
Add the following lines
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/21.0.0/grid
export PATH=$PATH:$ORACLE_HOME/bin
Running the Installer
- Unzip the Grid Infrastructure software:
$ unzip linuxx64_21_grid_home.zip -d $ORACLE_HOME
- Start the installer:
$ $ORACLE_HOME/gridSetup.sh
Installer Steps
- Select Configure Oracle Grid Infrastructure for a New Cluster.
- Provide cluster name and SCAN details.
- Add both nodes to the cluster configuration.
- Select Use Standard ASM for storage.
- Specify ASM passwords and disk groups.
- Complete the installation and run the root scripts when prompted.
Installing Oracle Database Software
As the oracle
user, proceed with the database installation.
Running the Installer
- Unzip the Database software:
$ unzip LINUX.X64_213000_db_home.zip -d $ORACLE_BASE/product/21.0.0/dbhome_1
- Start the installer:
$ $ORACLE_BASE/product/21.0.0/dbhome_1/runInstaller
Installer Steps
- Choose Install database software only.
- Select Oracle Real Application Clusters database installation.
- Select both nodes for installation.
- Choose Enterprise Edition.
- Specify the Oracle base and software locations.
- Run root scripts when prompted.
Creating a RAC Database
After installing the software, create a RAC database using the Database Configuration Assistant (DBCA).
Running DBCA
$ dbca
DBCA Steps
- Select Create a database.
- Choose Oracle Real Application Clusters (RAC) database.
- Select both nodes for the database instances.
- Choose Advanced configuration.
- Configure database options as required.
- Select ASM as the storage option and choose the disk groups.
- Complete the database creation.
Post-Installation Tasks
Perform the following tasks to finalize the setup:
Setting Environment Variables
Update the ~/.bash_profile
:
export ORACLE_SID=orcl
export ORACLE_HOME=/u01/app/oracle/product/21.0.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin
Verifying the RAC Status
$ srvctl status database -d orcl
Conclusion
You have successfully installed and configured a two-node Oracle RAC environment on Oracle 21c using Oracle Linux.
This setup allows for high availability and scalability for your Oracle databases.