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 Hardware1.1 Minimal Hardware list / system Requirements2. Creating a Cluster1.1.1 Hardware1.2 Installing the Shared Disk Subsystem
1.1.2 Software
1.3 Installing Cluster Interconnect and Public Network Hardware
1.4 Configuring the Interconnect2.1 Cluster Software Installation3. Preparing for the Installation of RAC
2.2 Configuring the Kernel for Real Application Cluster Support3.1 Configure the Shared Disks and UNIX Preinstallation Tasks4. Administering Real Application Cluster Instances3.1.1 UNIX Preinstallation Steps3.2 Using the Oracle Universal Installer for Real Application Clusters
3.1.2 Configure the shared disks
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
5. References
Please check the RAC/Linux certification matrix for information on currently supported hardware/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
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 network1.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.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 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
The Real Application Clusters installation process includes four major 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.
A typical command would look like the following:# useradd -c "Oracle software owner" -G dba, oinstall -u 101 -m -d /export/home/oracle -s /bin/ksh oracle
or use a graphical interface like YaST2.
|
|
|
|
| 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=100Check these with:
$ 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
$ cat /proc/sys/kernel/semSet file handles and process limits
$ cat /proc/sys/kernel/shmmax
Establish system environment variables
|
|
|
| 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 |
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.
|
|
|
|
| SYSTEM tablespace |
|
/dev/oracle/db_name_raw_system_251m |
| USERS tablespace |
|
/dev/oracle/db_name_raw_users_26m |
| TEMP tablespace |
|
/dev/oracle/db_name_raw_temp_41m |
| UNDOTBS tablespace per instance |
|
/dev/oracle/db_name_raw_undotbsx_201m |
| INDX tablespace |
|
/dev/oracle/db_name_raw_indx_26m |
| TOOLS tablespace |
|
/dev/oracle/db_name_raw_tools_11m |
| First control file |
|
/dev/oracle/db_name_raw_controlfile1_110m |
| Second control file |
|
/dev/oracle/db_name_raw_controlfile2_110m |
| Two ONLINE redo log files per instance |
|
/dev/oracle/db_name_thread_lognumber_121m |
| spfile.ora |
|
/dev/oracle/db_name_raw_spfile_5m |
| srvmconfig |
|
/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:
- Automatic Undo Management requires an undo tablespace per instance therefore you would require a minimum of 2 tablespaces as described above. By following the naming convention described in the table above, the logical volumes are identified with the database and the volume type (the data contained in the raw volume). Volume size is also identified using this method.
- In the sample names listed in the table, the string db_name should be replaced with the actual database name, thread is the thread number of the instance, and lognumber is the log number within a thread.
- The name of the undo tablespace will be UNDOTBS for the first instance and UNDOTBS2 for the second.
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_251mAlso make sure to set the permissions and ownership as required on all nodes- Add this to your startup script:
/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
/bin/chmod 600 /dev/raw1You can verify the bindings with:
/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
$ raw -qaI 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.
/dev/raw1: bound to major 3, minor 7
/dev/raw2: bound to major 3, minor 8
...
$ mkdir /oracle/oradataOn the node from which you run the Oracle Universal Installer, create an ASCII file identifying the raw volume objects as shown above. The
$ 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
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_251mYou must specify that Oracle should use this file to determine the raw device volume names by setting the following environment variable where filename
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
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:
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:-
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.
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.
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.