Showing posts with label RAC. Show all posts
Showing posts with label RAC. Show all posts

Wednesday, April 18, 2012

How to recreate oraInventory (Central Inventory) in Real Application Clusters.

1-Locate the central inventory
cat /etc/oraInst.loc or /var/opt/oracle/oraInst.loc (Platform specific)

2-Take a back up of central inventory or rename in all the nodes.
mv oraInventory oraInventory.orig

3-cd $ORACLE_HOME/oui/bin

4-Execute runInstaller with attachHome option for OraCrsHome.

./runInstaller -silent -ignoreSysPrereqs -attachHome ORACLE_HOME="<10g Ora_Crs_Home Path>" ORACLE_HOME_NAME="<Name of oracleCRSHome>" LOCAL_NODE='node1' CLUSTER_NODES=node1,node2 CRS=true
for ex:
./runInstaller -silent -ignoreSysPrereqs -attachHome ORACLE_HOME="/u01/app/oracle/product/10.2.0/crs_1" ORACLE_HOME_NAME="OraCrs10g_home" LOCAL_NODE='rac1' CLUSTER_NODES=rac1,rac2 CRS=true

5-Execute runInstaller with attachHome option for OraDbHome
./runInstaller -silent -ignoreSysPrereqs -attachHome ORACLE_HOME="<10g Oracle_Home Path>" ORACLE_HOME_NAME="<Name of oracleHome>" LOCAL_NODE='node1' CLUSTER_NODES=node1,node2
for ex:
./runInstaller -silent -ignoreSysPrereqs -attachHome ORACLE_HOME="/u01/app/oracle/product/10.2.0/db_1" ORACLE_HOME_NAME="OraDb10g_home1" LOCAL_NODE='rac1' CLUSTER_NODES=rac1,rac2

6-Verify the inventory creation in all the nodes.

7-Verify and compare XML files size inside oraInventory/ContentsXML across all the nodes.

Caution:
a-Donot try attachHome in all the nodes, which may corrupt the inventory and it results in OUI-10197:Unable to create a new Oracle Home at /u01/app/oracle/product/10.2.0/crs_1. Oracle Home already exists at this location. Select another location. Attaching Home in one node will be propagated to other nodes.
b-Make sure you are having backup of the original inventory in any case without fail.

Saturday, March 17, 2012

ORA-29701: unable to connect to Cluster Manager


Needs an ASM Bounce for this Issue as resolution with a small change as below
[asm@dev123~]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.1.0.7.0 - Production on Thu Jan 6 01:23:24 2011
Copyright (c) 1982, 2008, Oracle.  All rights reserved.
Connected to an idle instance.

SQL> startup
ORA-29701: unable to connect to Cluster Manager

SQL> exit

Resolution:
As root User,
[user1@dev123~]$ sudo su -

[root@dev123 ~]# cd /u06/app/oracle/product/11.1.0/asm/bin ßASM Home

[root@dev123 bin]# ./localconfig delete
Stopping Cluster Synchronization Services.
Unable to communicate with the Cluster Synchronization Services daemon.
Shutdown has begun. The daemons should exit soon.
Cleaning up Network socket directories

[root@ddev123 bin]#

[root@dev123 bin]# ./localconfig add
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Configuration for local CSS has been initialized
Cleaning up Network socket directories
Setting up Network socket directories
Adding to inittab
Startup will be queued to init within 30 seconds.
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
Cluster Synchronization Services is active on these nodes.
        dev123
Cluster Synchronization Services is active on all the nodes.
Oracle CSS service is installed and running under init(1M)
[root@dev123 bin]#
[root@dev123 bin]# ps -ef|grep css
root     16699     1  0 01:27 ?        00:00:00 /bin/sh /etc/init.d/init.cssd run
root     16974 16699  0 01:27 ?        00:00:00 /bin/sh /etc/init.d/init.cssd daemon
asm      17164 16974  0 01:27 ?        00:00:00 /u06/app/oracle/product/11.1.0/asm/bin/ocssd.bin
root     17170 16699  0 01:27 ?        00:00:00 /bin/sh /etc/init.d/init.cssd diskmon
root     17475 15609  0 01:27 pts/5    00:00:00 grep css
[root@dev123 bin]#exit

As asm User,


[user1@dev123 ~]$ sudo su - asm
[asm@dev123~]$ sqlplus "/ as sysdba"
SQL*Plus: Release 11.1.0.7.0 - Production on Thu Jan 6 01:28:31 2011
Copyright (c) 1982, 2008, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup
ASM instance started
Total System Global Area  175382528 bytes
Fixed Size                  2157904 bytes
Variable Size             148058800 bytes
ASM Cache                  25165824 bytes
ASM diskgroups mounted
SQL> exit

Sunday, June 5, 2011

Relink ASM, Agent, OMS Home

. oraenv [+ASM]
cdo
# Note: cdo is a shell alias defined as: alias cdo='cd $ORACLE_HOME'

relink oracle
relink client_sharedlib
relink client
relink utilities
relink ldap
#relink oemagent - no target
relink network
relink ctx
relink interMedia

DBA Paranoia: To be doubly sure, run make files as listed in $ORACLE_HOME/inventory/make/makeorder.xml
make -f rdbms/lib/ins_rdbms.mk ioracle
make -f rdbms/lib/ins_rdbms.mk client_sharedlib
make -f sqlplus/lib/ins_sqlplus.mk install
make -f network/lib/ins_net_client.mk preinstall
make -f network/lib/ins_net_client.mk itnsping
make -f rdbms/lib/ins_rdbms.mk "irman"
make -f plsql/lib/ins_plsql.mk "install"
make -f network/lib/ins_net_client.mk "nnfgt.o"
make -f network/lib/ins_net_client.mk "mkldflags"
make -f rdbms/lib/ins_rdbms.mk "utilities"
make -f ldap/lib/ins_ldap.mk "clientonlyinstall"
make -f network/lib/ins_net_client.mk "ntcontab.o"
make -f network/lib/ins_net_client.mk  "nnfgt.o"
make -f network/lib/ins_net_client.mk  "install"  
make -f network/lib/ins_nau.mk "ioklist"
make -f network/lib/ins_nau.mk  "iokinit"
make -f network/lib/ins_nau.mk "iokdstry"
make -f sysman/lib/ins_emagent.mk "agent"
make -f sysman/lib/ins_emagent.mk "nmb"
make -f sysman/lib/ins_emagent.mk  "nmo"
make -f sysman/lib/ins_emagent.mk "nmhs"
make -f sysman/lib/ins_emagent.mk "tclexec"
make -f rdbms/lib/ins_rdbms.mk "all_no_orcl"
make -f srvm/lib/ins_srvm.mk "install"
make -f racg/lib/ins_has.mk  "racg_install"
make -f network/lib/ins_net_server.mk "install"
make -f rdbms/lib/ins_rdbms.mk "ctx_on"
make -f ctx/lib/ins_ctx.mk "install"
make -f rdbms/lib/ins_rdbms.mk  "ipc_g"
make -f sysman/lib/ins_emagent.mk "emsubagent"
make -f network/lib/ins_net_client.mk "mkldflags"
make -f rdbms/lib/ins_rdbms.mk "idg4odbc"
make -f precomp/lib/ins_precomp.mk "links"
make -f precomp/lib/ins_precomp.mk "relink"
make -f precomp/lib/ins_precomp.mk  "gen_pcscfg"
make -f rdbms/lib/ins_rdbms.mk "svr_tool"
make -f rdbms/lib/ins_rdbms.mk "patchset_opt"

Execute the $ORACLE_HOME/root.sh script to reset the appropriate file permissions/flags:
sudo $ORACLE_HOME/root.sh

Startup Oracle listener
Start up ASM instance

Relink agent home


# agentenv is a custom script that sets Oracle environment variables appropriately 
# for the agent home - all homes are using the one OS user - 'oracle'. 
# Normally I recommend one OS user per home.

. agentenv
relink client
relink oemagent

DBA Paranoia: To be doubly sure, run make files as listed in $ORACLE_HOME/inventory/make/makeorder.xml
cdo
make -f network/lib/ins_net_client.mk itnsping
make -f network/lib/ins_net_client.mk nnfgt.o
make -f network/lib/ins_net_client.mk mkldflags
make -f network/lib/ins_net_client.mk client_sharedlib
make -f sysman/lib/ins_emagent.mk agent
make -f sysman/lib/ins_emagent.mk nmb
make -f sysman/lib/ins_emagent.mk nmo
make -f sysman/lib/ins_emagent.mk nmhs
make -f sysman/lib/ins_emagent.mk emsubagent

Execute the $ORACLE_HOME/root.sh script to reset the appropriate file permissions/flags:
sudo $ORACLE_HOME/root.sh

Relink OMS HOme


Note omsenv is a custom script setting shell vriables for the OEM/OMS home.
. omsenv
cdo

relink client
relink network
relink client_sharedlib
relink oemagent
relink utilities

DBA Paranoia: To be doubly sure, run make files as listed in $ORACLE_HOME/inventory/make/makeorder.xml
make -f network/lib/ins_net_client.mk "nnfgt.o"
make -f network/lib/ins_net_client.mk "mkldflags"
make -f network/lib/ins_net_client.mk "client_sharedlib"
make -f sysman/lib/ins_sysman.mk agent
make -f sysman/lib/ins_sysman.mk nmo
make -f sysman/lib/ins_sysman.mk nmb
make -f sqlplus/lib/ins_sqlplus.mk install
make -f network/lib/ins_net_client.mk install
make -f network/lib/network/lib/ins_nau.mk ioklist
make -f network/lib/network/lib/ins_nau.mk iokinit
make -f network/lib/network/lib/ins_nau.mk iokdstry
make -f webcache/lib/ins_calypso.mk install

Execute the $ORACLE_HOME/root.sh script to reset the appropriate file permissions/flags:
sudo $ORACLE_HOME/root.sh

Saturday, January 22, 2011

Administration - RAC 10gR2

Start, stop and check CRS (Cluster Ready Services)
Note. Start/stop need to be run as root from the CRS home.

Start CRS

crsctl start crs

Stop CRScrsctl stop crs


Check CRS's statuscrsctl check crs

See the status of the various servicescrs_stat -t
Start/stop nodeapps

srvctl start nodeapps  -n <node name>
srvctl stop nodeapps  -n <node name>
 
Start/stop asm
srvctl start asm -n <node name>
srvctl stop asm -n <node name>
 
Start/stop a database (all nodes)
srvctl start database -d <database name>
 
srvctl stop database -d <database name>
 
 
Start/stop an individual instance
srvctl start instance -d <database name> -i <instance name>
 
srvctl stop instance -d <database name> -i <instance name>
 
 
 
Check the VIP config
srvctl config nodeapps -n <node> -a -g -s -l
 
 
Change the VIP address, subnetmask or interface
srvctl stop nodeapps -n <node1>
srvctl stop nodeapps -n <node2>
srvctl modify nodeapps -n <node1> -A <ip_address>/<net mask>/<interface>
srvctl modify nodeapps -n <node2> -A <ip_address>/<net mask>/<interface>
srvctl start nodeapps -n <node1>
srvctl start nodeapps -n <node2>
 
 
Locate the voting disk
crsctl query css votedisk
 
 
Retrive OCR (Oracle Cluster Registry) information
ocrcheck
 
 
To prevent a database starting at boot time
srvctl disable database -d <database name>
 
Change the private interconnect subnet
First find the interface which is in use as the interconnect - run as root from the crs home:
oifcfg getif
 
Make a note of the interface name (eth1 in the following example), then
run the following:
oifcfg delif -global eth1
oifcfg setif -global eth1/<your new subnet>:cluster_interconnect

Sunday, September 12, 2010

Oracle Real Application Cluster 10g

Introduction

Oracle Real Application Cluster (RAC) is a revolution in the database management system. It is an extension of Oracle single instance database. RAC is basically a cluster of instances working on the same database. As you know instance is nothing but the computer memory and some background processes, so in case of RAC we have multiple such instances which are installed and configured on different nodes and we have a single database (datafiles) which are accessed by these instances. This post explains the technical details about the RAC architecture and also I will discuss about the installation of RAC.

What is Oracle Real Application Cluster 10g?
Software Architecture
A RAC is a clustered database. A cluster is a group of independent servers that cooperate as a single system. In the event of system failure clustering ensure high availablity to the user. Access to mission critical data is not lost. Redundant hardware components, such as additional nodes, interconnects and disks, allow the cluster to provide high availability. Such redundant hardware architecture avoids a single point of failure and ensures high availability for the system.


Above figure shows the architecture for RAC. In RAC each instance runs on a seperate server which can access database made of multiple disks. For RAC to act as a sngle database, each seperate instance in a RAC should be a part of cluster. For the external users all the instance (nodes) which are part of cluster will look as single instance.
For each instance to be a part of cluster, we need to have some cluster software installed and all the instance should register in the cluster software. From Oracle Database 10g onwards, Oracle provides its own clusterware, A software to be installed on the nodes which are the part of cluster. Advantage with Oracle clusterware is that customer doesn’t have to purchase any third party clusterware. Also the clusterware provided by Oracle is integrated with OUI for easy installation. When a node in a Oracle cluster is started, all instances, listener and services are stared automatically. If an instance fail, the clusterware will automatically restart the instance so the services is often restored before the administrator notices it was down.
Network Architecture
Each RAC node should have at least one static IP address for the public network (Used by application) and one static IP address for the private cluster interconnect. Also we can have 1 virtual IP address(VIP) for each node.
The private networks are critical components of a RAC cluster. The private networks should only be used by Oracle to carry Cluster Manager and Cache Fusion (Explained Later) inter-node connection. A RAC database does not require a separate private network, but using a public network can degrade database performance (high latency, low bandwidth). Therefore the private network should have high-speed NICs (preferably one gigabit or more) and it should only be used by Oracle.
Virtual IPs are required for fail over. This is called TAF (Transparent Application Failover). Processes external to the Oracle 10g RAC cluster control the Transparent Application Failover (TAF). This means that the failover types and methods can be unique for each Oracle Net client. For failover to happen client connections are made using VIPs.
Hardware Architecture
Both Oracle Clusterware and Oracle RAC require access to disks that are shared by each node in the cluster. The shared disks must be configured using OCFS (1 or 2), raw devices or third party cluster file system such as GPFS or Veritas.
OCFS2 is a general-purpose cluster file system that can be used to store Oracle Clusterware files, Oracle RAC database files, Oracle software, or any other types of files normally stored on a standard filesystem such as ext3. This is a significant change from OCFS Release 1, which only supported Oracle Clusterware files and Oracle RAC database files. Note that ASM cannot be used to store the Oracle clusterware files, since clusterware is installed before installaing ASM and also clusterware have to be started before starting ASM.
OCFS2 is available free of charge from Oracle as a set of three RPMs: a kernel module, support tools, and a console. There are different kernel module RPMs for each supported Linux kernel.
Installing RAC 10g
Installing a RAC is a 5 step process as given below.
1) Complete Pre-Installation Task
Hardware Requirement
Software Requirement
Environment Configuration, Kernel parameter and so on.
2) Perform CRS installation
3) Perform Oracle Database 10g Installation
4) Perform Cluster Database creation
5) Complete post installation task
Pre-Installation Task
Check System Requirement
- Atleast 512MB of RAM
Run below command to check
# grep MemTotal /proc/meminfo
- Atleast 1G of swap space
Run below command to check
# grep SwapTotal /proc/meminfo
- /tmp directory should be 400M
Run below command to check
df -h /tmp
Check Software Requirement
- package Requirements
For installing RAC, the packages required for Red Hat 3.0 are:
gcc-3.2.3-2
compat-db-4.0.14.5
compat-gcc-7.3-2.96.122
compat-gcc-c++-7.3-2.96.122
compat-libstdc++-7.3-2.96.122
compat-libstdc++-devel-7.3-2.96.122
openmotif21-2.1.30-8
setarch-1.3-1
you can verify if these or higher version packages are present or not using following command
# rpm -q <package_name>
- Create Groups and Users
You can create unix user groups and user IDs using groupadd and useradd commands. We need 1 oracle user and 2 groups – “oinstall” being the primary and “dba” being secondary.
# groupadd -g 500 oinstall
# groupadd -g 501 dba
# useradd -u 500 -d /home/oracle -g “oinstall” -G “dba” -m -s /bin/bash oracle

Configure Kernel Paramters
- Make sure that following parameters are set in /etc/sysctl.conf
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 658576
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 1048536
net.core.wmem_default = 262144
net.core.wmem_max = 1048536

To load the new setting run /sbin/sysctl –p
These are the minimum required values, you can have higher values as well if your server configuration allows.
Setting the system environment
- Set the user Shell limits
cat >> /etc/security/limits.conf << EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF

cat >> /etc/pam.d/login << EOF
session required /lib/security/pam_limits.so
EOF

cat >> /etc/profile << EOF
if [ \$USER = "oracle" ]; then
if [ \$SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
EOF

cat >> /etc/csh.login << EOF
if ( \$USER == “oracle” ) then
limit maxproc 16384
limit descriptors 65536
umask 022
endif
EOF

- Configure the Hangcheck Timer
Hangcheck-timer module monitors the Linux kernal for extended operating system hangs that can affect the reliability of RAC node and cause database corruption. If a hang occurs, the module reboots the node.
You can check if the hangcheck-timer module is loaded by running lsmod command as root user.
/sbin/lsmode | grep -i hang
If the module is not running you can load it manually using below command.
modprobe hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
cat >> /etc/rc.d/rc.local << EOF
modprobe hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
EOF

- Configuring /etc/hosts
/etc/hosts contains the hostname and IP address of the server.
You will need 3 hostnames for each node in the cluster. One will be public hostname for primary interface. Second will be private hostname for cluster interconnect. Third will be virtual hostnames (VIP) for high availability.
For Node 1
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
140.87.222.169 ocvmrh2045.us.oracle.com ocvmrh2045 #node1 public
140.87.241.194 ocvmrh2045-nfs.us.oracle.com ocvmrh2045-nfs ocvmrh2045-a #node1 nfs
152.68.143.111 ocvmrh2045-priv.us.oracle.com ocvmrh2045-priv #node1 private
152.68.143.112 ocvmrh2053-priv.us.oracle.com ocvmrh2053-priv #node2 private
140.87.222.220 ocvmrh2051.us.oracle.com ocvmrh2051 # Node1 vip
140.87.222.225 ocvmrh2056.us.oracle.com ocvmrh2056 # Node2 vip

For Node 2
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
140.87.222.222 ocvmrh2053.us.oracle.com ocvmrh2053 # Node2 Public
140.87.241.234 ocvmrh2053-nfs.us.oracle.com ocvmrh2053-nfs ocvmrh2053-a # Node2 nfs
152.68.143.111 ocvmrh2045-priv.us.oracle.com ocvmrh2045-priv # Node1 Private
152.68.143.112 ocvmrh2053-priv.us.oracle.com ocvmrh2053-priv # Node2 Private
140.87.222.220 ocvmrh2051.us.oracle.com ocvmrh2051 # Node1 vip
140.87.222.225 ocvmrh2056.us.oracle.com ocvmrh2056 # Node2 vip

- Creating database Directories
You have to get the following directories created for you with a write permission for oracle user.
Oracle Base Directories
Oracle Inventory Directory
CRS Home Directory
Oracle Home Directory
In our case the directories are:
Oracle Base Directories – /u01/app/
Oracle Inventory Directory – /u01/app/oraInventory
CRS Home Directory – /u01/app/oracle/product/10.2.0/crs
Oracle Home Directory – /u01/app/oracle/product/10.2.0/db
Configure SSH for User Equivalence
The OUI detects whether the machine on which you are installing RAC is a part of cluster. If its a part of cluster then you have to select the other nodes which are the part of cluster and on which you want to install the patch. But when OUI tries to install the patch on other node while connecting from 1st node, it will ask for login credential and prompt for a password in between the installation, which we want to avoid. For this purpose we have to have user equivelence in place. User equivalence can be achieved by using SSH. First you have ot configure SSH.
Logon as the “oracle” UNIX user account
# su – oracle
If necessary, create the .ssh directory in the “oracle” user’s home directory and set the correct permissions on it:
$ mkdir -p ~/.ssh
$ chmod 700 ~/.ssh

Enter the following command to generate an RSA key pair (public and private key) for version 3 of the SSH protocol:
$ /usr/local/git/bin/ssh-keygen -t rsa
Enter the following command to generate a DSA key pair (public and private key) for version 3 of the SSH protocol:
$ /usr/local/git/bin/ssh-keygen -t dsa
Repeat the above steps for all Oracle RAC nodes in the cluster
Create authorized key file.
$ touch ~/.ssh/authorized_keys
$ cd ~/.ssh
bash-3.00$ ls -lrt *.pub
-rw-r–r– 1 oracle oinstall 399 Nov 20 11:51 id_rsa.pub
-rw-r–r– 1 oracle oinstall 607 Nov 20 11:51 id_dsa.pub

The listing above should show the id_rsa.pub and id_dsa.pub public keys created in the previous section
In this step, use SSH to copy the content of the ~/.ssh/id_rsa.pub and ~/.ssh/id_dsa.pub public key from all Oracle RAC nodes in the cluster to the authorized key file just created (~/.ssh/authorized_keys).
Here node 1 is ocvmrh2045 and node 2 is ocvmrh2053
ssh ocvmrh2045 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh ocvmrh2045 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
ssh ocvmrh2053 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh ocvmrh2053 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

Now that we have the entry for all the public keys on both the node in this file, we should copy the file to all the RAC nodes. We done have to do this on all nodes, just copying the file to other nodes will do.
scp ~/.ssh/authorized_keys ocvmrh2053:.ssh/authorized_keys
Set permissions to the authorized file
chmod 600 ~/.ssh/authorized_keys
Establish User Equivalence
Once SSH is configured we can go ahead with configuring user equivalence.
su – oracle
exec /usr/local/git/bin/ssh-agent $SHELL
$ /usr/local/git/bin/ssh-add

Identity added: /home/oracle/.ssh/id_rsa (/home/oracle/.ssh/id_rsa)
Identity added: /home/oracle/.ssh/id_dsa (/home/oracle/.ssh/id_dsa)

- Test Connectivity
Try the below command and it should not ask for the password. It might ask the password for the first time, but after that it should be able to execute the steps without asking for password.
ssh ocvmrh2045 “date;hostname”
ssh ocvmrh2053 “date;hostname”
ssh ocvmrh2045-priv “date;hostname”
ssh ocvmrh2053-priv “date;hostname”

Partitioning the disk
In order to use OCFS2, you need to first partition the unused disk. You can use “/sbin/sfdisk –s” as a root user to check the partitions. We will be creating a single partition to be used by OCFS2. As a root user, run the below command.
# fdisk /dev/sdc
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won’t be recoverable.
The number of cylinders for this disk is set to 1305.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0×0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1305, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1305, default 1305):
Using default value 1305
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
You can verify the new partition now as
# fdisk -l /dev/sdc
Disk /dev/sdc: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdc1 1 1305 10482381 83 Linux

When finished partitioning, run the ‘partprobe‘ command as root on each of the remaining cluster nodes in order to assure that the new partitions are configured.
Configure OCFS2
We will be using OCFS2 here in this installation. OCFS is a cluster file system solution provided by Oracle, which is specially meant for RAC instllation. Once configure the disk for OCFS we can use the same for clusterware files (like OCR – Oracle Cluster Registry file and Voting file), as well as we can use the same disk for database files.
# ocfs2console

Select Cluster -> Configure Nodes Click on Add on the next window, and enter the Name and IP Address of each node in the cluster.
Note: Use node name to be the same as returned by the ‘hostname’ command

Apply, and Close the window.
After exiting the ocfs2console, you will have a /etc/ocfs2/cluster.conf similar to the following on all nodes. This OCFS2 configuration file should be exactly the same on all of the nodes:
node:
ip_port = 7777
ip_address = 140.87.222.169
number = 0
name = ocvmrh2045
cluster = ocfs2

node:
ip_port = 7777
ip_address = 140.87.222.222
number = 1
name = ocvmrh2053
cluster = ocfs2

cluster:
node_count = 2
name = ocfs2

Configure O2CB to Start on Boot and Adjust O2CB Heartbeat Threshold
You now need to configure the on-boot properties of the O2CB driver so that the cluster stack services will start on each boot. You will also be adjusting the OCFS2 Heartbeat Threshold from its default setting of 7 to 601. All the tasks within this section will need to be performed on both nodes in the cluster as root user.
Set the on-boot properties as follows:
# /etc/init.d/o2cb offline ocfs2
# /etc/init.d/o2cb unload
# /etc/init.d/o2cb configure

Configuring the O2CB driver.
This will configure the on-boot properties of the O2CB driver.
The following questions will determine whether the driver is loaded on boot. The current values will be shown in brackets (‘[]‘). Hitting <ENTER> without typing an answer will keep that current value. Ctrl-C will abort.

Load O2CB driver on boot (y/n) [y]: y
Cluster to start on boot (Enter “none” to clear) [ocfs2]: ocfs2
Specify heartbeat dead threshold (>=7) [7]: 601
Writing O2CB configuration: OK
Loading module “configfs”: OK
Mounting configfs filesystem at /config: OK
Loading module “ocfs2_nodemanager”: OK
Loading module “ocfs2_dlm”: OK
Loading module “ocfs2_dlmfs”: OK
Mounting ocfs2_dlmfs filesystem at /dlm: OK
Starting O2CB cluster ocfs2: OK

We can now check again to make sure the settings took place in for the o2cb cluster stack:
Verify that ocfs2 and o2cb are started. Check this on both nodes. As root user:
# chkconfig –list |egrep “ocfs2|o2cb”
ocfs2 0:off 1:off 2:on 3:on 4:on 5:on 6:off
o2cb 0:off 1:off 2:on 3:on 4:on 5:on 6:off

If it doesn’t look like above on both nodes, turn them on by following command as root:
# chkconfig ocfs2 on
# chkconfig o2cb on

Create and format the OCFS2 filesystem on the unused disk partition
As root on each of the cluster nodes, create the mount point directory for the OCFS2 file system.
# mkdir /u03
Run the below command as a root user only on 1 node to create a OCFS2 file system on the unused disk /dev/sdc1, that you partitioned above.
# mkfs.ocfs2 -b 4K -C 32K -N 4 -L /u03 /dev/sdc1
mkfs.ocfs2 1.2.2
Filesystem label=/u03
Block size=4096 (bits=12)
Cluster size=32768 (bits=15)
Volume size=10733944832 (327574 clusters) (2620592 blocks)
11 cluster groups (tail covers 5014 clusters, rest cover 32256 clusters)
Journal size=67108864
Initial number of node slots: 4
Creating bitmaps: done
Initializing superblock: done
Writing system files: done
Writing superblock: done
Formatting Journals: done
Writing lost+found: done
mkfs.ocfs2 successful

The meaning of the above command is partition with a volume label of “/u03″ (-L /u03), a block size of 4K (-b 4K) and a cluster size of 32K (-C 32K) with 4 node slots (-N 4).
Once OCFS2 filesystem is configured on the disk, you can mount the same.
Mount OCFS2 filesystem on both nodes
Run the below command on all nodes to mount the disk having OCFS2 file system.
# mount -t ocfs2 -L /u03 -o datavolume /u03
You can verify if the disk is mounted correctly or not using below command
# df /u03

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sdc1 10482368 268736 10213632 3% /u03

Create the directories for shared files
As root user, run the following commands on node1 only. Since /u03 is on a shared disk, all the files added from one node will be visible on other nodes.
CRS files:
# mkdir /u03/oracrs
# chown oracle:oinstall /u03/oracrs
# chmod 775 /u03/oracrs

Database files:
# mkdir /u03/oradata
# chown oracle:oinstall /u03/oradata
# chmod 775 /u03/oradata

Installaing Oracle Clusterware
Before installing the Oracle RAC database, we need to install Oracle clusterware. Clusterware will create 2 important files. One is the OCR file (Oracle Cluster Registry) and other is Voting file. OCR file is used for registering the nodes involved in RAC installation and to store all the details about those nodes. Voting file is used to get the status of each node after a definite period of time. Each node will register its presence after a definite time into this voting file. This is called heart beat of RAC. If a node goes down, then it wont be able to register its presence in voting file and other instance will come to know. Other instance will then bring up the crashed instance.
Follow the below step to install clusterware.
From the setup directory run the ./runInstaller command
Below are the main screen and the inputs to be given.
Welcome page - Click Next

11.jpg
Specify Inventory Directory and Credentials – Enter the inventory location where it should create inventory
12.jpg
Specify Home Details - Specify the correct location of home. Provide the location for crs home. Note that this location may not be a shared location. This is the location for installing a crs software and not for OCR and voting file.
13.jpg
Product Specific Prerequisite Checks - OUI will perform the required pre-reqs checks. Once done, press Next.
14.jpg
Specify Cluster Configuration – On this screen you need to add all the servers that will be part of RAC installation. Basically this is a push install, where the installation will be pushed to all the nodes we are adding here. So that we “don’t’ have to install CRS again from node 2.
15.jpg
Specify Network Interface Usage – We need at least 1 network to be private and not to be used by application. So make 1 network as private network, so that we can use the same for interconnect.
16.jpg
Specify OCR Location – This is where you will provide the location for OCR file. Remember that this file should be shared and accessible to all the nodes. We know that we have a shared disk /u03. In the above step under “Create the directories for shared files”, we created a “/u03/oracrs” directory. This can be provided here.
17.jpg
Specify Voting Disk Location – On this screen you will provide the location for voting file. You need to provide the shared location here as well. You can provide the same shared location we created in above step.
18.jpg
Summary – Click on Install
You can verify the cluster installation by running olsnodes.
bash-3.00$ /u01/app/oracle/product/10.2.0/crs/bin/olsnodes
ocvmrh2045
ocvmrh2053

Create the RAC Database
You can follow the same steps that you follow for installing the single instance database, only couple of screens are new in this instllation as compared to single instance database installation.
111.jpg
4) Specify Hardware Cluster Installation Mode – Select cluster installation and click on select all to select all the nodes in the cluster. This will propogate the installation in all the nodes.
121.jpg
10) Specify Database Storage Options – In this case if you are not using ASM or Raw devices and using file system then specify the shared location we created above. This is important because all the instance should have access to the datafiles. We are creating multiple instances but we are having single database(database files).
At the end, it will give the summary and you click on install.
Congratulations! Your new Oracle 10g RAC Database is up and ready for use.
References
Oracle RAC Documentation – http://download.oracle.com/docs/html/B10766_08/toc.htm
Oracle Technical White Paper May 2005 by Barb Lundhild
Converting a single instance database to RAC – http://www.oracle.com/technology/pub/articles/chan_sing2rac_install.html#prelim

Step-By-Step Installation of 9.2.0.5 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) (Version 9.2.0.5), 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.
Disclaimer: If there are any errors or issues prior to step 2, please contact your Linux distributor.
The information contained here is as accurate as possible at the time of writing.


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
  • Requirements:
    • Refer to the RAC/Linux certification matrix for information on supported configurations.  Ensure that the system has at least the following resources:
      - 400 MB in /tmp
      - 512 MB of Physical Memory (RAM)
      - Three times the amount of Physical Memory for Swap space (unless the system exceeds 1 GB of Physical Memory, where two times the amount of Physical Memory for Swap space is sufficient)
An example system disk layout is as follows:-
A sample system disk layout
Slice Contents Allocation (in Mbytes)
0 / 2000 or more
1 /boot 64
2 /tmp 1000
3 /usr 3000-7000 depending on operating system and packages installed
4 /var 512 (can be more if required)
5 swap Three times the amount of Physical Memory for Swap space (unless the system exceeds 1 GB of Physical Memory, where two times the amount of Physical Memory for Swap space is sufficient).
6 /home 2000 (can be more if required)
1.1.2 Software
  • For RAC on Linux support, consult the operating system vendor and see the RAC/Linux certification matrix.
  • Make sure you have make and rsh-server packages installed, check with: $rpm -q rsh-server make
    rsh-server-0.17-5
    make-3.79.1-8

    If these are not installed, use your favorite package manager to install them.
1.1.3 Patches
Consult with your operating system vendor to get on the latest patch version of the kernel.
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.
1.3 Configuring the Cluster Interconnect and Public Network Hardware
If not already installed, install host adapters in your cluster nodes. For the procedure on installing host adapters, see the documentation that shipped with your host adapters and node 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.
[oracle@opcbrh1 oracle]$ more /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. Make sure your public network is the primary (eth0).
Interprocess communication is an important issue for RAC since cache fusion transfers buffers between instances using this mechanism. Thus, networking parameters are important for RAC databases. The values in the following table are the recommended values. These are NOT the default on most distributions.
Parameter Meaning Value
/proc/sys/net/core/rmem_default The default setting in bytes of the socket receive buffer 262144
/proc/sys/net/core/rmem_max The maximum socket receive buffer size in bytes 262144
/proc/sys/net/core/wmem_default The default setting in bytes of the socket send buffer 262144
/proc/sys/net/core/wmem_max The maximum socket  send  buffer  size  in bytes 262144

You can see these settings with:

$ cat /proc/sys/net/core/rmem_default
Change them with:
$ echo  262144 >  /proc/sys/net/core/rmem_default
This will need to be done each time the system boots. Some distributions already have setup a method for this during boot. On Red Hat , this can be configured in /etc/sysctl.conf (like : net.core.rmem_default = 262144).




2. Creating a Cluster
On Linux, the cluster software required to run Real Application Clusters is included in the Oracle distribution.
The Oracle Cluster Manager (ORACM) installation process includes eight major tasks.
  1. UNIX pre-installation tasks.
  2. Configuring the shared disks
  3. Run the Oracle Universal Installer to install the 9.2.0.4 ORACM (Oracle Cluster Manager)
  4. Configure the hangcheck-timer.
  5. Install version 10.1.0.2 of the Oracle Universal Installer
  6. Run the 10.1.0.2 Oracle Universal Installer to patch the Oracle Cluster Manager (ORACM) to 9.2.0.5
  7. Modify the ORACM configuration files to utilize the hangcheck-timer.
  8. Start the ORACM (Oracle Cluster Manager)
2.1 UNIX Pre-installation tasks
These steps need to be performed on ALL nodes.
  • First, on each node, create the Oracle group.  Example:
# groupadd dba -g 501
  • Next, make the Oracle user’s home directory.  Example:
# mkdir -p /u01/home/oracle
  • On each node, create the Oracle user.  Make sure that the Oracle user is part of the dba group.  Example:
# useradd -c “Oracle Software Owner” -G dba -u 101 -m -d /u01/home/oracle -s /bin/csh oracle
  • On each node, Create a mount point for the Oracle software installation (at least 2.5 GB, typically /u01).  The oracle user should own this mount point and all of the directories below the mount point.  Example:
# mkdir /u01
# chown -R oracle.dba /u01
# chmod -R ug=rwx,o=rx /u01

  • Once this is done, test the permissions on each node to ensure that the oracle user can write to the new mount points.  Example:
# su – oracle
$ touch /u01/test
$ ls -l /u01/test
-rw-rw-r– 1 oracle dba 0 Aug 15 09:36 /u01/test

  • Depending on your Linux distribution, make sure inetd or xinetd is started on all nodes and that the ftp, telnet, shell and login (or rsh) services are enabled (see /etc/inetd.conf or /etc/xinetd.conf and /etc/xinetd.d).   Example:
# more /etc/xinetd.d/telnet
# default: on
# description: The telnet server serves telnet sessions; it uses \
# unencrypted username/password pairs for authentication.
service telnet
{
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
disable = no
}

In this example, disable should be set to ‘no’.
  • On the node from which you will run the Oracle Universal Installer, set up user equivalence by adding entries for all nodes in the cluster, including the local node, to the .rhosts file of the oracle account, or the /etc/hosts.equiv file.
Sample entries in /etc/hosts.equiv file:
rac1
rac2
int-rac1
int-rac2

  • As oracle user, check for user equivalence for the oracle account by performing a remote copy (rcp) to each node (public and private) in the cluster.  Example:
RAC1:
$ touch /u01/test
$ rcp /u01/test rac2:/u01/test1
$ rcp /u01/test int-rac2:/u01/test2

RAC2:
$ touch /u01/test
$ rcp /u01/test rac1:/u01/test1
$ rcp /u01/test int-rac1:/u01/test2
$ ls /u01/test*
/u01/test /u01/test1 /u01/test2

RAC1:
$ ls /u01/test*
/u01/test /u01/test1 /u01/test2

Note: If you are prompted for a password, you have not given the oracle account the same attributes on all nodes. You must correct this because the Oracle Universal Installer cannot use the rcp command to copy Oracle products to the remote node’s directories without user equivalence.
System Kernel Parameters
Verify operating system kernel parameters are set to appropriate levels:
Kernel Parameter Setting Purpose
SHMMAX 2147483648 Maximum allowable size of one shared memory segment.
SHMMIN 1 Minimum allowable size of a single shared memory segment.
SHMMNI 100 Maximum number of shared memory segments in the entire system.
SHMSEG 10 Maximum number of shared memory segments one process can attach.
SEMMNI 100 Maximum number of semaphore sets in the entire system.
SEMMSL 250 Minimum recommended value. SEMMSL should be 10 plus the largest PROCESSES parameter of any Oracle database on the system.
SEMMNS 1000 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.
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=1000
$ 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

You might want to increase the maximum number of file handles, include this in your startup script or use /etc/sysctl.conf :
$ echo 65536 > /proc/sys/fs/file-max
To allow your oracle processes to use these file handles, add the following to your oracle account login script (ex.: .profile)
$ ulimit -n 65536
Note: This will only allow you to set the soft limit as high as the hard limit. You might have to increase the hard limit on system level. This can be done by adding ulimit -Hn 65536 to /etc/initscript. You will have to reboot the system to make this active.  Sample /etc/initscript: ulimit -Hn 65536
eval exec “$4″
Establish Oracle environment variables: Set the following Oracle environment variables:
Environment Variable Suggested value
ORACLE_HOME eg /u01/app/oracle/product/920
ORACLE_TERM xterm
PATH /u01/app/oracle/product/9.2.0/bin: /usr/ccs/bin:/usr/bin/X11/:/usr/local/bin and any other items you require in your PATH
DISPLAY <ip-address>:0.0 (review Note:153960.1 for detailed information)
TMPDIR Set a temporary directory path for TMPDIR with at least 100 Mb of free space to which the OUI has write permission.
ORACLE_SID Set this to what you will call your database instance. This should be UNIQUE on each node.
It is best to save these in a .login or .profile file so that you do not have to set the environment every time you log in.
  • Create the directory /var/opt/oracle and set ownership to the oracle user.  Example:
$ mkdir /var/opt/oracle
$ chown oracle.dba /var/opt/oracle

  • Set the oracle user’s umask to “022″ in you “.profile” or “.login” file. Example:
$ umask 022
Note: There is a verification script InstallPrep.sh available which may be downloaded and run prior to the installation of Oracle Real Application Clusters. This script verifies that the system is configured correctly according to the Installation Guide. The output of the script will report any further tasks that need to be performed before successfully installing Oracle 9.x DataServer (RDBMS). This script performs the following verifications:-
  • ORACLE_HOME Directory Verification
  • UNIX User/umask Verification
  • UNIX Group Verification
  • Memory/Swap Verification
  • TMP Space Verification
  • Real Application Cluster Option Verification
  • Unix Kernel Verification
. ./InstallPrep.sh
You are currently logged on as oracle
Is oracle the unix user that will be installing Oracle Software? y or n
y
Enter the unix group that will be used during the installation
Default: dba
Enter the version of Oracle RDBMS you will be installing
Enter either : 901 OR 920 – Default: 920
920
The rdbms version being installed is 920
Enter Location where you will be installing Oracle
Default: /u01/app/oracle/product/oracle9i
/u01/app/oracle/product/9.2.0
Your Operating System is Linux
Gathering information… Please wait
JDK check is ignored for Linux since it is provided by Oracle
Checking unix user …
Checking unix umask …
umask test passed
Checking unix group …
Unix Group test passed
Checking Memory & Swap…
Memory test passed
/tmp test passed
Checking for a cluster…
Linux Cluster test section has not been implemented yet
No cluster warnings detected
Processing kernel parameters… Please wait
Running Kernel Parameter Report…
Check the report for Kernel parameter verification\n
Completed.
/tmp/Oracle_InstallPrep_Report has been generated
Please review this report and resolve all issues before attempting to
install the Oracle Database Software
Note: If you get an error like this:
InstallPrep.sh: line 45: syntax error near unexpected token `fi’
or
./InstallPrep.sh: Command not found.
Then you need to copy the script into a text file (it will not run if the file is in binary format).
2.2 Configuring the Shared Disks
For 9.2 Real Application Clusters on Linux, you can use either OCFS (Oracle Cluster Filesystem), RAW, or NFS (Redhat and Network Appliance Only) for storage of Oracle database files.
  • For more information on setting up OCFS for RAC on Linux, see the following MetaLink Note:
Note 220178.1 – Installing and setting up ocfs on Linux – Basic Guide
  • For more information on setting up RAW for RAC on Linux, see the following MetaLink Note:
Note 246205.1 – Configuring Raw Devices for Real Application Clusters on Linux
  • For more information on setting up NFS for RAC on Linux, see the following MetaLink Note (Steps 1-6):
Note 210889.1 – RAC Installation with a NetApp Filer in Red Hat Linux Environment

2.3 Run the Oracle Universal Installer to install the 9.2.0.4 ORACM (Oracle Cluster Manager)

These steps only need to be performed on the node that you are installing from (typically Node 1).
  • If you are using OCFS or NFS for your shared storage, pre-create the quorum file and srvm file. Example:
#  dd if=/dev/zero of=/ocfs/quorum.dbf bs=1M count=20
#  dd if=/dev/zero of=/ocfs/srvm.dbf bs=1M count=100
#  chown root:dba /ocfs/quorum.dbf
#  chmod 664 /ocfs/quorum.dbf
#  chown oracle:dba  /ocfs/srvm.dbf
#  chmod 664 /ocfs/srvm.dbf

  • Verify the Environment – Log off and log on as the oracle user to ensure all environment variables
    are set correctly. Use the following command to view them:
    % env | more
Note: If you are on Redhat Advanced Server 3.0, you will need to temporarily use an older gcc for the install: mv gcc gcc3.2.3
mv g++ g++3.2.3
ln -s /usr/bin/gcc296 /usr/bin/gcc
ln -s /usr/bin/g++296 /usr/bin/g++


You will also need to apply patch 3006854 if on RHAS 3.0
  • Before attempting to run the Oracle Universal Installer, verify that you can successfully run the following command: % /usr/bin/X11/xclock
  • If this does not display a clock on your display screen, please review the following article:
Note 153960.1 FAQ: X Server testing and troubleshooting
  • Start the Oracle Universal Installer and install the RDBMS software – Follow these procedures to use the Oracle Universal Installer to install the Oracle Cluster Manager 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. Use the following commands to start the installer:
    % cd /tmp
    % /cdrom/runInstaller

    Or cd to /stage/Disk1 and run ./runInstaller
    Respond to the installer prompts as shown below:
  • At the “Welcome Screen”, click Next.
If this is your first install on this machine:
  • If the “Inventory Location” screen appears, enter the inventory location then click OK.
  • If the “Unix Group Name” screen appears, enter the unix group name created in step 2.1 then click Next.
  • At this point you may be prompted to run /tmp/orainstRoot.sh.  Run this and click Continue.
  • At the “File Locations Screen”, verify the destination listed is your ORACLE_HOME directory.  Also enter a NAME to identify this ORACLE_HOME.  The NAME can be anything.
  • At the “Available Products Screen”, Check “Oracle Cluster Manager”. Click Next.
  • At the public node information screen, enter the public node names and click Next.
  • At the private node information screen, enter the interconnect node names. Click Next.
  • Enter the full name of the file or raw device you have created for the ORACM Quorum disk information. Click Next.
  • Press Install at the summary screen.
  • You will now briefly get a progress window followed by the end of installation screen. Click Exit and confirm by clicking Yes.
Note: Create the directory $ORACLE_HOME/oracm/log (as oracle) on the other nodes if it doesn’t exist.
2.4 Configure the hangcheck-timer
These steps need to be performed on ALL nodes.
Some kernel versions include the hangcheck-timer with the kernel.  You can check to see if your kernel contains the hangcheck-timer by running:
# /sbin/lsmod
Then you will see hangcheck-timer listed.  Also verify that hangcheck-timer is starting in your /etc/rc.local file (on Redhat) or /etc/init.d/boot.local (on United Linux).  If you see hangcheck-timer listed in lsmod and in the rc.local file or boot.local, you can skip to section 2.5.
If hangcheck-timer is not listed here and you are not using Redhat Advanced Server, see the following note for information on obtaining the hangcheck-timer:
Note 232355.1 – Hangcheck Timer FAQ
If you are on Redhat Advanced Server, you can either apply the latest errata version (> 12) or go to MetaLink – Patches:
Enter 2594820 in the Patch Number field.
Click Go.
Click Download.
Save the file p2594820_20_LINUX.zip to the local disk, such as /tmp.
Unzip the file. The output should be similar to the following:
inflating: hangcheck-timer-2.4.9-e.3-0.4.0-1.i686.rpm
inflating: hangcheck-timer-2.4.9-e.3-enterprise-0.4.0-1.i686.rpm
inflating: hangcheck-timer-2.4.9-e.3-smp-0.4.0-1.i686.rpm
inflating: README.TXT
Run the uname -a command to identify the RPM that corresponds to the kernel in use. This will show if the kernel is single CPU, smp, or enterprise.
The p2594820_20_LINUX.zip file contains four files. The following describes the files:
hangcheck-timer-2.4.9-e.3-0.4.0-1.i686.rpm is for single CPU machines
hangcheck-timer-2.4.9-e.3-enterprise=0.4.0-1.i686.rpm is for multi-processor machines with more than 4 GB of RAM
hangcheck-timer-2.4.9-e.3-smp-0.4.0-1.i686.rpm is for multi-processor machines with 4 GB of RAM or less
The three RPMs will work for the e3 kernels in Red Hat Advanced Server 2.1 gold and the e8 kernels in the latest Red Hat Advanced Server 2.1 errata release. These RPMs are for Red Hat Advanced Server 2.1 kernels only.
Transfer the relevant hangcheck-timer RPM to the /tmp directory of the Oracle Real Applications Cluster node.
Log in to the node as the root user.
Change to the /tmp directory.
Run the following command to install the module:
#rpm -ivh hangcheck-timer RPM name
If you have previously installed RAC on this cluster, remove or disable the mechanism that loads the softdog module at system start up, if that module is not used by other software on the node. This is necessary for subsequent steps in the installation process. This step may require log in as the root user.  One method for setting up previous versions of Oracle Real Applications Clusters involved loading the softdog module in the /etc/rc.local (on Redhat) or /etc/init.d/boot.local (on United Linux) file. If this method was used, then remove or comment out the following line in the file: /sbin/insmod softdog nowayout=0 soft_noboot=1 soft_margin=60
Append the following line to the /etc/rc.local file (on Redhat) or /etc/init.d/boot.local (on United Linux):
/sbin/insmod hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
Load the hangcheck-timer kernel module using the following command as root user:
# /sbin/insmod hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
Repeat the above steps on all Oracle Real Applications Clusters nodes where the kernel module needs to be installed.
Run dmesg after the module is loaded. Note the build number while running the command. The following is the relevant information output:
build 334adfa62c1a153a41bd68a787fbe0e9
The build number is required when making support calls.
2.5 Install Version 10.1.0.2 of the Oracle Universal Installer
These steps need to be performed on ALL nodes.
Download the 9.2.0.5 patchset from MetaLink – Patches:
Enter 3501955 in the Patch Number field.
Click Go.
Click Download.
  • Place the file in a patchset directory on the node you are installing from.  Example:
$ mkdir $ORACLE_HOME/9205
$ cp  p3501955_9205_LINUX.zip $ORACLE_HOME/9205

  • Unzip the file:
$ cd $ORACLE_HOME/9205
$ unzip p3501955_9205_LINUX.zip
Archive: p3501955_9205_LINUX
inflating: 9205_lnx32_release.cpio
inflating: README.html
inflating: ReleaseNote9205.pdf

  • Run CPIO against the file:
$ cpio -idmv < 9205_lnx32_release.cpio
Run the installer from the 9.2.0.5 staging location:
$ cd $ORACLE_HOME/9205/Disk1
$ ./runInstaller

Respond to the installer prompts as shown below:
  • At the “Welcome Screen”, click Next.
  • At the “File Locations Screen”, Change the $ORACLE_HOME name from the dropdown list to the 9.2 $ORACLE_HOME name.  ClickNext.
  • On the “Available Products Screen”, Check “Oracle Universal Installer 10.1.0.2. Click Next.
  • Press Install at the summary screen.
  • You will now briefly get a progress window followed by the end of installation screen. Click Exit and confirm by clicking Yes.
Remember to install the 10.1.0.2 Installer on ALL cluster nodes.  Note that you may need to ADD the 9.2 $ORACLE_HOME name on the “File Locations Screen” for other nodes.  It will ask if you want to specify a non-empty directory, say “Yes”.
2.6 Run the 10.1.0.2 Oracle Universal Installer to patch the Oracle Cluster Manager (ORACM) to 9.2.0.5
These steps only need to be performed on the node that you are installing from (typically Node 1).
The 10.1.0.2 OUI will use SSH (Secure Shell) if it is configured.  If it is not configured it will use RSH (Remote Shell).  If you have SSH configured on your cluster, test and make sure that you can SSH and SCP to all nodes of the cluster without being prompted.  If you do not have SSH configured, skip this step and run the installer from $ORACLE_BASE/oui/bin as noted below.
SSH Test:
As oracle user, check for user equivalence for the oracle account by performing a secure copy (scp) to each node (public and private) in the cluster.  Example:
RAC1:
$ touch /u01/sshtest
$ scp /u01/sshtest rac2:/u01/sshtest1
$ scp /u01/sshtest int-rac2:/u01/sshtest2

RAC2:
$ touch /u01/sshtest
$ scp /u01/sshtest rac1:/u01/sshtest1
$ scp /u01/sshtest int-rac1:/u01/sshtest2
$ ls /u01/sshtest*
/u01/sshtest /u01/sshtest1 /u01/sshtest2

RAC1:
$ ls /u01/sshtest*
/u01/sshtest /u01/sshtest1 /u01/sshtest2

Run the installer from the 9.2.0.5 oracm staging location:
$ cd $ORACLE_HOME/9205/Disk1/oracm
$ ./runInstaller

Respond to the installer prompts as shown below:
  • At the “Welcome Screen”, click Next.
  • At the “File Locations Screen”, make sure the source location is to the products.xml file in the 9.2.0.5 patchset location under Disk1/stage.  Also verify the destination listed is your ORACLE_HOME directory.  Change the $ORACLE_HOME name from the dropdown list to the 9.2 $ORACLE_HOME name.  Click Next.
  • At the “Available Products Screen”, Check “Oracle9iR2 Cluster Manager 9.2.0.5.0″. Click Next.
  • At the public node information screen, enter the public node names and click Next.
  • At the private node information screen, enter the interconnect node names. Click Next.
  • Click Install at the summary screen.
  • You will now briefly get a progress window followed by the end of installation screen. Click Exit and confirm by clicking Yes.
2.7 Modify the ORACM configuration files to utilize the hangcheck-timer.
These steps need to be performed on ALL nodes.
Modify the $ORACLE_HOME/oracm/admin/cmcfg.ora file:
Add the following line:
KernelModuleName=hangcheck-timer
Adjust the value of the MissCount line based on the sum of the hangcheck_tick and hangcheck_margin values. (> 210)
MissCount=210
Make sure that you can ping each of the names listed in the private and public node name sections from each node.  Example:
$ ping rac2
PING opcbrh2.us.oracle.com (138.1.137.46) from 138.1.137.45 : 56(84) bytes of data.
64 bytes from opcbrh2.us.oracle.com (138.1.137.46): icmp_seq=0 ttl=255 time=1.295 msec
64 bytes from opcbrh2.us.oracle.com (138.1.137.46): icmp_seq=1 ttl=255 time=154 usec

Verify that a valid CmDiskFile line exists in the following format:
CmDiskFile=file or raw device name
In the preceding command, the file or raw device must be valid. If a file is used but does not exist, then the file will be created if the base directory exists. If a raw device is used, then the raw device must exist and have the correct ownership and permissions.  Sample cmcfg.ora file:
ClusterName=Oracle Cluster Manager, version 9i
MissCount=210
PrivateNodeNames=int-rac1 int-rac2
PublicNodeNames=rac1 rac2
ServicePort=9998
CmDiskFile=/u04/quorum.dbf
KernelModuleName=hangcheck-timer
HostName=int-rac1

Note: The cmcfg.ora file should be the same on both nodes with the exception of the HostName parameter which should be set to the local (internal) hostname.
Make sure all of these changes have been made to all RAC nodes.  More information on ORACM parameters can be found in the following note:
Note 222746.1 – RAC Linux 9.2: Configuration of cmcfg.ora and ocmargs.ora
Note: At this point it would be a good idea to patch to the latest ORACM, especially if you have more than 2 nodes.  For more information see: Note 278156.1 – ORA-29740 or ORA-29702 After Applying 9.2.0.5 Patchset on RAC / Linux

2.8 Start the ORACM (Oracle Cluster Manager)
These steps need to be performed on ALL nodes.
Cd to the $ORACLE_HOME/oracm/bin directory, change to the root user, and start the ORACM.
$ cd $ORACLE_HOME/oracm/bin
$ su root
# ./ocmstart.sh
oracm </dev/null 2>&1 >/u01/app/oracle/product/9.2.0/oracm/log/cm.out &

Verify that ORACM is running with the following:
#  ps -ef | grep oracm
On RHEL 3.0, add the -m option:

#  ps -efm | grep oracm
You should see several oracm threads running.  Also verify that the ORACM version is the same on each node:
# cd $ORACLE_HOME/oracm/log
# head -1 cm.log
oracm, version[ 9.2.0.2.0.49 ] started {Fri May 14 09:22:28 2004 }





3.0 Installing RAC
The Real Application Clusters installation process includes four major tasks.
  1. Install 9.2.0.4 RAC.
  2. Patch the RAC Installation to 9.2.0.5.
  3. Start the GSD.
  4. Create and configure your database.
3.1 Install 9.2.0.4 RAC
These steps only need to be performed on the node that you are installing from (typically Node 1).
Note: Due to bug 3547724, temporarily create a symbolic link /oradata directory pointing to an oradata directory with space available as root prior to running the RAC install: # mkdir /u04/oradata
# chmod 777 /u04/oradata
# ln -s /u04/oradata /oradata
Install 9.2.0.4 RAC into your $ORACLE_HOME by running the installer from the 9.2.0.4 cd or your original stage location for the 9.2.0.4 install.
Use the following commands to start the installer:
% cd /tmp
% /cdrom/runInstaller

Or cd to /stage/Disk1 and run ./runInstaller
Respond to the installer prompts as shown below:
  • At the “Welcome Screen”, click Next.
  • At the “Cluster Node Selection Screen”, make sure that all RAC nodes are selected.
  • At the “File Locations Screen”, verify the destination listed is your ORACLE_HOME directory and that the source directory is pointing to the products.jar from the 9.2.0.4 cd or staging location.
  • At the “Available Products Screen”, check “Oracle 9i Database 9.2.0.4″. Click Next.
  • At the “Installation Types Screen”, check “Enterprise Edition” (or whichever option your prefer), click Next.
  • At the “Database Configuration Screen”, check “Software Only”.  Click Next.
  • At the “Shared Configuration File Name Screen”, enter the path of the CFS or NFS srvm file created at the beginning of step 2.3 or the raw device created for the shared configuration file.  Click Next.
  • Click Install at the summary screen.  Note that some of the items installed will say “9.2.0.1″ for the version, this is normal because only some items needed to be patched up to 9.2.0.4.
  • You will now get a progress window, run root.sh when prompted.
  • You will then see the end of installation screen. Click Exit and confirm by clicking Yes.
Note: You can now remove the /oradata symbolic link: # rm /oradata
3.2 Patch the RAC Installation to 9.2.0.5
These steps only need to be performed on the node that you are installing from.
Run the installer from the 9.2.0.5 staging location:
$ cd $ORACLE_HOME/9205/Disk1
$ ./runInstaller

Respond to the installer prompts as shown below:
  • At the “Welcome Screen”, click Next.
  • View the “Cluster Node Selection Screen”, click Next.
  • At the “File Locations Screen”, make sure the source location is to the products.xml file in the 9.2.0.5 patchset location under Disk1/stage.  Also verify the destination listed is your ORACLE_HOME directory.  Change the $ORACLE_HOME name from the dropdown list to the 9.2 $ORACLE_HOME name.  Click Next.
  • At the “Available Products Screen”, Check “Oracle9iR2 PatchSets 9.2.0.5.0″. Click Next.
  • Click Install at the summary screen.
  • You will now get a progress window, run root.sh when prompted.
  • You will then see the end of installation screen. Click Exit and confirm by clicking Yes.
3.3 Start the GSD (Global Service Daemon)
These steps need to be performed on ALL nodes.
Start the GSD on each node with:
% gsdctl start
Successfully started GSD on local node

Then check the status with:
% gsdctl stat
GSD is running on the local node

If the GSD does not stay up, try running ‘srvconfig -init -f’ from the OS prompt.  If you get a raw device exception error or PRKR-1064 error then see the following note to troubleshoot:
Note 212631.1 – Resolving PRKR-1064 in a RAC Environment
Note: After confirming that GSD starts, if you are on Redhat Advanced Server 3.0, restore gcc296: rm /usr/bin/gcc
mv /usr/bin/gcc3.2.3 /usr/bin/gcc
rm /usr/bin/g++
mv /usr/bin/g++3.2.3 /usr/bin/g++
3.4 Create a RAC Database using the Oracle Database Configuration Assistant
These steps only need to be performed on the node that you are installing from (typically Node 1).
The Oracle Database Configuration Assistant (DBCA) will create a database for you.  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:-
  • Verify that you correctly configured the shared disks for each tablespace (for non-cluster file system platforms)
  • Create the database
  • Configure the Oracle network services
  • Start the database instances and listeners
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.
Note: Prior to running the DBCA it may be necessary to run the NETCA tool or to manually set up your network files. To run the NETCA tool execute the command netca from the $ORACLE_HOME/bin directory. This will configure the necessary listener names and protocol addresses, client naming methods, Net service names and Directory server usage.

If you are using OCFS or NFS, launch DBCA with the -datafileDestination option and point to the shared location where Oracle datafiles will be stored.  Example:
% cd $ORACLE_HOME/bin
% dbca -datafileDestination /ocfs/oradata

If you are using RAW, launch DBCA without the -datafileDestination option.  Example:
% cd $ORACLE_HOME/bin
% dbca

Respond to the DBCA prompts as shown below:
  • Choose Oracle Cluster Database option and select Next.
  • The Operations page is displayed. Choose the option Create a Database and click Next.
  • The Node Selection page appears. Select the nodes that you want to configure as part of the RAC database and click Next.
  • The Database Templates page is displayed. The templates other than New Database include datafiles. Choose New Database and then clickNext.  Note: The Show Details button provides information on the database template selected.
  • DBCA now displays the Database Identification page. Enter the Global Database Name and Oracle System Identifier (SID). The Global Database Name is typically of the form name.domain, for example mydb.us.oracle.com while the SID is used to uniquely identify an instance (DBCA should insert a suggested SID, equivalent to name1 where name was entered in the Database Name field). In the RAC case the SID specified will be used as a prefix for the instance number. For example, MYDB, would become MYDB1, MYDB2 for instance 1 and 2 respectively.
  • The Database Options page is displayed. Select the options you wish to configure and then choose Next. Note: If you did not choose New Database from the Database Template page, you will not see this screen.
  • Select the connection options desired from the Database Connection Options page. Click Next.
  • DBCA now displays the Initialization Parameters page. This page comprises a number of Tab fields. Modify the Memory settings if desired and then select the File Locations tab to update information on the Initialization Parameters filename and location. The option Create persistent initialization parameter file is selected by default. If you have a cluster file system, then enter a file system name, otherwise a raw device name for the location of the server parameter file (spfile) must be entered.  The button File Location Variables… displays variable information. The button All Initialization Parameters… displays the Initialization Parameters dialog box. This box presents values for all initialization parameters and indicates whether they are to be included in the spfile to be created through the check box, included (Y/N). Instance specific parameters have an instance value in the instance column. Complete entries in the All Initialization Parameters page and select Close. Note: There are a few exceptions to what can be altered via this screen. Ensure all entries in the Initialization Parameters page are complete and select Next.
  • DBCA now displays the Database Storage Window. This page allows you to enter file names for each tablespace in your database.
  • The Database Creation Options page is displayed. Ensure that the option Create Database is checked and click Finish.
  • The DBCA Summary window is displayed. Review this information and then click OK.  Once you click the OK button and the summary screen is closed, it may take a few moments for the DBCA progress bar to start.  DBCA then begins to create the database according to the values specified.
During the database creation process, you may see the following error: ORA-29807: specified operator does not exist
This is a known issue (bug 2925665).  You can click on the “Ignore” button to continue.   Once DBCA has completed database creation, remember to run the ‘prvtxml.plb’ script from $ORACLE_HOME/rdbms/admin independently, as the user SYS. It is also advised to run the ‘utlrp.sql’ script to ensure that there are no invalid objects in the database at this time.
A new database now exists. It can be accessed via Oracle SQL*PLUS or other applications designed to work with an Oracle RAC database.
Additional database configuration best practices can be found in the following note:
Note 240575.1 – RAC on Linux Best Practices




4.0 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 after you configure your database. 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 as described below.
To display the configuration details for, example, databases racdb1/2, on nodes racnode1/2 with instances racinst1/2 run:-
$ srvctl config
racdb1
racdb2

$ srvctl config -p racdb1 -n racnode1
racnode1 racinst1 /u01/app/oracle/product/9.2.0

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

Examples of starting and stopping RAC follow:-
$ srvctl start database -d racdb2
$ srvctl stop database -d racdb2
$ srvctl stop instance -d racdb1 -i racinst2
$ srvctl start instance -d racdb1 -i racinst2
For further information on srvctl and gsdctl see the Oracle9i Real Application Clusters Administration manual