HACMP (High Availability Cluster MultiProcessing) is the IBM® high availability solution for business-critical applications on AIX®. It monitors applications and their resources for failures and automatically relocates them to another cluster node on failure to ensure high availability.
HACMP Smart Assist configures applications (WebSphere® Application Server, DB2, and Oracle) in cluster environments with minimal inputs, minimizing time and effort to integrate them with HACMP. They simplify the configuration of HACMP in conjunction with several applications. DB2 Smart Assist allows users to configure non-partitioned DB2 Universal Database instances under HACMP for high availability. DB2 Smart Assist of PowerHA v6.1 supports DB2 V8.1/8.2 and DB2 V9.1/9.5.
This article gives a step-by-step approach to enable DB2 applications for HACMP as DB2 Smart Assist validates the installation of the application before configuring it under HACMP. This article assumes that we have a two-node cluster with Node1 as the primary node and Node2 as the failover/fallover/takeover/stand-by/secondary node, as shown below in Figure 1.
Figure 1. Primary and secondary nodes

Before you begin, check out the DB2-specific requirements and the Smart Assist for DB2 User's Guide for planning the DB2 installation in the HACMP environment.
- Creating volume groups, logical volumes, and filesystems
DB2 Smart Assist requires the DB2 instance's home directory to be on a shared volume group (vg).
db2vg1 (shared) -> (hdisk1 on Node1 and hdisk3 on Node2)
It is recommended that you create the volume groups with the HACMP C-SPOC utility. You can also create logical volumes and filesystems using SMIT or AIX commands. To create the volume group, do the following on Node1.
To create a volume group using C-SPOC, do the following:
smitty hacmp -> System Management(C-SPOC) -> HACMP Logical Volume Management -> Shared Volume Groups -> Create a Shared Volume Group.
Select the nodes appropriately to create a volume group.
To create a volume group using AIX commands, enter:
#umask 022 # mkvg -f -V 70 -y db2vg1 hdisk1 db2vg1 #chvg -an db2vg1 #mklv -t jfs2 -y dbinstance1 db2vg1 128 dbinstance1 #crfs -v jfs2 -d dbinstance1 -m /dbinstance1 -A no #mount /dbinstance1
To create a volume group using SMIT:
smitty vg -> Add a volume group -> Add an original volume groupEnter the VOLUME GROUP name (db2vg1), select PHYSICAL VOLUME name (hdisk1) and change the Activate volume group AUTOMATICALLY at system restart? to NO and click Enter.
To create a logical volume using SMIT, enter:
smitty lv ->Add a Logical VolumeChoose the VOLUME GROUP name(db2vg1) and fill the fields, Logical volume NAME(dbinstance1), number of LOGICAL PARTITIONS(128), PHYSICAL VOLUME names(hdisk1), logical volume TYPE(jfs2) and click Enter.
To create a filesystem using SMIT, enter:
smitty fs -> Add / Change / Show / Delete File Systems -> Enhanced Journaled File Systems -> Add an Enhanced Journaled File System on a Previously Defined Logical VolumeEnter the Logical Volume name (dbinstance1), the mount point (/dbinstance1), and set mount AUTOMATICALLY at system restart? to no and click Enter.
- Creating users and groups
Create the DB2 users and groups on the primary node (Node1) and enter:
#mkgroup id=515 dasadm1 #mkuser id=515 pgrp=dasadm1 home=/dbinstance1/dasusr1 dasusr1 #passwd dasusr1 Changing password for "dasusr1" dasusr1's New password: Enter the new password again: #pwdadm -c dasusr1 #mkgroup id=516 db2grp1 #mkgroup id=517 db2fgrp1 #mkuser id=516 pgrp=db2grp1 groups=db2grp1,dasadm1 home=/dbinstance1/db2inst1 db2inst1 #mkuser id=517 pgrp=db2fgrp1 home=/dbinstance1/db2fenc1 db2fenc1 #passwd db2inst1 Changing password for "db2inst1" dasusr1's New password: Enter the new password again: #pwdadm -c db2inst1 #passwd db2fenc1 Changing password for "db2fenc1" dasusr1's New password: Enter the new password again: #pwdadm -c db2fenc1Create groups (db2grp1, db2fgrp1, dasadm1) using SMIT:
smitty ->Security and Users ->Groups ->Add a GroupEnter the group name (db2grp1), set ADMINISTRATIVE group? to false and click Enter. Leaving the Group ID empty generates an available groupID automatically.
Create users (db2inst1, dasusr1, db2fenc1) using SMIT:
smitty ->Security and Users ->Users ->Add a userEnter the user name (db2inst1), Primary Group (db2grp1), Group SET (db2grp1, dasadm1) and home directory (/dbinstance1/db2inst1) and click Enter. Leaving the User ID empty generates an available userID automatically
Assign or change password of a user:
smitty ->Security and Users ->Users ->Change a User's PasswordSelect the user and click Enter.
- Installing DB2 on the primary node
Before you start installation, ensure that:
- All the system requirements were met, disk, memory, and more. Refer to the DB2 installation requirements for the AIX Operating System.
- The DB2 product image is available.
- The DB2 setup wizard is a graphical installer, so an 'X' Windows® software capable of running the Graphical User Interface is required for DB2 setup. Also ensure that "DISPLAY" is properly exported.
To start the DB2 setup wizard:
- Log in as root.
- Change to the location of the DB2 product image(./product/disk1).
- Run
./db2setupfrom the directory where the product image resides. - The IBM DB2 Setup Launchpad opens. You can view the Installation prerequisites, and the Release Notes from here or go directly to the installation.
- Click Install Products.
- Select DB2 UDB Enterprise Server Edition and click Next.
- When the Welcome screen appears, click Next.
- Select Accept to accept the Software License Agreement and click Next.
- In the "Select Installation Type" screen, select Typical for the installation type. Click Next.
- Select Install DB2 UDB Enterprise Edition Server on this computer and save your settings in a response file and click Next.
- The following screen prompts you for User Information for the DB2 Administrator Server. Select Existing user and click the browse button (a box with three dots on it) and select All users in the primary group. Select dasusr1 in the selected group. Click OK then click Next .
- Select Do not setup an instance in the "Setup a DB2 Instance" screen because the instance will be created manually. Click Next.
- Set up the "SMTP Notification server" appropriately and click Next.
The Summary screen shows the preferences specified for the product installation. Click Finish.
The installation logs, db2setup.log and db2setup.err by default, are in the /tmp directory. Ensure that you provide adequate space in this directory. The db2setup.log file captures all DB2 installation information, including errors. The db2setup.err file captures any error output that is returned by Java™ (for example, exceptions and trap information).
After installation is successful, run the following command to turn off the DB2 fault monitor:
chitab "fmc:2:off:<db2_install_dir>/bin/db2fmcd #DB2 Fault Monitor Coordinator"
Here “db2_install_dir” would be /usr/opt/db2_08_02 for DB2 v8.2 and /opt/IBM/db2/V9.5 for DB2 v9.5.
- Create a Instance.
Run the following command to create a shared instance on DB2 V8.2
#/usr/opt/db2_08_02/instance/db2icrt -a SERVER -s ese -u db2fenc1 -w 32 -p db2c_db2inst1 db2inst1
Run the following command to create a instance on DB2 V9.5
#/opt/IBM/db2/V9.5/instance/db2icrt -a SERVER -s ese -u db2fenc1 -p db2c_db2inst1 db2inst1
- Database creation:
#su - db2inst1 # become the instance owner db2start db2sampl # create the sample database db2 'connect to sample' db2 'select * from staff where dept=20' db2 terminate db2stop exit
- Installing DB2 on standby node
Create users and groups as shown above with same UIDs, GIDs, passwords on takeover node.
Do ./db2setup as above and then run:
#chitab fmc:2:off:/usr/opt/db2_08_02/bin/db2fmcd #DB2 Fault Monitor Coordinator
Do the following on Node2:
#importvg -V 70 -y db2vg1 hdisk3 db2vg1 #chvg -an db2vg1 #mount /dbinstance1
Do ./db2setup as above and then run:
#chitab fmc:2:off:/usr/opt/db2_08_02/bin/db2fmcd #DB2 Fault Monitor Coordinator
- Adding entries to /etc/services on failover nodes
Copy the following entries in /etc/services on the primary node (Node1) to /etc/services on the takeover node (Node2).
The entries in /etc/services on Node1 will look like the following:
DB2_db2inst1 60000/tcp DB2_db2inst1_1 60001/tcp DB2_db2inst1_2 60002/tcp DB2_db2inst1_END 60003/tcp
Before starting the DB2 instance on failover node Node 2, update the db2nodes.cfg file.
#vi /dbinstance1/db2inst1/sqllib/db2nodes.cfg
The middle column should be the hostname of the primary node. Change the hostname of the secondary node to the primary node's hostname.
To change the hostname on the failover nodes:
smitty hostname -> set the HostnameEnter the hostname of the primary node.
Verify that you can start the instance on the takeover node (Node2).
su - db2inst1 db2start db2 'connect to sample' db2 'select * from staff where dept=20' db2 terminate db2stop exit
- Mutual Takeover configuration
If you are planning for Mutual Takeover configuration of HACMP (Refer to Smart Assist for DB2 User's Guide for information on Mutual Takeover configuration), then you need to install the second instance on the other shared volume group (say, db2vg2).
#mkvg -f -V 70 -y db2vg2 hdisk4 db2vg2 #chvg -an db2vg2 #mklv -t jfs2 -y dbinstance2 db2vg2 128 dbinstance2 #crfs -v jfs2 -d dbinstance2 -m /dbinstance2 -A no #mount /dbinstance2
Then create the user db2inst2:
#mkuser id=526 pgrp=db2grp1 groups=db2grp1,dasadm1 home=/dbinstance2/db2inst2 db2inst2 #passwd db2inst2 Changing password for db2inst2 dasusr1's New password: Enter the new password again: #pwdadm -c db2inst2
Now create the instance:
#<db2_install_dir>/instance/db2icrt -a SERVER -s ese -u db2fenc1 ‘-w 32’ -p db2c_db2inst2 db2inst2
Please note that ‘–w 32’ option should be used only with DB2 v8.1/8.2.
Create the database for db2inst2:
#su - db2inst2 # become the instance owner db2start db2sampl # create the sample database db2 'connect to sample' db2 'select * from staff db2 terminate db2stop exit
Now unmount the filesystem and varyoffvg on this node and import it to other cluster node.
Make sure that Users and groups are created with same UIDs and GIDs on takeover nodes. Verify that you could run db2inst2 on this node (Node2).
- Export variable “DSE_INSTALL_DIR”
This variable DSE_INSTALL_DIR needs to be exported only if you are working with DB2 V9.1 and V9.5. you do not have to export this variable if you are at V8.1 or V8.2.
#export DSE_INSTALL_DIR="/opt/IBM/db2/V9.5"
- Adding DB2 applications to HACMP
Install HACMP if it is has not previously been installed on all the nodes. Add the necessary entries to /etc/hosts on all the cluster nodes and configure a cluster. Refer to Configuring DB2 in an HACMP Cluster for configuring a cluster.
Configure the service IP label:
smitty hacmp -> Extended Configuration -> Extended Resource Configuration -> HACMP Extended Resources Configuration ->Configure Service IP Labels/Address -> Add a service IP Label/Address -> Configurable to multiple nodes.
Select the Network and enter the IP that you are planning to use as service IP label for DB2 and click Enter.
Synchronize the changes to all the cluster nodes:
smitty hacmp -> Initialization and Standard Configuration ->Verify and Synchronize HACMP Configuration.
Once you verify that DB2 instance can be managed on failover node, Edit the db2nodes.cfg to have the service IP label that you are planning to use with HACMP.
#vi /dbinstance1/db2inst1/sqllib/db2nodes.cfg
The middle column should be the service IP label to be used for PowerHA.
To configure the DB2 application, enter:
smitty hacmp -> Initialization and Standard Configuration -> Configuration Assistants -> Make Applications Highly Available (Use Smart Assists) -> Add an Application to the HACMP ConfigurationHACMP will discover the nodes where DB2 is installed and will show the node names against DB2 Smart Assist in the selector screen, as shown below.
Figure 2. DB2 Smart Assist selector screen
Make sure that the node names are displayed properly against DB2 Smart Assistant.
When you select the DB2 Smart Assistant, the following screen displays:
Figure 3. Select the specific configuration screen
Choose your option and enter the application name, takeover nodes, database to be monitored, and service IP label, and click Enter. Smart Assist will add the DB2 instance(s) to the HACMP configuration. (Refer to Smart Assist for DB2 User's Guide for DB2 Smart Assist options).
Smart Assist helps minimize effort in configuring applications under HACMP. Once you enable DB2 applications for HACMP DB2 Smart Assist, HACMP will provide monitoring and recovery support for the application on failures.
Learn
- The AIX and UNIX developerWorks zone provides a wealth of information relating to all aspects of AIX systems administration.
- Open source: Visit the developerWorks Open source zone for extensive how-to information, tools, and project updates to help you develop with open source technologies, and use them with IBM products.
- developerWorks technical events and webcasts: Stay current with developerWorks technical events and webcasts.
- Podcasts: Tune in and catch up with IBM technical experts.
Get products and technologies
- The
Smart Assist for DB2
User's Guide provides information on
planning and configuring an HACMP high-availability environment for DB2.
- HACMP Planning Guide
provides information necessary to plan and install the High Availability Cluster
Multi-Processing for AIX software.
- HACMP
Administration Guide provides information necessary to configure, manage, and troubleshoot the High
Availability Cluster Multi-Processing for AIX (HACMP) software.
- HACMP Installation
Guide provides information necessary to plan and install the High Availability Cluster Multi-Processing for AIX software, version 5.4.1.
- DB2 Installation Requirements
- HACMP Concepts and
Facilities Guide introduces the High Availability Cluster Multi-Processing for AIX
software.
- HACMP Trobuleshooting
Guide provides information necessary to troubleshoot the High Availability Cluster
Multi-Processing for AIX v.5.4.1 software.
- Other HACMP related information
Discuss
- AIX forum
- AIX forum for developers
- Cluster Systems Management
- IBM Support Assistant Forum
- Performance Tools Forum
- Virtualization Forum
- More AIX and UNIX forums




