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

  • Modified Date:
  • Article ID:000041865


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


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 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
# haconf -dump -makero
3 To ensure that VCS is not running while you edit, stop the VCS engine on all nodes and leave the resources available:
# hastop -all -force
4 Make a backup copy of the file:
# cd /etc/VRTSvcs/conf/config
# cp
5 Copy the Oracle types configuration file into place:
# cp /etc/VRTSagents/ha/conf/Oracle/ /etc/VRTSvcs/conf/config/
6 Edit the file to include the file:
include ""

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   (here 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


#hares -link Listener_FINPRD DB_FINPRD
#hares -link DB_FINPRD IP
#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

Terms of use for this information are found in Legal Notices.



Did this article answer your question or resolve your issue?


Did this article save you the trouble of contacting technical support?


How can we make this article more helpful?

Email Address (Optional)