How to add Oracle Database under VCS configuration using Command Line.

Article:TECH87319  |  Created: 2009-01-06  |  Updated: 2010-01-12  |  Article URL http://www.symantec.com/docs/TECH87319
Article Type
Technical Solution

Product(s)

Environment

Issue



How to add Oracle Database under VCS configuration using Command Line.

Solution




1) Make sure that Oracle Agent Package is installed and the version is as per Agent Support Matrix.

#pkginfo -l VRTSvcsor       (For Solaris)
#rpm -qa |grep VRTSvcsor (For Linux)
#lslpp -l |grep VRTSvcsor   (For AIX)
#swlist |grep VRTSvcsor    (For HP-UX)

Also, make sure that after Oracle Agent installation, you have imported OracleTypes.cf file as follows...

To import using the command line
1 Log in to node as superuser.
2 Ensure that all changes to the existing configuration have been saved and that further changes are prevented while you modify main.cf:
# haconf -dump -makero
3 To ensure that VCS is not running while you edit main.cf, stop the VCS engine on all nodes and leave the resources available:
# hastop -all -force
4 Make a backup copy of the main.cf file:
# cd /etc/VRTSvcs/conf/config
# cp main.cf main.cf.orig
5 Copy the Oracle types configuration file into place:
# cp /etc/VRTSagents/ha/conf/Oracle/OracleTypes.cf /etc/VRTSvcs/conf/config/OracleTypes.cf
6 Edit the main.cf file to include the OracleTypes.cf file:
include "OracleTypes.cf"

Now, once the cluster is up and running using #hastart

2) Configure SG as in following Example...

A)Open the Cluster Configuration
# haconf -makerw

B) Add the SG in cluster
#hagrp -add Service_Group_Name
e.g # hagrp -add ORAPRD

Add the System List and AutoStart list as per the requirement.

#hagrp -modify ORAPRD SystemList system1 0 system2 1
#hagrp -modify ORAPRD AutoStartList system1 system2

C) Add the Resources to SG :

i) Add Oracle DB Resource :
#hares -add Resource_Name Resource_Type Service_Group_Name
e.g #hares -add DB_FINPRD Oracle ORAPRD

ii) Add Listener Resource :
#hares -add Listener_Resource_Name Netlsnr Service_Group_Name
e.g #hares -add Listener_FINPRD Netlsnr ORAPRD

iii) Add IP Resource :
#hares -add IP_Resource_Name IP Service_Group_Name
e.g #hares -add IP_Prod IP ORAPRD

iv) Add NIC Resource :
#hares -add NIC_Resource_Name NIC Service_Group_Name
e.g #hares -add NIC_Prod NIC ORAPRD

v) Add Volume Resource:
#hares -add Volume_Resource_Name Volume Service_Group_Name
e.g.#hares -add ORAVol Volume ORAPRD

vi) Add Diskgroup Resource :
#hares -add Diskgroup_Resource_Name DiskGroup Service_Group_Name
e.g #hares -add ORADG DiskGroup ORAPRD

vii) Add Mount Resource :
#hares -add Mount_Resource_Name Mount Service_Group_Name
e.g #hares -add ORAMOUNT Mount ORAPRD


D) Now Add the Required Attributes for each of the Resources using the following command syntax :

#hares -modify Resource_Name Attribute Value

For Oracle Resource :

#hares -modify DB_FINPRD SID Test1   (here Test1 is the Oracle DB instance Name)
#hares -modify DB_FINPRD Owner Oracle (here Oracle is the Owner for Oracle)
#hares -modify DB_FINPRD Home /oracle/product/10.2.0   (here /oracle/product/10.2.0 is the Oracle Home Directory)

For Listener Resource :

#hares -modify Listener_FINPRD Owner Oracle (here Oracle is the Owner for Oracle)
#hares -modify Listener_FINPRD Home /oracle/product/10.2.0   (here /oracle/product/10.2.0 is the Oracle Home Directory)

For IP Resource :

#hares -modify IP_Prod Address 10.154.146.178   (here 10.154.146.178 is the Virtual IP)
#hares -modify IP_Prod Device ce0               (here ce0 is the NIC Device)

For NIC Resource :

#hares -modify NIC_Prod Device ce0               (here ce0 is the NIC Device. This NIC is separate NIC and not used anywhere)

For Volume Resource :

#hares -modify ORAVol Volume testvol  (here testvol is the volume for Oracle Home)
#hares -modify ORAVol DiskGroup testdg            (here testdg is the Diskgroup for volume)

For Diskgroup Resource:

#hares -modify ORADG DiskGroup testdg            (here testdg is the Diskgroup for volume)
#hares -modify ORADG DiskGroupType private

For Mount Resource :

#hares -modify ORAMOUNT BlockDevice /dev/vx/dsk/testdg/testvol
#hares -modify ORAMOUNT FSType vxfs
#hares -modify ORAMOUNT FsckOpt "%-y"
#hares -modify ORAMOUNT MountPoint /oracle


E) Now Add the dependencies using following command...

#hares -link Resource_Name Resource_it_depends_on

e.g

#hares -link Listener_FINPRD DB_FINPRD
#hares -link DB_FINPRD IP
#hares -link DB_FINPRD ORAMOUNT
#hares -link ORAVol ORADG
#hares -link ORAMOUNT ORAVol
#hares -link IP NIC

Here we completed SG configuration.

3) Now, Start the SG  and Failover as following..

i) Enable All Resources for SG:

#hagrp -enableresources Service_Group_Name
e.g # hagrp -enableresources ORAPRD

ii) Online the SG on node 1 :

#hagrp -online Service_Group_Name -sys System_Name

e.g #hagrp -online ORAPRD -sys node1

Now check #hastatus -sum and verify the status on SG.


iii) Failover SG to node 2 :

#hagrp -switch Service_Group_Name -to System_Name
e.g hagrp -switch ORAPRD -to node2

Check #hastatus -sum and confirm the status of Service Group.

4) Save & Close the Cluster Configuration
#haconf -dump -makero


Legacy ID



319125


Article URL http://www.symantec.com/docs/TECH87319


Terms of use for this information are found in Legal Notices