Step-By-Step Installation of RAC on Linux


Purpose

This document will provide the reader with step-by-step instructions on how to install a cluster, install Oracle Real Application Clusters (RAC) and start a cluster database on Linux. For additional explanation or information on any of these steps, please see the references listed at the end of this document.

  1. Configuring the Clusters Hardware
 1.1 Minimal Hardware list / system Requirements
 1.1.1 Hardware
 1.1.2 Software
 1.2 Installing the Shared Disk Subsystem
 1.3 Installing Cluster Interconnect and Public Network Hardware
 1.4 Configuring the Interconnect
 2. Creating a Cluster
 2.1 Cluster Software Installation
 2.2 Configuring the Kernel for Real Application Cluster Support
 3. Preparing for the Installation of RAC
 3.1 Configure the Shared Disks and UNIX Preinstallation Tasks
 3.1.1 UNIX Preinstallation Steps
 3.1.2 Configure the shared disks
 3.2 Using the Oracle Universal Installer for Real Application Clusters
 3.3 Configure the Cluster Manager, Node Monitor and SRVCTL configuration file
 3.4 Configuring the Listeners
 3.5 Create a RAC Database using the Oracle Database Configuration Assistant
 4. Administering Real Application Cluster Instances
 5. References


1. Configuring the Clusters Hardware
1.1 Minimal Hardware list / System Requirements

Please check the RAC/Linux certification matrix for information on currently supported hardware/software.

1.1.1 Hardware

1.1.2 Software

1.2 Installing the Shared Disk Subsystem
This is highly dependent on the subsystem you have chosen. Please refer to your hardware documentation for installation and configuration instructions on Linux. Additional drivers and patches might be required. In this article we assume that the shared disk subsystem is correctly installed and that the shared disks are visible to all nodes in the cluster. Real Application Clusters requires the use of raw devices on Linux. You will need to carefully partition your disks to have adequate sized partitions. Using LVM (Logical Volume Manager) is very useful to make the management of raw devices more flexible.
In this article we will use LVM logical volumes. The only difference with using disk partitions is in the binding of the raw devices, you'll have to use the partitions (ex: /sbin/raw /dev/raw/raw1 /dev/sda1) instead of the logical volumes (ex: /sbin/raw /dev/raw/raw1 /dev/oracle/db_name_raw_system_251m).

1.3 Installing Cluster Interconnect and Public Network Hardware

1.4 Configuring the Interconnect

Each system will have at least an IP address for the public network and one for the private cluster interconnect. For the public network, get the addresses from your network manager. For the private interconnect use 1.1.1.1 , 1.1.1.2 for the first and second node. Make sure to add all addresses in /etc/hosts.
 

ex:
9.25.120.143    rac1        #Oracle 9i Rac node 1 - public network
9.25.120.143    rac2        #Oracle 9i Rac node 2 - public network

1.1.1.1              int-rac1   #Oracle 9i Rac node 1 - interconnect
1.1.1.2              int-rac2   #Oracle 9I Rac node 2 - interconnect


Use your favorite tool to configure these adapters (ex: YaST2 on SuSE Linux). Make sure your public network is the primary (eth0).


2. Creating a Cluster

2.1 Cluster Software Installation

On Linux, the cluster software required to run Real Application Clusters is included in the Oracle distribution. There is a difference between Oracle V9.0 and V9.2 as indicated in the relevant sections.

2.2 Configuring the Kernel for Real Application Cluster Support
When the Kernel sources are included, you can check support for

When watchdog support is not configured, refer to  Linux/Watchdog Configuration Steps   or contact your Operating System support organization.

When the kernel is correctly configured for watchdog support as a loadable module, we need to load this module. Put the following command also in your startup scripts. I would recommend to group all actions to be performed as root at system startup in a file called startoracle_root.sh. The following command will be the first entry:

/sbin/insmod softdog soft_margin=60



3. Preparing for the Installation of RAC

The Real Application Clusters installation process includes four major tasks.

  1. Configure the shared disks and UNIX preinstallation tasks.
  2. Run the Oracle Universal Installer to install the Oracle9i Enterprise Edition and the Oracle9i Real Application Clusters software.
  3. Configure the cluster manager and node monitor (V90 only).
  4. Create and configure your database.
3.1 Configure the Shared Disks and UNIX Preinstallation Tasks

3.1.1 UNIX Preinstallation Steps

Add the Oracle USER
Depending on your Linux Operating System vendor (ex: SuSE) , this may have been preconfigured.

System Kernel Parameters
Verify operating system kernel parameters are set to appropriate levels:
 
Kernel Parameter
Setting
Purpose
SHMMAX Physical memory/2 Maximum allowable size of one shared memory segment. Should be half the size of the physical memory.
SHMMIN 1 Minimum allowable size of a single shared memory segment.
SEMMNI 1024 Maximum number of semaphore sets in the entire system.
SEMMSL 100 Minimum recommended value. SEMMSL should be 10 plus the largest PROCESSES parameter of any Oracle database on the system.
SEMMNS 1024 Maximum semaphores on the system. This setting is a minimum recommended value. SEMMNS should be set to the sum of the PROCESSES parameter for each Oracle database, add the largest one twice, plus add an additional 10 for each database.
SEMOPM 100 Maximum number of operations per semop call.
SEMVMX 32767 Maximum value of a semaphore.
(swap space) 1 Gb Two to four times your system's physical memory size.

You will have to set the correct parameters during system startup, so include them in your startup script (startoracle_root.sh):

$ export SEMMSL=100
$ export SEMMNS=1024
$ export SEMOPM=100
$ export SEMMNI=100
$ echo  $SEMMSL $SEMMNS $SEMOPM $ SEMMNI > /proc/sys/kernel/sem
$ export SHMMAX=2147483648
$ echo $SHMMAX > /proc/sys/kernel/shmmax
Check these with:
$ cat /proc/sys/kernel/sem
$ cat /proc/sys/kernel/shmmax
Set file handles and process limits
echo 65536 > /proc/sys/fs/file-max
ulimit -n 65536


Establish system environment variables

Establish Oracle environment variables: Set the following Oracle environment variables (ex in .profile , depending on the shell used by oracle):
 
 
Environment Variable
Suggested value
ORACLE_BASE e.g. /oracle
ORACLE_HOME e.g. /oracle/product/901
ORACLE_TERM xterm
NLS_LANG AMERICAN_AMERICA.UTF8 for example
TNS_ADMIN $ORACLE_HOME/network/admin
ORA_NLS33 $ORACLE_HOME/ocommon/nls/admin/data
PATH Should contain $ORACLE_HOME/bin
LD_LIBRARY_PATH Should contain $ORACLE_HOME/lib:$ORACLE_HOME/oracm/lib
CLASSPATH $ORACLE_HOME/JRE:$ORACLE_HOME/jlib \
$ORACLE_HOME/rdbms/jlib: \
$ORACLE_HOME/network/jlib
THREADS_FLAG native
3.1.2 Configure the shared disks

Real Application Clusters requires that all instances be able to access a set of unformatted devices on a shared disk subsystem. These shared disks are also referred to as raw devices. If your platform supports an Oracle-certified cluster file system, however, you can store the files that Real Application Clusters requires directly on the cluster file system.

The Oracle instances in Real Application Clusters write data onto the raw devices to update the control file, server parameter file, each datafile, and each redo log file. All instances in the cluster share these files. The Oracle provided node monitor also needs a raw device shared by all nodes.

The Oracle instances in the RAC configuration write information to raw devices defined for:


It is therefore necessary to define raw devices for each of these categories of files. The Oracle Database Configuration Assistant (DBCA) will create a seed database expecting the following configuration (replace db_name with the actual name of your database):
 

Note: the logical volumes should be bigger than the size of the oracle datafiles, in the following table, Datafile Size indicates the size used for the Oracle datafiles. In this article, we created the logical volumes or disk partitions 1Mb bigger (indicated by the sample filenames).The sizes indicated here are according to what dbca uses as defaults except for the redo logfiles. You are strongly encouraged to adjust the sizes to your needs, but don't forget to correct them when running DBCA to create the database.

 
Raw Volume
Datafile Size
Sample File Name
SYSTEM tablespace
250Mb
/dev/oracle/db_name_raw_system_251m
USERS tablespace
25 Mb
/dev/oracle/db_name_raw_users_26m
TEMP tablespace
40 Mb
/dev/oracle/db_name_raw_temp_41m
UNDOTBS tablespace per instance
200 Mb
/dev/oracle/db_name_raw_undotbsx_201m
INDX tablespace
25 Mb
/dev/oracle/db_name_raw_indx_26m
TOOLS tablespace
10 Mb
/dev/oracle/db_name_raw_tools_11m
First control file
110 Mb
/dev/oracle/db_name_raw_controlfile1_110m
Second control file
110 Mb
/dev/oracle/db_name_raw_controlfile2_110m
Two ONLINE redo log files per instance
120 Mb x 2
/dev/oracle/db_name_thread_lognumber_121m
spfile.ora
5 Mb
/dev/oracle/db_name_raw_spfile_5m
srvmconfig
104 Mb
/dev/oracle/srvctl_raw__104m
 The following device is not used by DBCA ***************  It is included for having an overview on raw devices. This is used as quorum disk in Oracle RAC V9.2+
node monitor        1Mb  minimum size: (4 * number of nodes in the cluster ) + 4 (in Kb) 
/dev/oracle/nm_raw_5m
Notes:


After creating the nessecary partitions or logical volumes, , you have to bind the raw devices.  Please check where your raw devices are located, look for /dev/raw1 or /dev/raw/raw1.These bindings have to be recreated at system reboot, so put the commands in your startup scripts (startoracle_root.sh) .  This must be executed as root on all nodes. The bind commands look like:

/usr/sbin/raw /dev/raw1 /dev/oracle/db_name_raw_system_251m
/usr/sbin/raw /dev/raw2 /dev/oracle/db_name_users_26m
/usr/sbin/raw /dev/raw3 /dev/oracle/db_name_raw_temp_41m
/usr/sbin/raw /dev/raw4 /dev/oracle/db_name_raw_undotbs_201m
/usr/sbin/raw /dev/raw5 /dev/oracle/db_name_raw_undotbs2_201m
/usr/sbin/raw /dev/raw6 /dev/oracle/db_name_raw_indx_26m
/usr/sbin/raw /dev/raw7 /dev/oracle/db_name_raw_controlfile1_110m
/usr/sbin/raw /dev/raw8 /dev/oracle/db_name_raw_controlfile2_110m
/usr/sbin/raw /dev/raw9 /dev/oracle/db_name_raw_rdo_1_1_121m
/usr/sbin/raw /dev/raw10 /dev/oracle/db_name_raw_rdo_1_2_121m
/usr/sbin/raw /dev/raw11 /dev/oracle/db_name_raw_rdo_2_1_121m
/usr/sbin/raw /dev/raw12 /dev/oracle/db_name_raw_rdo_2_2_121m
/usr/sbin/raw /dev/raw13 /dev/oracle/db_name_raw_spfile_5m
/usr/sbin/raw /dev/raw14 /dev/oracle/nm_raw_5m
/usr/sbin/raw /dev/raw15 /dev/oracle/srvctl_raw
/usr/sbin/raw /dev/raw16 /dev/oracle/db_name_raw_tools_11m
Also make sure to set the permissions and ownership as required on all nodes- Add this to your startup script:
 
/bin/chmod 600 /dev/raw1
/bin/chmod 600 /dev/raw2
/bin/chmod 600 /dev/raw3
/bin/chmod 600 /dev/raw4
/bin/chmod 600 /dev/raw5
/bin/chmod 600 /dev/raw6
/bin/chmod 600 /dev/raw7
/bin/chmod 600 /dev/raw8
/bin/chmod 600 /dev/raw9
/bin/chmod 600 /dev/raw10
/bin/chmod 600 /dev/raw11
/bin/chmod 600 /dev/raw12
/bin/chmod 600 /dev/raw13
/bin/chmod 600 /dev/raw14
/bin/chmod 600 /dev/raw15
/bin/chmod 600 /dev/raw16

/bin/chown oracle.dba /dev/raw1
/bin/chown oracle.dba /dev/raw2
/bin/chown oracle.dba /dev/raw3
/bin/chown oracle.dba /dev/raw4
/bin/chown oracle.dba /dev/raw5
/bin/chown oracle.dba /dev/raw6
/bin/chown oracle.dba /dev/raw7
/bin/chown oracle.dba /dev/raw8
/bin/chown oracle.dba /dev/raw9
/bin/chown oracle.dba /dev/raw10
/bin/chown oracle.dba /dev/raw11
/bin/chown oracle.dba /dev/raw12
/bin/chown oracle.dba /dev/raw13
/bin/chown oracle.dba /dev/raw14
/bin/chown oracle.dba /dev/raw15
/bin/chown oracle.dba /dev/raw16
 

You can verify the bindings with:
$ raw -qa
/dev/raw1:  bound to major 3, minor 7
/dev/raw2:  bound to major 3, minor 8
...
I would also suggest to create soft links to the raw devices in your $ORACLE_BASE/oradata/db_name directory. In this example, $ORACLE_BASE is /oracle.
Don't forget to substitute the string db_name with your actual database name. Do this as oracle user on all nodes.
$ mkdir /oracle/oradata
$ mkdir /oracle/oradata/db_name
ln -s /dev/raw1 /oracle/oradata/db_name/db_name_raw_system_251m
ln -s /dev/raw2 /oracle/oradata/db_name/db_name_raw_users_26m
ln -s /dev/raw3 /oracle/oradata/db_name/db_name_raw_temp_41m
ln -s /dev/raw4 /oracle/oradata/db_name/db_name_raw_undotbs_201m
ln -s /dev/raw5 /oracle/oradata/db_name/db_name_raw_undotbs2_201m
ln -s /dev/raw6 /oracle/oradata/db_name/db_name_raw_indx_26m
ln -s /dev/raw7 /oracle/oradata/db_name/db_name_raw_controlfile1_110m
ln -s /dev/raw8 /oracle/oradata/db_name/db_name_raw_controlfile2_110m
ln -s /dev/raw9 /oracle/oradata/db_name/db_name_raw_rdo_1_1_121m
ln -s /dev/raw10 /oracle/oradata/db_name/db_name_raw_rdo_1_2_121m
ln -s /dev/raw11 /oracle/oradata/db_name/db_name_raw_rdo_2_1_121m
ln -s /dev/raw12 /oracle/oradata/db_name/db_name_raw_rdo_2_2_121m
ln -s /dev/raw13 /oracle/oradata/db_name/db_name_raw_spfile_5m
ln -s /dev/raw16 /oracle/oradata/db_name/db_name_raw_tools_11m
On the node from which you run the Oracle Universal Installer, create an ASCII file identifying the raw volume objects as shown above. The
DBCA requires that these objects exist during installation and database creation. When creating the ASCII file content for the objects, name them
using the format:

database_object=raw_device_file_path or database_object=soft_link

When you create the ASCII file, separate the database objects from the paths with equals (=) signs as shown in the example below:-

system=/oracle/oradata/db_name/db_name_raw_system_251m
users=/oracle/oradata/db_name/db_name_raw_users_26m
temp=/oracle/oradata/db_name/db_name_raw_temp_41m
undotbs1=/oracle/oradata/db_name/db_name_raw_undotbs_201m
undotbs2=/oracle/oradata/db_name/db_name_raw_undotbs2_201m
control1=/oracle/oradata/db_name/db_name_raw_controlfile1_110m
control2=/oracle/oradata/db_name/db_name_raw_controlfile2_110m
redo1_1=/oracle/oradata/db_name/db_name_raw_rdo_1_1_121m
redo1_2=/oracle/oradata/db_name/db_name_raw_rdo_1_2_121m
redo2_1=/oracle/oradata/db_name/db_name_raw_rdo_2_1_121m
redo2_2=/oracle/oradata/db_name/db_name_raw_rdo_2_2_121m
spfile=/oracle/oradata/db_name/db_name_raw_spfile_5m
indx=/oracle/oradata/db_name/db_name_raw_indx_26m
tools=/oracle/oradata/db_name/db_name_raw_tools_11m
You must specify that Oracle should use this file to determine the raw device volume names by setting the following environment variable where filename
is the name of the ASCII file that contains the entries shown in the example above:

setenv DBCA_RAW_CONFIG filename
or
export DBCA_RAW_CONFIG=filename
 

3.2 Using the Oracle Universal Installer for Real Application Clusters

Follow these procedures to use the Oracle Universal Installer to install the Oracle Enterprise Edition and the Real Application Clusters software. Oracle9i is supplied on multiple CD-ROM disks. During the installation process it is necessary to switch between the CD-ROMS. OUI will manage the switching between CDs.

To install the Oracle Software, perform the following:

For Oracle RAC V9.2+:                     $ export ORACLE_HOME=/oracle/product/9.2.0
                    $ORACLE_HOME/oracm/bin/ocmstart.sh For Oracle RAC V9.0.1: 3.3 Configure the Cluster Manager, Node Monitor and SRVCTL configuration file
For Oracle RAC V9.0.1:
By selecting the Real Application Clusters option during the Oracle software installation, the cluster software has been installed.
we will need to configure the node monitor. For Oracle RAC V9.2+:
The global services daemon will be started, but add the following to your startup script : 3.4 Configuring the Listeners
Before creating our database, we will configure the listeners, this avoids errors during the database creation. 3.5 Create a RAC Database using the Oracle Database Configuration Assistant

The Oracle Database Configuration Assistant (DBCA) will create a database for you (for an example of manual database creation see Database Creation in Oracle9i RAC). The DBCA creates your database using the optimal flexible architecture (OFA). This means the DBCA creates your database files, including the default server parameter file, using standard file naming and file placement practices. The primary phases of DBCA processing are:-

Oracle Corporation recommends that you use the DBCA to create your database. This is because the DBCA preconfigured databases optimize your environment to take advantage of Oracle9i features such as the server parameter file and automatic undo management. The DBCA also enables you to
define arbitrary tablespaces as part of the database creation process. So even if you have datafile requirements that differ from those offered in one of the DBCA templates, use the DBCA. You can also execute user-specified scripts as part of the database creation process.

The DBCA and the Oracle Net Configuration Assistant also accurately configure your Real Application Clusters environment for various Oracle high availability features and cluster administration tools.

A new database now exists. It can be accessed via Oracle SQL*PLUS or other applications designed to work with an Oracle RAC database.  You should make sure to execute the startoracle_root.sh script at system startup as root and the startoracle.sh script as user oracle.
 

For Oracle RAC V9.2.0.1:
Please install patch  Patch 2417903 available via MetaLink. This resolves an issue with slow startup of your instances.


4. Administering Real Application Clusters Instances

Oracle Corporation recommends that you use SRVCTL to administer your Real Application Clusters database environment. SRVCTL manages configuration
information that is used by several Oracle tools. For example, Oracle Enterprise Manager and the Intelligent Agent use the configuration information that
SRVCTL generates to discover and monitor nodes in your cluster. Before using SRVCTL, ensure that your Global Services Daemon (GSD) is running. To use SRVCTL, you must have already created the configuration information for the database that you want to administer.
You must have done this either by using the Oracle Database Configuration Assistant (DBCA), or by using the srvctl add command. If you have followed the instructions in this article, dbca will have added your database and instances.

For Oracle RAC V9.0.1:
$ srvctl config -p racdb1
racnode1 racinst1
racnode2 racinst2

$ srvctl config -p racdb1 -n racnode1
racnode1 racinst1

Examples of starting and stopping RAC follow:-

$ srvctl start -p racdb1
Instance successfully started on node: racnode2
Listeners successfully started on node: racnode2
Instance successfully started on node: racnode1
Listeners successfully started on node: racnode1

$ srvctl stop -p racdb1
Instance successfully stopped on node: racnode2
Instance successfully stopped on node: racnode1
Listener successfully stopped on node: racnode2
Listener successfully stopped on node: racnode1

$ srvctl stop -p racdb1 -i racinst2 -s inst
Instance successfully stopped on node: racnode2

$ srvctl stop -p racdb1 -s inst
PRKO-2035 : Instance is already stopped on node: racnode2
Instance successfully stopped on node: racnode1

For Oracle RAC V9.2+:
$ srvctl config database -d racdb1
racnode1 racinst1 /oracle/product/9.2.0
racnode2 racinst2 /oracle/product/9.2.0

Examples of starting and stopping RAC follow:-

$ srvctl start database -d racdb1
$ srvctl status database -d arldb
Instance racinst1 is running on racnode1
Instance racinst2 is running on racnode2

$ srvctl stop database -d racdb1
$ srvctl status database -d arldb
Instance racinst1 is not running on racnode1
Instance racinst2 is not running on racnode2

$ srvctl start instance -d racdb1 -i racinst1
$ srvctl status instance -d racdb1 -i racinst1
Instance racinst1 is running on racnode1

$ srvctl status database -d arldb
Instance racinst1 is running on racnode1
Instance racinst2 is not running on racnode2

$ srvctl stop instance -d racdb1 -i racinst1

For further information on srvctl see the Oracle9i Real Application Clusters Administration Release 1 (9.0.1) manual.


5. References

 
 
 
 
 
 

.