Setup non RAC Oracle database in Linux Cluster

Steps to integrated Oracle database into red hat Linux cluster
Envrionmnet: Oracle 10g database (non-RAC) on RHEL 5.4
 
1) create script which can start, stop and show status of databases and listeners
Note: use graphical tool: system-config-cluster for quickly go through and avoid typo
2) create cluster resource
resource type: script
name: myscript
path: ***/my.oracle.db.10g.sh
3) create cluster service
name: oracledb
resources: mount point /u01, IP address IP1, IP2, myscript (by sequence)
 
Note 2: Helpful commands to test new clsuter service
 
# show cluster status
clustat 
# admin cluster service
clusvcadm 
 -s service_name # stop service
 -R service_name # restart servicce
 -r  service_name # relocate service
 -d service_name # disable service
 -e service_name  # enable service
# test new configuration
rg_test test /etc/cluster/cluster.conf
# Display start order:
rg_test noop /etc/cluster/cluster.conf start service servicename
# Start a service
rg_test test /etc/cluster/cluster.conf start service servicename  
 
Note 3: make cluster script to log message nicely
 
[root@DB_001 /]# grep -i oracle /var/log/messages |tail -20
Jul 26 09:58:09 DB_001 oracle: <notice> /oracle/cluster/bin/oracledb10g.sh: stopping oracle
Jul 26 09:58:27 DB_001 oracle: <notice> /oracle/cluster/bin/dbshut: Database instance "rcat" shut down.
Jul 26 09:58:37 DB_001 oracle: <notice> /oracle/cluster/bin/dbshut: Oracle Net Listener "LISTENER" stopped.
Jul 26 09:58:55 DB_001 oracle: <notice> /oracle/cluster/bin/dbshut: Database instance "prodapp001" shut down.
Jul 26 09:58:58 DB_001 oracle: <notice> /oracle/cluster/bin/dbshut: Oracle Net Listener "LISTENER" stopped.
Jul 26 09:59:32 DB_001 oracle: <notice> /oracle/cluster/bin/oracledb10g.sh: starting oracle
Jul 26 09:59:33 DB_001 oracle: <notice> /oracle/cluster/bin/dbstart: Oracle Net Listener "LISTENER" warm started.
Jul 26 09:59:43 DB_001 oracle: <notice> /oracle/cluster/bin/dbstart: Database instance "rcat" warm started.
Jul 26 09:59:44 DB_001 oracle: <notice> /oracle/cluster/bin/dbstart: Oracle Net Listener "LISTENER" warm started.
Jul 26 09:59:54 DB_001 oracle: <notice> /oracle/cluster/bin/dbstart: Database instance "prodapp001" warm started.
[root@DB_001 /]#
 
Trick: combine current features of logger, $ORACLE_HOME/bin/dbstart, $ORACLE_HOME/bin/dbshut, /usr/share/cluster/oracledb.sh and skills, of course.
 
Advertisements

About Pang

Oracle DBA working in database, fusion middleware and identity management and cloud.
This entry was posted in Oracle database. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s