You are on page 1of 49

I nst al l at i on Gui de

I BM DB2 Hi gh
Avai l abi l i t y Sol ut i on:
I BM Ti vol i Syst em
Aut omat i on f or
Mul t i pl at f or ms

Tar get Audi enc e

Technology Consultants
System Administrators

Doc ument Ver si on 1.00 - August 11, 2006

SAP AG
Neurottstrae 16
69190 Walldorf
Germany
T +49/18 05/34 34 24
F +49/18 05/34 34 20
w w w .sap.c om

Copyright 2004 SAP AG. All rights
reserved.

No part of this publication may be reproduced or transmitted in any form
or for any purpose without the express permission of SAP AG. The
information contained herein may be changed without prior notice.

Some software products marketed by SAP AG and its distributors contain
proprietary software components of other software vendors.

Microsoft, Windows, Outlook, and PowerPoint are registered trademarks
of Microsoft Corporation.

IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA,
AIX, S/390, AS/400, OS/390, OS/400, iSeries, pSeries, xSeries, zSeries,
z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, and Informix
are trademarks or registered trademarks of IBM Corporation in the
United States and/or other countries.

Oracle is a registered trademark of Oracle Corporation.

UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open
Group.

Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame,
VideoFrame, and MultiWin are trademarks or registered trademarks of
Citrix Systems, Inc.

HTML, XML, XHTML and W3C are trademarks or registered
trademarks of W3C, World Wide Web Consortium, Massachusetts
Institute of Technology.

J ava is a registered trademark of Sun Microsystems, Inc.

J avaScript is a registered trademark of Sun Microsystems, Inc., used
under license for technology invented and implemented by Netscape.

MaxDB is a trademark of MySQL AB, Sweden.




SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and
other SAP products and services mentioned herein as well as their
respective logos are trademarks or registered trademarks of SAP AG in
Germany and in several other countries all over the world. All other
product and service names mentioned are the trademarks of their
respective companies. Data contained in this document
serves informational purposes only. National product
specifications may vary.

These materials are subject to change without notice.
These materials are provided by SAP AG and its affiliated
companies ("SAP Group") for informational purposes
only, without representation or warranty of any kind, and
SAP Group shall not be liable for errors or omissions with
respect to the materials. The only warranties for SAP
Group products and services are those that are set forth in
the express warranty statements accompanying such
products and services, if any. Nothing herein should be
construed as constituting an additional warranty.

SAP Library document classification: PUBLIC

Disclaimer
Some components of this product are based on J ava.
Any code change in these components may cause
unpredictable and severe malfunctions and is therefore
expressively prohibited, as is any decompilation of these
components.

Any J ava Source Code delivered with this product is
only to be used by SAPs Support Services and may not
be modified or altered in any way.


Documentation in the SAP Service Marketplace
You can find this documentation at the following Internet
address:
service.sap.com/instguides




Typographic Conventions

Type Style Description
Example Text Words or characters quoted from
the screen. These include field
names, screen titles,
pushbuttons labels, menu
names, menu paths, and menu
options.
Cross-references to other
documentation
Example text Emphasized words or phrases in
body text, graphic titles, and
table titles
EXAMPLE TEXT Technical names of system
objects. These include report
names, program names,
transaction codes, table names,
and key concepts of a
programming language when
they are surrounded by body
text, for example, SELECT and
INCLUDE.
Example text Output on the screen. This
includes file and directory names
and their paths, messages,
names of variables and
parameters, source text, and
names of installation, upgrade
and database tools.
Example text Exact user entry. These are
words or characters that you
enter in the system exactly as
they appear in the
documentation.
<Example text> Variable user entry. Angle
brackets indicate that you
replace these words and
characters with appropriate
entries to make entries in the
system.
EXAMPLE TEXT Keys on the keyboard, for
example, F2 or ENTER.
Icons

Icon Meaning

Caution

Example

Note

Recommendation

Syntax

Additional icons are used in SAP Library
documentation to help you identify different
types of information at a glance. For more
information, see Help on Help General
Information Classes and Information Classes
for Business Information Warehouse on the first
page of any version of SAP Library.


4 August 2006

Cont ent s

1 Introduction .........................................................................................6
1.1 Reference Documentation..................................................................... 7
1.2 Naming Conventions ............................................................................. 9
2 Planning .............................................................................................10
2.1 Hardware Requirements ...................................................................... 10
2.2 Software Requirements ....................................................................... 11
2.3 Virtual Host Name and Virtual IP Address ......................................... 12
2.3.1 Reusing the Host Name and IP Address of a Single Database Server...................... 12
2.3.2 Setting Up a New Virtual Host Name and IP Address................................................ 14
3 Preparation ........................................................................................15
3.1 Setting Up File Systems ...................................................................... 15
3.2 Setting Up the ssh/rsh Connection..................................................... 16
3.3 Changing the Password of the SAP Connect User ........................... 18
4 Installation .........................................................................................19
4.1 Downloading the Latest DB2 9 Software and SA MP License.......... 19
4.2 Installing the Database Server ............................................................ 19
4.3 Setting Up the High Availability Cluster ............................................. 20
4.3.1 Installing the SA MP Software .................................................................................... 21
4.3.2 Installing the SA MP License...................................................................................... 22
4.3.3 Setting Up the Cluster................................................................................................. 22
4.3.4 Changing References to the Virtual Host Name or IP Address.................................. 25
5 Post-Installation Steps .....................................................................28
5.1 Checking the Cluster Setup ................................................................ 28
5.2 Checking the Cluster Failover ............................................................. 30
5.3 Performing a Backup of the SA MP Core Policy................................ 31
6 Updating the Software......................................................................32
6.1 Updating the Database Fix Paks ......................................................... 32
6.2 Updating SA MP FixPaks ..................................................................... 34
7 Uninstall .............................................................................................35
7.1 Uninstalling Cluster ............................................................................. 35
7.2 Uninstalling SA MP .............................................................................. 36
7.3 Deleting the Database Software.......................................................... 36
Appendix A - SA MP Policy for DB2...................................................37
A.1 Script sapdb2gen.sh ........................................................................... 37
A.2 File sapdb2policy.conf ........................................................................ 38
A.3 Script sapdb2policy.sh ....................................................................... 42
Appendix B - Syntax of SA MP Setup Scripts ..................................44
B.1 Script prereqSAM................................................................................ 44
Migration to Version 7 of the IBM DB2 Universal Database for

August 2006 5
B.2 Script installSAM................................................................................. 45
B.3 Script uninstallSAM............................................................................. 46
Appendix C - Diagnosis/Troubleshooting .........................................47
C.1 Troubleshooting Reference Documentation ..................................... 47
C.2 Requesting SAP Support .................................................................... 47
C.3 Symbol Resolution Failed for db2start on AIX.................................. 47
C.4 DB2 Immediately Stops After the db2start/startdb/startj2eedb
Command.................................................................................................... 48
C.5 DB2 Immediately Starts After the db2stop/stopdb/stopj2eedb
Command.................................................................................................... 49



6 August 2006
1 Introduction
Purpose
This document describes how to set up a high-availability (HA) solution for IBM DB2 for Linux,
UNIX and Windows (version 8 and 9) using IBM Tivoli System Automation for Multiplatforms
(SA MP) when your operating system is AIX or Linux.
SA MP is a high-availability cluster solution which provides several monitoring mechanisms to
detect system failures and a set of rules to initiate the correct action without any user
intervention. The set of rules is called a policy, which describes the relationships between
applications or resources. This provides SA MP with extensive up-to-date information about
the system landscape so that it can restart the resource on the current node or move the
whole application to another cluster node.
IBM provides a free two-node license of SA MP for the IBM DB2 database server only.
Additional licenses are required to set up the SAP central instance for HA.
Due to the database reconnect feature of SAP NetWeaver, a database server failure and a
subsequent failover controlled by SA MP within the database cluster to another node is
almost transparent to the clients. The running transactions of the work processes are
terminated. The end users of transactions within the affected dialog processes get a
message. SAP NetWeaver reconnects to the database server as soon as it is available again.
Example of Setup

DB instance: DB2 cluster using SA MP
Node 1
Host name: db2_sa_mp_1
IP: 17.2.10.1
OS: AIX 5.3
Network: en0
Node 2
Host name: db2_sa_mp_2
IP: 17.2.10.2
OS: AIX 5.3
Network: en0
Shared Disk (Storage Subsystem)
DB2 9 (software + database)
SAP NetWeaver
SAP GUI
Virtual host name: db2_sa_mp_cl
Virtual-IP: 17.2.10.3
Central instance Dialog instance(s)


August 2006 7
The above figure shows a setup of two database servers that share the database software
and the database itself on a shared disk. Both database servers have access to the shared
disk but only one of them is running at any one time and is connected to the shared disk. The
SAP NetWeaver instances are running on different machines. SAP NetWeaver only knows
about the virtual host name or the virtual IP address of the database cluster. SA MP assigns
the virtual IP address to the node where the DB2 software is currently running.

1.1 Reference Documentation
The following section provides information about additional documentation that might be
useful:
SAP documentation
SA MP documentation
Reliable Scalable Cluster Technology (RSCT) documentation
Since SA MP is based on RSCT, make sure that you also refer to this documentation.
Important SAP Notes

Before you start the installation, make sure that you read the latest version of
SAP Note 960843. It contains the most recent information about the installation
of SA MP, as well as corrections to this document.

SAP Documentation
Document URL
Installation Guide SAP NetWeaver
2004s SR1 <ABAP; ABAP+Java;
Java> on <OS>: IBM DB2 Universal
Database for UNIX and Windows
service.sap.com/instguidesnw2004s Installation
Database Upgrade Guide Migration
to Version 9 of IBM DB2 for Linux,
UNIX, and Windows
service.sap.com/instguides Other Documentation
Database Upgrade DB2 UDB



8 August 2006
SA MP Documentation
Document URL
IBM Tivoli System Automation for
Multiplatforms - home page
www.ibm.com/software/tivoli/products/sys-auto-linux/
IBM Tivoli System Automation for
Multiplatforms product manuals
publib.boulder.ibm.com/tividd/td/IBMTivoliSystemAuto
mationforMultiplatforms2.1.html
IBM Tivoli System Automation for
Multiplatforms - Base Component
Users Guide
publib.boulder.ibm.com/tividd/td/ITSAFL/SC33-8210-
06/en_US/PDF/HALGRE22.pdf
IBM Tivoli System Automation for
Multiplatforms - Base Component
Reference
publib.boulder.ibm.com/tividd/td/ITSAFL/SC33-8212-
02/en_US/PDF/HALBCR02.pdf
IBM Tivoli System Automation for
Multiplatforms - End-to-End Automation
Management Users Guide and
Reference
publib.boulder.ibm.com/tividd/td/ITSAFL/SC33-8211-
02/en_US/PDF/HALE2E02.pdf

RSCT Documentation
Document URL
IBM Reliable Scalable Cluster
Technology (RSCT) - Diagnosis Guide
publib.boulder.ibm.com/epubs/pdf/bl5dia03.pdf
IBM Reliable Scalable Cluster
Technology (RSCT) - Library
publib.boulder.ibm.com/infocenter/clresctr/vxrx/index.js
p?topic=/com.ibm.cluster.rsct.doc/rsctbooks.html

The following SAP Notes are referenced within this document. Make sure that you always
have the most recent version of each SAP Note. You can find the SAP Notes in the SAP
Service Marketplace at service.sap.com/notes.
SAP Notes
SAP Note Number Title
70856 DB2 specific actions when renaming DB host
816773 DB6: Installing an SAP OEM license
960843 DB6: Installation of System Automation for
Multiplatforms



August 2006 9
1.2 Naming Conventions
In this document, the following naming conventions apply:
Terminology
IBM DB2 for Linux, UNIX, and Windows is referred to as DB2 9.
IBM DB2 UDB for UNIX and Windows Version 8 is referred to as DB2 Version 8.
IBM Tivoli System Automation for Multiplatforms is referred to as SA MP.
IBM Reliable Scalable Cluster Technology is referred to as RSCT.
Variables
Variable Description
<DBSI D> Name of the database in upper case
<dbsi d> Name of the database in lower case
<SAPSI D> System ID of the SAP system in upper case
<sapsi d> System ID of the SAP system in lower case
<SI D> If SAPSID and DBSID are the same this means SAPSID. In an MCOD
(Multiple Components on One Database) environment the SAPSID and
DBSID are most probably not equal. So SID refers to both of them in upper
case.
<si d> If SAPSID and DBSID are the same, this means SAPSID. In an MCOD
environment the SAPSID and DBSID are most probably not equal. So SID
refers to both of them in lower case.




10 August 2006
2 Planning
Make sure that you read the following sections:
Hardware Requirements [page 10]
Software Requirements [page 11]
Virtual Hostname and Virtual IP Address [page 12]


2.1 Hardware Requirements
To set up the DB2 server in an HA environment using the free two-node license of SA MP,
the following hardware requirements must be met:
Requirement Type Requirement
Server hardware Two separate servers for the database.
Both servers must meet the DB2 requirements as described in the
IBM documentation DB2 Installation Prerequisites for <OS>, which
you can find at:
www.ibm.com/software/data/db2/udb/sysreqs.html
Physical disks One shared disk, which you can mount from both database
servers. No synchronization is required since the disk is mounted
by only one server at a time. NFS is not supported.

We recommend that you use SAN (Storage Area
Network).
Disk space 300 MB additional free disk space on each node within the HA
cluster for the SA MP Software

Make sure that the directories / usr / sbi n, / opt
and / var have at least 100 MB of free disk space
available.


We recommend that you use two identical machines for the cluster setup. Since
the database manager configuration and the database registry are transferred
during movement of DB2 from one node to the other, the configuration must suit
both of them.



August 2006 11
2.2 Software Requirements
The following software requirements must be met for the use of SA MP:
Supported Operating Systems
IA3232-bit X86_64
64-bit
Power
64-bit
AIX 5.2 64 bit X

Requires C++
Runtime Library
for AIX 8.0.0.4
Requires RSCT
2.3.9.1 Fix Pak
IY83473
AIX 5.3 64 bit X

Requires C++
Runtime Library
for AIX 8.0.0.4
Requires RSCT
2.4.5.1 Fix Pak
IY83474
Red Hat Enterprise Linux 3.0 X X

Requires RHEL
3.0 Update 2.
X
Red Hat Enterprise Linux 4.0 X
Requires
compat-
libstdc++-33-
3.2.3 and
xorg-x11-
deprecated-
libs-6.8.1
X
Requires
compat-
libstdc++-33-
3.2.3 and
xorg-x11-
deprecated-libs-
6.8.1
X
Requires
compat-
libstdc++-33-
3.2.3 and
xorg-x11-
deprecated-libs-
6.8.1
SuSE Linux Enterprise Server 8 X

Requires
SLES 8 SP3
X

Requires
SLES 8 SP4
SuSE Linux Enterprise Server 9 X X X
Supported DB2 Fix Pack levels:
For DB2 Version 8, at least Fix Pak 13 is required.
For DB2 9, no additional Fix Paks are required.
Perl must be installed on the database servers. On Linux, Public Domain Korn Shell
(pdksh) must also be installed. For more information, see the document IBM Tivoli
System Automation for Multiplatforms - Base Component Users Guide, which you can
find at:
publib.boulder.ibm.com/tividd/td/ITSAFL/SC33-8210-04/en_US/PDF/halgre20.pdf


12 August 2006
Both nodes must run on the same operating system.
Both host machines must have the same operating system patch level.
See also the latest SA MP release notes at:
publib.boulder.ibm.com/tividd/td/ITSAFL/SC33-8214-05/en_US/PDF/HALRL205.pdf

2.3 Virtual Host Name and Virtual IP Address
The virtual host name and the virtual IP address are used to access the cluster. The virtual
host name is a reference on the DNS server or to the virtual IP address in the / et c/ host s
files. The cluster binds the virtual IP address to the active cluster node. All clients have to
refer either to the virtual host name or directly to the virtual IP address. Therefore, the clients
always connect to the node of the cluster where DB2 is currently running.
To set up such an environment, you can choose between the following options:
Reuse the host name and IP address of a single database server as virtual host name
and IP address [page 12]
Set up new virtual host name and IP address [page 14]


2.3.1 Reusing the Host Name and IP Address of a
Single Database Server
To reuse the host name and the IP address of the single database server as virtual host
name and virtual IP address, you have to replace the host name and the IP address of the
single database server with a new host name and a new IP address. You specify the old host
name and the old IP address of the database server as the new virtual host name and virtual
IP address in the cluster setup configuration file sapdb2pol i cy. conf .
The advantage of this approach is that you do not have to change the references to the
database host of your SAP system landscape and of additional monitoring tools. However,
additional services that are installed on the database server are not available anymore on the
specified host name or IP address.


August 2006 13
The following figure provides an example of such a reuse before and after the cluster has
been set up:



The host name db2_sa_mp_1 of the single database server is reused as virtual host name;
the IP address 17. 2. 10. 1 is reused as virtual IP address. To avoid naming conflicts, the
database server needs a new network identity. Therefore, the database host name is
changed to db2_sa_mp_3 and the IP address to 17. 2. 10. 3.
The host name and IP address of the second database server (Node 2) remain the same and
both database servers are now addressed with the new virtual address and IP address.

2. after:
1. before:
DB2 Failover Cluster
Node 1 (Database server)
Host name: db2_sa_mp_3
IP: 17.2.10.3
Node 2
Host name: db2_sa_mp_2
IP: 17.2.10.2
SAP NetWeaver
Virtual host name: db2_sa_mp_1
Virtual IP: 17.2.10.1
Central instance Dialog instance(s)
Database server (Node1)
Host name: db2_sa_mp_1
IP: 17.2.10.1
Node 2
Host name: db2_sa_mp_2
IP: 17.2.10.2
SAP NetWeaver
Central instance Dialog instance(s)


14 August 2006
2.3.2 Setting Up a New Virtual Host Name and IP
Address
To set up a new virtual host name and a new virtual IP address, you specify the new host
name and the new IP address in the cluster setup configuration file (sapdb2pol i cy. conf ).
The following figure shows an example of how you set up a new virtual host name or IP
address before and after the cluster has been set up:



The database server keeps its host name db2_sa_mp_1 and its IP address 17. 2. 10. 1. A
new virtual host name db2_sa_mp_cl and a new virtual IP address 17. 2. 10. 3 are chosen
for the failover cluster.
If you already have a SAP NetWeaver system running on this database server (Node 1), you
have to change all references to the database host in the SAP system landscape and in the
monitoring tools. Although the sapdb2post . sh script automatically replaces some of the
references in your SAP system landscape, you have to make some of the changes manually.
For more information, see Changing the References to the Virtual Host Name or IP Address
[page 25].

2. after:
1. before:
DB2 Failover Cluster
Node 1 (Database server)
Host name: db2_sa_mp_1
IP: 17.2.10.1
Node 2
Host name: db2_sa_mp_2
IP: 17.2.10.2
SAP NetWeaver
Virtual host name: db2_sa_mp_cl
Virtual IP: 17.2.10.3
Central instance Dialog instance(s)
Database server (Node1)
Host name: db2_sa_mp_1
IP: 17.2.10.1
Node 2
Host name: db2_sa_mp_2
IP: 17.2.10.2
SAP NetWeaver
Central instance Dialog instance(s)


August 2006 15
3 Preparation
Make sure that you perform the following steps before you start the installation:
...
1. Set up file systems [page 15].
2. Set up the ssh/rsh connection [page 16].
3. Change the password of the SAP connect user [page 18].


3.1 Setting Up File Systems
Before you install SA MP, you have to ensure the required file systems are set up as follows:
All directories under / db2 must be located on the shared disk but not on NFS
shares.
For example, the following file systems are required for a standard SAP system with a
database that uses DB2s automatic storage management:

File System Description
/ db2/ db2<dbsi d>
Contains the home directory of db2<sapsi d>.
/ db2/ <DBSI D>/ l og_di r Contains at least the online database log files.
/ db2/ <DBSI D>/ db2dump Contains DB2 diagnostic log files, DB2 dump files,
and further service engineer information.
/ db2/ <DBSI D>/ db2<dbsi d> Contains the local database directory.
/ db2/ <DBSI D>/ sapt emp1 Contains the temporary tablespace(s).
/ db2/ <DBSI D>/ sapdat a1 SAP data for container type database managed
space (DMS) FILE or for use of DB2's automatic
storage management.

To make sure that either of the mentioned file systems is stored on the shared disk,
choose one of the following options (where <di r >can be replaced by any of the
directories mentioned here):
Mount the shared disk on / db2 and create an appropriate directory, for
example, / <di r >.
Create a partition on the shared disk and mount the partition on / db2/ <di r >.
For more information about the recommended file system sizes, see the
installation guide and the database migration guide [page 7].
Mount the shared disk, for example, under / shr and create a link from
/ db2/ <di r > to an appropriate directory under / shr .


16 August 2006
Make sure that all required mount points to the shared disk are not mounted at system
boot time and that the file systems check at boot time is disabled.
On Linux, you have to set the noaut o option and set the sixth column
f s_passno to 0 in file / et c/ f st ab as follows:
/ dev/ sdc1 / db2 r ei ser f s noauto, acl , user _xat t r 0 0
On AIX, you have to set the options check and mount to f al se.
/ db2:
dev = / dev/ f sl v01
vf s = j f s2
l og = / dev/ l ogl v00
mount = false
check = false
opt i ons = r w
account = f al se

You must make sure that none of the file systems are mounted automatically
during system reboot. SA MP is the only authority allowed to mount the file
systems.
If you have to mount the file systems listed above manually, you must disable SA MP
first, that is, set it to manual mode. Otherwise, SA MP unmounts the file systems
immediately.
To set SA MP to manual mode or automation mode, use the following commands as
user r oot , db2<dbsi d>or <sapsi d>adm:
Manual Mode (disabled):
samctrl MT
Automation Mode (enabled):
samctrl -MF
All types of local file systems are supported by SA MP, for example, r ei ser f s, j f s2,
etc.


3.2 Setting Up the ssh/rsh Connection
For the installation of SA MP, you have to enable ssh or r sh login for user r oot without
password authentication. This enables user r oot to connect to all nodes of the cluster
including itself on any node of the cluster. To configure the nodes of the cluster, the SA MP
cluster setup script uses ssh or r sh.

By default, the setup script uses ssh on Linux and r sh on AIX.


August 2006 17
Setting Up the Connection Using ssh
For example, to use RSA authentication instead of password authentication for ssh, proceed
as follows:
1. Log on to the first node of the cluster as user r oot .
2. Generate an RSA key for user r oot by entering the following command:
ssh-keygen t dsa
You are now asked to specify the file name for the key and a passphrase:
Enter the default file name for the key:
~/.ssh/id_dsa
Do not specify any passphrase.
3. To enable key authentication for ssh on the same node, enter the following command:
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
4. To transfer the public key to the second node, enter the following command:
scp ~/.ssh/id_dsa.pub root@<hostname>:~/id_dsa.pub
5. Log on to the second node of the cluster as user r oot .
6. To enable key authentication for ssh on the second node, enter the following
command:
cat ~/id_dsa.pub >> ~/.ssh/authorized_keys
7. To remove the public key file from the home (directory?) of user r oot on the second
node, enter the following command:
rm ~/id_dsa.pub
8. To add both cluster nodes to the list of known hosts, enter the following command:
ssh-keyscan t dsa <host1_short_name>,<host1_full_name>,
<host1_ip> >> ~/.ssh/known_hosts
ssh-keyscan t dsa <host2_short_name>,<host2_full_name>,
<host2_ip> >> ~/.ssh/known_hosts
9. Follow the same procedure in the opposite way on the second node.
Setting Up the Connection Using rsh
If you want to use rsh and to avoid password authentication, you add the two nodes to the
. r host s file in the home directory of the user r oot .
1. Log on to first node of the cluster as user r oot .
2. Add the two nodes to the file . r host s and the user r oot separated by a space.


18 August 2006

Using the example setup shown in the Introduction [page 6] the content of
. r host s should look like the following:
db2_sa_mp_1. company. net r oot
db2_sa_mp_1 r oot
17. 2. 10. 1 r oot
db2_sa_mp_2. company. net r oot
db2_sa_mp_2 r oot
17. 2. 10. 2 r oot


3.3 Changing the Password of the SAP Connect
User
If you change the password of the database connect user with the dscdb6up tool, the
password in the dscdb6. conf file and the operating system password of the connect user
on the database host are changed. On the standby database server the password is not
changed. As a result, the SAP systems cannot connect to the standby database server if DB2
is started on this node.
If you use Network Information Service (NIS) for central user management, the password is
not changed in the NIS directory.
So if you change the password of connect user sap<sapsi d>or <sapsi d>admyou have to
manually change the operating system password on the standby database server in the
failover cluster or in the NIS directory.


August 2006 19
4 Installation
The following sections describe how to install and set up the database failover cluster.
To set up SA MP in a distributed SAP NetWeaver system, do the following:
1. You set up the central services instance or prepare the global host, which is not
described in this document.
2. You install the database instance as follows:
a. Download the latest DB2 9 software and SA MP license [page 19].
b. Install the database server [page 19].
c. Set up the high availability cluster [page 20].
d. Perform post-Installation steps [page 28].
3. You install the central instance, which is not described in this document.

You can also install SA MP after you have completed a distributed SAP
NetWeaver installation. In this case, you only need to install the second
database server as described in Installing the Database Server [page 19] and
continue to set up the high availability cluster as described in Setting Up the
High Availability Cluster [page 20].
If your database server is not addressed using a virtual host name, you have to
change all references to it as described in Changing References to the Virtual
Host Name or IP Address [page 25].


4.1 Downloading the Latest DB2 9 Software and
SA MP License
To be able to install the latest version of DB2 9 and SA MP, download the required software
from SAP Service Marketplace at:
service.sap.com/swdc Download Database Patches (from other vendors) DB2
for UNIX and Windows DB2 9 software download
The SA MP software and setup scripts are bundled with the latest DB2 9 installation image.
Also, the license file for SA MP is packed together with DB2 9 licenses.

4.2 Installing the Database Server
You install the database server as described in the following documentation:
For DB2 Version 8, see:
SAP NetWeaver 2004s SR1 <ABAP/ABAP+Java/Java> on <OS>: IBM DB2 Universal
Database for UNIX and Windows
You can find this on SAP Service Marketplace at:
service.sap.com/instguidesnw2004s Installation


20 August 2006
For DB2 9, see:
Migration to Version 9 of IBM DB2 for Linux, UNIX, and Windows
You can find this on SAP Service Marketplace at:
service.sap.com/instguides Other Documentation Database Upgrade
DB2 UDB

For the installation of the database server, you must consider the following:
If you are using DB2 version 8, you must install the DB2 software on both
hosts of the cluster. Do not mount the software directory itself on the shared
disk. Even if there are two separate database manager configurations and
registries after you have set up the cluster only one is valid and is always
transferred to the current node.
You have to install the OEM license on each node separately.
If you are using DB2 9, you can also install the database software once on
the shared disk. We recommend that you install DB2 9 on the shared disk in
the home directory of user db2<dbsi d>: / db2/ db2<dbsi d>/ db2_v9.
This is the default for SAP NetWeaver future releases.
You have to install the OEM license once on one of the nodes.


4.3 Setting Up the High Availability Cluster
To set up the cluster, you have to perform the following steps:
1. Install the SA MP software on both nodes [page 21].
2. Install the SA MP license [page 22].
3. Set up the cluster [page 22].
4. Change the references to the virtual host name or IP address [page 25]


In future releases of SAP NetWeaver, SAPinst automatically performs most of
the steps shown above.


August 2006 21
4.3.1 Installing the SA MP Software
The SA MP software is bundled with DB2 9 DVD images and it is located in the following
directory on the DVD:
/ <pl at f or m>/ SA_MP/ sof t war e/ .
Procedure
1. Log on to the first node as user r oot .
2. Insert and mount the database software DVD to <dvd_mount >.
3. To change to the mount directory, enter the following command:
cd <dvd_mount>/<platform>/SA_MP
4. To check that the prerequisites are met, enter the following command :
./prereqSAM
5. To start the installation, enter the following command:
./installSAM -noliccheck

You can ignore the warning CT_MANAGEMENT_SCOPE not set . It will be set
automatically during cluster setup.
6. Install the SA MP software on the second node.
See also
For detailed information about the syntax and additional parameters of the scripts
pr er eqSAMand i nst al l SAM, see Appendix B Syntax of SA MP Setup Scripts [page 44].



22 August 2006
4.3.2 Installing the SA MP License
You use the following procedure to install the free two-node license of SA MP.
Prerequisites
You have downloaded the license file sam21. l i c from SAP Service Marketplace as
described in Downloading the Latest DB2 9 Software and SA MP License [page 19].
Check if you have installed the DB2 license. If not already done, install it as described
in SAP Note 816773.
Procedure
1. Log on to the first node as user r oot .
2. Move the license file to the home directory of user r oot :
For Linux: / r oot
For AIX: / home/ r oot
The cluster setup script transfers the license to the second node and installs it on both
nodes.


4.3.3 Setting Up the Cluster
Use
You set up the high-availability cluster using the cluster setup configuration file and the setup
scripts, which are explained in the following tables:

File or Script Name Description
File sapdb2pol i cy. skel Used as a template by script sapdb2gen. sh. File
sapdb2pol i cy. skel contains a basic structure
and template configuration data that is used for the
generation of file sapdb2pol i cy. conf
Script sapdb2gen. sh Generates file sapdb2pol i cy. conf .
File sapdb2pol i cy. conf Contains all data that is required for the setup and
maintenance of the cluster.
It is created by script sapdb2gen. sh. During the
creation process, sapdb2gen. sh asks for all
information required for your cluster setup and
finally generates sapdb2pol i cy. conf .


August 2006 23
Script sapdb2pol i cy. sh Sets up the cluster using the data contained in file
sapdb2pol i cy. conf .

During the setup process, script
sapdb2pol i cy. sh stops the
database server, consecutively starts
and stops both nodes and finally
activates the database on the original
node.
It is also used to reset or delete the cluster
configuration.
Script sapdb2post . sh Executes post installation steps and is invoked by
sapdb2pol i cy. sh.

The script sapdb2post . sh is
invoked by the sapdb2pol i cy. sh
and cannot be executed separately.
It is also used to reset or delete the cluster
configuration.

The following files are replaced during the setup process and are required later.
File Name Description
st ar t db
st ar t j 2eedb
st opdb
st opj 2eedb
sampdbcmd
Replace the former SAP scripts st ar t db and
st opdb because you have to start and stop the
database using the SA MP scripts listed here.

Since SA MP monitors DB2, you
cannot start and stop DB2 using the
DB2 commands db2start or
db2stop. For example, if DB2 is
started using db2start, SA MP
immediately initiates a db2st op
afterwards. For more information on
how to manually start and stop DB2,
see Checking the Cluster Setup [page
28].

Prerequisites
If you have chosen to reuse the host name and IP address of a single database server [page
12], you have to change the host name and the IP address of the database server now.


24 August 2006
Procedure
Copying the Setup Files and Scripts to a Local Directory
The SA MP software is bundled with DB2 9 DVD images and you can find the SA MP
software in the following directory on the DVD:
/ <pl at f or m>/ SA_MP/ scr i pt s/
Before you set up the cluster, you have to copy all files located in this directory to a local
directory, for example, / samp_set up, as follows:
1. Log on to the first node as user r oot .
2. Create a directory for the scripts using the following command:
mkdir ~/samp_setup
3. Insert and mount the database software DVD to <dvd_mount >.
4. Copy the setup files using the following command:
cp <dvd_mount>/<platform>/SA_MP/scripts/* ~/samp_setup/.
Creating File sapdb2policy.conf
File sapdb2pol i cy. conf contains all parameters that are required to set up and maintain
the DB2 cluster properly. It is created by script sapdb2gen. sh. For more information about
the syntax of script sapdb2gen. sh, see A1. Script sapdb2gen.sh [page 37].
1. Log on to the first node as user r oot .
2. Mount the shared disk.
3. Change to the directory to which you copied the scripts:
cd ~/samp_setup
4. Execute the generator script sapdb2gen. sh using the following command:
./sapdb2gen.sh
5. Provide all required parameters.

Some parameters are fixed, some are initial values that you can change and for
some parameters you must enter a value. To accept the default or initial values,
choose Enter.

Make sure that you keep the sapdb2pol i cy. conf because it is required to
reset or uninstall the cluster.
For more information about the parameters that you can check in this configuration file, see
A.2 File sapdb2policy.conf [page 38].


August 2006 25
Setting Up the Cluster Using sapdb2policy.sh
The final setup is performed by the scripts sapdb2pol i cy. sh and sapdb2post . sh
based on the information contained in file sapdb2pol i cy. conf as follows:
1. Log on to the first node as user r oot .
2. Mount the shared disk.
3. Change to the directory to which you copied the scripts using the following command:
cd ~/samp_setup
4. Set up the cluster assuming that you have created the cluster setup configuration file
in ~/ samp_set up using the following command:
./sapdb2policy.sh
f ~/samp_setup/sapdb2policy.conf
-create

The script sapdb2post . sh is invoked by the sapdb2pol i cy. sh and cannot
be executed separately.
5. For local users, such as, db2<dbsi d>, <sapsi d>adm, sap<sapsi d>or
sap<sapsi d>db, you have to set the passwords of these users on the second node
using the passwd command.

The passwords must be the same as on the first node.
For more information on script sapdb2pol i cy. sh, see A.3 Script sapdb2policy.sh [page
42].


4.3.4 Changing References to the Virtual Host Name
or IP Address

You can omit this procedure if one of the following applies:
You are reusing the old host name as the virtual host name.
You have a new installation, that is, you directly set up the failover cluster
after the installation of the database instance before installing the application
servers.
If you have chosen to set up a new virtual host name and a new virtual IP address [page 14],
you must perform the following steps. Although the script sapdb2post . sh performs some of
the steps, you have to perform other steps manually:


26 August 2006
Process Flow
1. sapdb2post . sh changes the default profile:
In the default profile / sapmnt / <SAPSI D>/ pr of i l e/ DEFAULT. PFL, the database
host name has to be replaced for SAPDBHOST and j 2ee/ dbhost .
2. If the DB2 CLI driver is used, sapdb2post . sh changes the DB2 CLI driver settings in
file db2cli.ini, that is, the database host name is replaced.
3. sapdb2post . sh changes the environment of users <sapsi d>admand
sap<sapsi d>:
The environment of the users <sapsi d>admand sap<sapsi d>has to be adapted
because most of the environment source files contain the host name as part of their file
name. For all other nodes of the cluster, sapdb2post . sh creates the appropriate links
as shown in the following example.

. dbenv_db2_sa_mp_2. sh - > . dbenv_db2_sa_mp_1. sh
4. You change the catalog entries on all SAP NetWeaver instances:
a. Log on to the host of an SAP NetWeaver instance as user db2<dbsi d>.
b. Get a list of all catalog entries and look for an entry NODE<SAPSI D>by entering
the following command:
db2 list node directory
c. Uncatalog the reference to the old host name using the following command:
db2 uncatalog node NODE<SAPSID>
d. Catalog the reference to the new virtual host name using the following
command:
db2 catalog tcpip node NODE<SAPSID>
remote <virtual_hostname> server <service_name>
where <ser vi cename>stands for sapdb2<SAPSI D>.
e. Repeat this procedure for all SAP NetWeaver instances.
5. You change the JDBC URL:

The following steps only apply for ABAP+Java and Java systems only.
a. Log on to the host of an SAP NetWeaver instance as user r oot .
b. Change to the directory of the configuration tool using the following command:
cd /usr/sap/<SAPSID>/<Instance>/j2ee/configtool
c. Run the configuration tool using the following command:
./configtool.sh
d. In the left frame, choose security store.
e. In the right frame, choose the key jdbc/pool/<SAPSID>/url.
f. Change the host name in the JDBC URL to the virtual host name.


August 2006 27

URL with the old host name:
j dbc: db2: / / db2_sa_mp_1: 5912/ TSP: def er Pr epar es=0
URL with the new virtual host name:
j dbc: db2: / / db2_sa_mp_cl: 5912/ TSP: def er Pr epar es=0
g. Choose Add.
h. To save your changes, click on the disk icon in the upper left corner.
i. Close the configuration tool.
j. Restart Java instance
...
6. Change the references in remotely monitored systems.

Make sure that you also change the references in your monitoring tools to the
new virtual host name.


28 August 2006
5 Post-Installation Steps
After you have successfully completed the installation, you have to perform the following
post-installation steps:
1. Check the cluster setup [page 28].
2. Check the cluster fail over [page 30].
3. Back up the SA MP core policy [page 31].


5.1 Checking the Cluster Setup
Use
After the installation, check that the failover cluster is working properly.
Procedure
1. Log on to one of the cluster nodes as user r oot , <sapsi d>adm, or db2<dbsi d>.
2. To check if both nodes are online, enter the following command:
lsrpnode

The output looks as follows (RSCT versions can differ):
Name OpState RSCTVersion
db2_sa_mp_1 Onl i ne 2. 4. 5. 2
db2_sa_mp_2 Onl i ne 2. 4. 5. 2
3. To check if the domain is online, enter the following command:
lsrpdomain

The output looks as follows (RSCT versions can differ):
Name OpState RSCTActiveVersion MixedVersions TSPort GSPort
sap_t smdb2 Onl i ne 2. 4. 5. 2 No 12347 12348
4. To check the resource groups, enter the following command:
lsrg

The output looks as follows:
Resource Group names:
db2_db2t sm_0- r g
The naming convention for the resource group name is: db2_db2<dbsi d>_0- r g.
5. To check the status of the resource group, enter the following command:
lsrg g db2_db2<dbsid>_0-rg


August 2006 29

The output looks as follows:
Di spl ayi ng Resour ce Gr oup i nf or mat i on:
For Resour ce Gr oup " db2_db2t sm_0- r g" .

Resour ce Gr oup 1:
Name = db2_db2t sm_0- r g
Member Locat i on = Col l ocat ed
Pr i or i t y = 0
Al l owedNode = ALL
NominalState = Online
Excl udedLi st = {}
Subscr i pt i on = {}
Owner =
Descr i pt i on =
I nf oLi nk =
Act i vePeer Domai n = sap_t smdb2
OpState = Online
TopGr oup = db2_db2t sm_0- r g
Conf i gVal i di t y =
TopGr oupNomi nal St at e = Onl i ne
Most of the commands of SA MP are asynchronous. Therefore, there are two states for
the resource group:
NominalState
Indicates the status that the resource group is supposed to have.
OpState
Shows the current status of the resource group.
If you just started the resource group, the NominalState is Online but the OpState is
Offline or Pending Online. If the resource group is online, OpState turns into Online as
well. Shutting down the resource group causes the same effect but vice versa.
If the resource group is not yet online, start it using the following command:
chrg o online db2_db2<dbsid>_0-rg

To stop the DB2 resource group, set the NominalState to offline using the
following command:
chrg o offline db2_db2<dbsid>_0-rg
To receive more information about resource members of the cluster, use the following
SA MP command:
lsrg Ab m V g db2_db2<dbsid>_0-rg


30 August 2006
In addition, you can use a special script of the DB2 HA precanned policy to display all
registered resources and the status on the node where the script is issued using the
following command:
/usr/sbin/rsct/sapolicies/db2/getstatus

The output looks as follows:
- - Resour ce Gr oups and Resour ces - -
Gr oup Name Resour ces
- - - - - - - - - - - - - - - - - - -
db2_db2t sm_0- r g db2_db2t sm_0- r s_i p
db2_db2t sm_0- r g db2_db2t sm_0- r s_db2_di sk
db2_db2t sm_0- r g db2_db2t sm_0- r s
- - Resour ces - -
Resour ce Name Node Name St at e
- - - - - - - - - - - - - - - - - - - - - - - - - - -
db2_db2t sm_0- r s_i p db2_sa_mp_1 Onl i ne
db2_db2t sm_0- r s_i p db2_sa_mp_2 Of f l i ne
db2_db2t sm_0- r s_db2_di sk db2_sa_mp_1 Onl i ne
db2_db2t sm_0- r s_db2_di sk db2_sa_mp_2 Of f l i ne
db2_db2t sm_0- r s db2_sa_mp_1 Onl i ne
db2_db2t sm_0- r s db2_sa_mp_2 Of f l i ne
6. Check that you can start and stop DB2 in the cluster.
To start and stop the members of the resource group taking the relationship
between them into consideration use the following command:
rgmbrreq -o [start|stop|cancel] <resource_class>:<rgmbr>
To explicitly start and stop the DB2 instance, only use the following command:
rgmbrreq -o [start|stop|cancel]
IBM.Application:db2_db2<dbsid>_0-rs

Since SA MP monitors DB2 you cannot start and stop DB2 using the DB2
commands db2st ar t or db2st op. For example, if DB2 is started using
db2st ar t , SA MP immediately initiates a db2st op afterwards.


5.2 Checking the Cluster Failover
Use
You use the following procedure to check the failover of the cluster by moving the DB2
instance from one node to the other.
Procedure
1. Log on to one cluster node as user r oot , <dbsi d>admor db2<dbsi d>.
2. To move DB2 to another node, enter the following command:
r gr eq - o Move - n <hostname> db2_db2<dbsid>_0- r g


August 2006 31

Since you specify the node to move from, you have to enter the <host name>
where the DB2 instance is currently running.

As result, SA MP shuts down DB2 on the specified node, unmounts the shared disk, removes
the virtual IP address from the network adapter of this node, and sets up everything on the
other node in the cluster. You can monitor the process using the get st at us.
Alternatively, since this method does not check the monitoring and failure-detection features
of SA MP, you can use the following method to check the failover behavior:
You can shut down the operating system on the node where the DB2 instance is currently
running. SA MP detects that the resources of the resource group are not online anymore and
starts all required resources on the other node.


5.3 Performing a Backup of the SA MP Core
Policy
SA MP stores all its knowledge about the cluster in a policy that contains all definitions of
resources, resource groups, and their relationships. Therefore, this policy contains the core
configuration of the SA MP cluster. After cluster setup, we recommend that you back up the
SA MP core policy. This lets you easily restore the initial cluster setup if you accidentally
change the SA MP core policy.
Performing a Backup
The following command creates a backup of the SA MP core policy and writes it to the
bkpPol i cy. xml XML file:
1. Log on to a cluster node as user r oot .
2. To back up the core policy, enter the following command:
sampolicy s /bkp/samp/bkpPolicy.xml
Restore
To restore an SA MP core policy, proceed as follows:
1. Log on to a cluster node as user r oot .
2. To restore the core policy, enter the following command:
sampolicy a /bkp/samp/bkpPolicy.xml


The restore process replaces the current policy by the one specified and finally
activates this policy.



32 August 2006
6 Updating the Software


6.1 Updating the Database Fix Paks
Use
You use the following procedure to update the database Fix Paks in an SA MP environment.
After a DB2 migration or a Fix Pak update, you have to update the DB2 HA precanned policy
files in SA MP that are stored in the subdirectory of the DB2 software directory ha/ t sa .
These policy files are required by SA MP for monitoring, starting, stopping the database
server, and transferring the registry.
Restrictions
In general, you can also apply Fix Paks by performing a rolling update, that is, you update the
standby server first, then fail over to the already updated standby database server, and finally
update the other database server. This causes only several seconds downtime for the failover
of the database to the second node.
However, in an SA MP environment, you must not perform a rolling update for the following
reasons:
For DB2 Version 8, you must not run the application servers and the database server
at different Fix Pak levels. Therefore, you have to shut down the complete SAP system
and update all database servers and the DB2 clients on the application servers.
A rolling update only updates the database server and not the DB2 clients on the
application servers. The result is that the database server has a higher Fix Pak level
than the application servers.
For DB2 9, you can run the database server at a higher Fix Pak level than the
application servers. You can install the Fix Pak besides your current DB2 software,
stop the database server, update the database instance within seconds and finally
restart the database server. In addition, you do not have to restart the application
servers because they will immediately reconnect to the database server. Using this
feature of DB2 to just update the DB2 instance, which means simply recreating the
links in the instance directory, causes only a few seconds downtime for the database
server.
The failover in the rolling update scenario is no faster. Therefore, there is no advantage
in performing a rolling update with DB2 9.
Procedure
1. Log on to the first node as user r oot .
2. To shut down the DB2 instance, enter the following command:
chrg o offline db2_db2<dbsid>_0-rg
3. To check, if DB2 is stopped, enter the following command:
lsrg g db2_db2<dbsid>_0-rg
In the output, check if the OpSt at e is Offline.


August 2006 33
4. To disable SA MP, enter the following command:
samctrl MT
5. If the DB2 software is located on the shared disk, mount it.
6. Apply the DB2 Fix Pak to the first node as described in SAP Note 603972.
7. To remove the old HA policy, enter the following command:
rm /usr/sbin/rsct/sapolicies/db2/*
8. To update to the new HA policy, enter the following command:
cp <DB2_software_dir>/ha/tsa/* /usr/sbin/rsct/sapolicies/db2/.
9. If the DB2 software is located on the shared disk, unmount it.
10. Log on to the second node as user r oot .
11. If the DB2 software is located on the shared disk, mount it.
12. If the DB2 software is not located on the shared disk, you must apply the DB2 Fix Pak
to this node as described in SAP Note 603972.

You must not update the DB2 instance (db2i updt ) again because it was
already updated in step 6.
13. To remove the old HA policy, enter the following command:
rm /usr/sbin/rsct/sapolicies/db2/*
14. To update to the new HA policy, enter the following command:
cp <DB2_software_dir>/ha/tsa/* /usr/sbin/rsct/sapolicies/db2/.
15. If the DB2 software is located on the shared disk, unmount it.
16. To enable SA MP, enter the following command:
samctrl MF
17. To start the DB2 instance, enter the following command:
chrg o online db2_db2<dbsid>_0-rg
18. To check if DB2 is running again, enter the following command:
lsrg g db2_db2<sapsid>_0-rg
The OpState and Nominal State of the resource group come online in a short time.


If you share the DB2 software, you have to install the Fix Pak once only, but you
must replace the DB2 HA precanned policy on both nodes.



34 August 2006
6.2 Updating SA MP FixPaks
For information about how to upgrade an SA MP installation to the latest Fix Pak, see section
Migrating the Product in the document IBM Tivoli System Automation for Multiplatforms -
Base Component Users Guide that is available at:
publib.boulder.ibm.com/tividd/td/IBMTivoliSystemAutomationforMultiplatforms2.1.html.


August 2006 35
7 Uninstall

To uninstall the cluster and the software from the two database hosts, you have to perform
the following steps:
1. You uninstall the cluster [page 35].
2. You uninstalling the SA MP software [page 36].
3. You delete the DB2 software [page 36].


7.1 Uninstalling Cluster
To uninstall the cluster and to separate the two nodes, use the sapdb2pol i cy. sh script as
follows:
1. Log on to the first node where you initially transferred the SA MP scripts (for more
information, see Setting Up the Cluster [page ]) to as user r oot .
2. If the second node becomes the server where the database is running (that is, the
single database server), move directory ~/ samp_set up to the other node and log on
to the other node as user r oot .
3. Change to the directory using the following command:
cd ~/samp_setup
4. Delete the DB2 resource groups using the following command:
./sapdb2policy.sh
f ~/samp_setup/sapdb2policy.conf
-deleteDB2
5. Delete the cluster using the following command:
./sapdb2policy.sh
f <sapinst_instdir>/sapdb2policy.conf
-deleteCluster
6. Change to the home directory using the following command:
cd ~
7. Delete the setup scripts using the following command:
rm R ~/samp_setup
Result
The cluster has been uninstalled and the node where you performed the steps mentioned
here is able to run DB2.
Since the virtual host name and virtual IP address are no longer valid, you have to replace all
references to it with the host name or IP address of the single database server. The
sapdb2pol i cy. sh script already updated the references in the SAP profile, the
db2cl i . i ni file, and sapdb2pol i cy. sh restores the SAP st ar t db/st opdb scripts when
you deleted the DB2 resource group.


36 August 2006
In addition, you have to replace all references listed for manual actions as described in
Changing the References to Virtual Host Name or IP Address [page 18].
You can also remove the users db2<dbsi d>, sap<si d>and <si d>admfrom the host
where the database instance is no longer running.


7.2 Uninstalling SA MP
Use
You uninstall the SA MP software using the uni nst al l SAMscript from the SA MP software
directory on the DVD.
Procedure
1. Log on to the first node as user r oot .
2. Insert and mount the database software DVD to <dvd_mount >.
3. Change to the directory where the SA MP software is located using the following
command:
cd <dvd_mount>/<platform>/SA_MP/software
4. To uninstall the SA MP software, enter the following command:
./uninstallSAM


7.3 Deleting the Database Software
For information about how to delete the DB2 software, see the installation guide SAP
NetWeaver 2004s SR1<ABAP/ABAP+Java/Java> on <Platform>: IBM DB2 Universal
Database for UNIX and Windows.
You can find this at: service.sap.com/instguides2004s Installation


August 2006 37
Appendix A - SA MP Policy for DB2
The following sections provide detailed information about:
Script sapdb2gen.sh [page 37]
File sapdb2policy.conf [page 38]
Script sapdb2policy.sh [page 42]


A.1 Script sapdb2gen.sh
The generator script sapdb2gen. sh generates the cluster setup configuration file that is
required by the sapdb2pol i cy. sh and sapdb2post . sh scripts.
sapdb2gen. sh requires ssh or r sh connection to the cluster nodes as described in Setting
Up the ssh/rsh Connection [page 16] to detect most of the required cluster settings.
Syntax
sapdb2gen. sh [ - h] [ - s <skeletonfile>] [ - f <configfile>] . . .
Options
Parameter Description
- h Prints the usage syntax.
- l <skel et onf i l e> Specifies the skeleton file name. Otherwise, the default is:
sapdb2pol i cy. skel
- f <conf i gf i l e>
Specifies the configuration file name. By default, sapdb2gen. sh
the sapdb2pol i cy. conf file in the current directory.
See also
For a detailed description of all the required configuration information, see section A.2 File
sapdb2policy.conf below.



38 August 2006
A.2 File sapdb2policy.conf
The sapdb2pol i cy. conf policy file contains all parameters that are required to set up the
DB2 cluster properly.
The following is an example of the policy file containing all relevant information based on the
setup example shown in the Introduction [page 6] (where TSMstands for the <SAPSI D>, and
no NFS for home di r ect or i es of l ocal user s).
Example
# I BM_PROLOG_BEGI N_TAG
# Thi s i s an aut omat i cal l y gener at ed pr ol og.
#
# Li censed Mat er i al s - Pr oper t y of I BM
#
# ( C) COPYRI GHT I nt er nat i onal Busi ness Machi nes Cor p. 2003, 2005
# Al l Ri ght s Reser ved
#
# US Gover nment User s Rest r i ct ed Ri ght s - Use, dupl i cat i on or
# di scl osur e r est r i ct ed by GSA ADP Schedul e Cont r act wi t h I BM Cor p.
#
# I BM_PROLOG_END_TAG
#. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .
#| |
#| I BM Ti vol i Syst emAut omat i on f or Mul t i pl at f or ms |
#| Pol i cy f or DB2 |
#| Pol i cy ver si on: 1. 0 |
#| |
#| Conf i gur at i on I nf or mat i on |
#| ========================= |
#| |
#| Thi s scr i pt i s used by ot her scr i pt s t o obt ai n |
#| conf i gur at i on i nf or mat i on. |
#| You must adapt t he i ndi cat ed l i nes t o your envi r onment . |
#| |
#' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - '
###### START OF CUSTOMI ZABLE AREA ###################################
# domai n name
TSA_DOMAI N_NAME=sap_t smdb2
# comma- separ at ed l i st of t he host names
TSA_HOSTNAME_LI ST=db2_sa_mp_1, db2_sa_mp_2
# TSA Li cense Fi l e
TSA_LI CENSE_FI LE=/ home/ r oot / sam21. l i c
# I P addr ess of t he net wor k t i e br eaker
TSA_TI EBREAKER_I P_ADDRESS=17. 2. 10. 0
# r emot e shel l ( ssh or r sh)
TSA_REMOTE_CMD=r sh
# comma- separ at ed l i st of user s of t he TSA oper at or s
TSA_USER_LI ST=db2t sm, t smadm
# i nst al l at i on di r ect or y f or DB2


August 2006 39
DB2_I NST_DI R=/ db2/ db2t sm/ db2_v9
# comma- separ at ed l i st of DB2 communi cat i on por t s,
# each por t i n synt ax <name>: <por t _num>[ , <name>: <por t _num>]
DB2_COMM_PORTS=sapdb2TSM: 5912/ t cp, DB2_db2t sm: 5914/ t cp,
DB2_db2t sm_1: 5915/ t cp, DB2_db2t sm_2: 5916/ t cp,
DB2_db2t sm_END: 5917/ t cp
# Vi r t ual host name of t he cl ust er
DB2_HA_HOSTNAME=db2_sa_mp_cl
# Vi r t ual I P addr ess of t he cl ust er
DB2_HA_I P_ADDRESS=17. 2. 10. 3
# Net wor k Mask f or t he vi r t ual I P addr ess
DB2_HA_I P_MASK=255. 255. 255. 0
# DB2 i nst ance owner
DB2_DB2I NSTANCE=db2t sm
# comma- separ at ed l i st of DB2 di r ect or i es on shar ed di sks
DB2_DI R_LI ST=/ db2/ db2t sm, / db2/ TSM/ db2dump, / db2/ TSM/ db2t sm,
/ db2/ TSM/ l og_di r , / db2/ TSM/ sapdat a1, / db2/ TSM/ sapt emp1
# comma- separ at ed l i st of publ i c HA net wor k i nt er f aces f or DB2,
# at l east one per node
DB2_NETWORK_I NTERFACE_LI ST=en0: db2_sa_mp_1, en0: db2_sa_mp_2
# comma- separ at ed l i st of user gr oups, each gr oup i n synt ax
# <gr oup>: <num>: <l ocal _gr oup>
DB2_GROUP_LI ST=dbt smadm: 1001: t r ue, dbt smct l : 1002: t r ue,
dbt smmnt : 1003: t r ue
# comma- separ at ed l i st of user s, each user i n synt ax
# <user >: <num>: <home_di r >: <l ocal _home_di r >: <shel l >: <l ocal _user >
# <pr i m_gr oup>[ : <sec_gr oup>]
DB2_USER_LI ST=db2t sm: 1010: / db2/ db2t sm: f al se: / bi n/ csh: t r ue: dbt smadm,
sapt sm: 1011: / home/ sapt sm: t r ue: / bi n/ csh: t r ue: dbt smmnt ,
t smadm: 1009: / home/ t smadm: t r ue: / bi n/ csh: t r ue: dbt smmnt
# t he SAP Syst emI D ( SAPSI D)
SAP_SI D=TSM
###### END OF CUSTOMI ZABLE AREA #####################################
Options
Parameter Description Default Value
TSA_DOMAI N_NAME Domain name of the cluster sap_<dbsi d>db2
TSA_HOSTNAME_LI ST Comma-separated list of host
names.
-
TSA_LI CENSE_FI LE Location of downloaded SA
MP license file
Linux:
/ r oot / sam21. l i c
AIX:
/ home/ r oot / sam21. l i c



40 August 2006
TSA_TI EBREAKER_
I P_ADDRESS
IP address of the network tie
breaker, described in detail
below
-
TSA_REMOTE_CMD Remote shell to use for the
setup
Linux: ssh
AIX: r sh
TSA_USER_LI ST Comma-separated list of users
with the authority to start or
stop the cluster and single
resources in the cluster
db2<dbsi d>, <sapsi d>adm
DB2_I NST_DI R Installation directory of the DB2
software
DB2 9:
/ db2/ db2<dbsi d>/ db2_v9
DB2 Version 8:
Linux:
/ opt / I BM/ db2/ V8. 1
AIX:
/ usr / opt / I BM/ db2/ V8. 1
DB2_COMM_PORTS Comma-separated list of DB2
communication ports with the
following syntax:
<name>: <por t >,
For example:
sapdb2TSM: 5912/ t cp,
DB2_db2t sm: 5914/ t cp,
DB2_db2t sm_1: 5915/ t cp,
DB2_db2t sm_2: 5916/ t cp,
DB2_db2t sm_END: 5917/ t cp
sapdb2<DBSI D>: 5912/ t cp,
DB2_db2<dbsi d>: 5914/ t cp,
DB2_db2<dbsi d>_1: 5915/ t cp,
DB2_db2<dbsi d>_2: 5916/ t cp,
DB2_db2<dbsi d>_END: 5917/ t cp
DB2_HA_HOSTNAME Virtual host name of the cluster -
DB2_HA_I P_ADDRESS Virtual IP address of the DB2
database cluster server
-
DB2_HA_I P_MASK Virtual network mask of the
DB2 database cluster server
-
DB2_DB2I NSTANCE DB2 instance owner db2<dbsi d>
DB2_DI R_LI ST Comma-separated list of DB2
mount point directories on the
shared disk
/ db2/ db2<dbsi d>,
/ db2/ <DBSI D>/ l og_di r ,
/ db2/ <DBSI D>/ db2dump,
/ db2/ <DBSI D>/ db2<dbsi d>,
/ db2/ <DBSI D>/ sapt emp1,
/ db2/ <DBSI D>/ sapdat a1
DB2_LV_LI ST AIX logical volume list for
usage of raw devices.
AIX only: / dev/ l v01



August 2006 41

DB2_NETWORK_
I NTERFACE_LI ST
Comma-separated list of
network interfaces for the IP
address equivalency
The list must correspond to the
order in the host name list, one
per host is mandatory.
Linux:
et h0: <host 1>,
et h0: <host 2>,
AIX:
en1: <host 1>,
en1: <host 2>, . . .
DB2_GROUP_LI ST Comma-separated list of
groups with the following
syntax:
<gr oup>: <num>
: <l ocal _gr oup>,
For example:
dbt smadm: 1015: t r ue

If you use NIS for central
user management,
<l ocal _gr oup>has to
be f al se for all groups.
db<sapsi d>adm: <num>: <l ocal gr p>,
db<sapsi d>ct l : <num>: <l ocal gr p>,
db<sapsi d>mnt : <num>: <l ocal gr p>
DB2_USER_LI ST Comma-separated list of users
The syntax is as follows:
<user >: <num>: <home_di r >
: <l ocal _home_di r >
: <shel l >: <l ocal _user >
: <pr i m_gr oup>
[ : <sec_gr oup>] ,
For example:

db2t sm: 1010: / db2/ db2t sm
: f al se: / bi n/ csh: t r ue
: dbt smadm

If you use NFS shares for
your home directories, the
parameter
<l ocal _home_di r >has
to be f al se for all users.

If you use NIS for central
user management,
<l ocal _user >has to be
f al se for all users.
db2<sapsi d>: <num>:
/ db2/ db2<sapsi d>: f al se:
/ bi n/ csh: t r ue: db<sapsi d>adm,
<sapsi d>adm: <num>:
/ home/ <sapsi d>adm: t r ue:
/ bi n/ csh: t r ue: db<sapsi d>mnt
ABAP: sap<sapsi d>: <num>:
/ home/ sap<sapsi d>: t r ue:
/ bi n/ csh: t r ue: db<sapsi d>mnt ,
Java: sap<sapsi d>db: <num>:
/ home/ sap<sapsi d>db: t r ue:
/ bi n/ sh: db<sapsi d>mnt
SAP_SI D SAP system ID. <SAPSI D>



42 August 2006
Network TieBreaker
If the cluster is split into two or more subclusters (for example, because of network problems),
only one subcluster must have the authority to manage the resources of the cluster.
Otherwise, data might be corrupted when it is accessed by several nodes at the same time
and the read/write operations are not synchronized in any way. To ensure correct behavior in
the event of a cluster split, you need a tie breaker. Using the tie breaker technology, only one
subcluster gets the quorum to manage the resources.
The network tie breaker uses the following rule:
The subcluster that can be accessed from outside of the cluster should get the quorum. The
network tie breaker uses an external IP address to resolve a tie. It uses ICMP echo requests
(ping) to check the network connectivity to an IP address that is outside of the cluster.
If the network tie breaker is able to ping the IP address, this part of the cluster gets the
quorum and manages the resources. We recommend that you use the IP address of the
gateway for the network tie breaker. By choosing the gateway as the tie breaker, you ensure
all nodes that can ping the tie breaker can communicate with each other via the gateway.
These nodes should be in the same subcluster after a cluster split.


Make sure that the ICMP echo request and ICMP echo reply messages are not
rejected by any firewall settings for the tie breaker and the cluster nodes.


A.3 Script sapdb2policy.sh
The script sapdb2pol i cy. sh sets up the cluster according to the cluster setup configuration
file. Basically it configures SA MP according to the data contained in the
sapdb2pol i cy. conf file and creates all required resources, resource groups, relationships
between the resources and installs the DB2 HA policy files on the cluster nodes.
Syntax
sapdb2pol i cy. sh [ - h] [ - v] [ - si l ent ] [ - l <logfile>]
[ - f <configfile>]
cr eat e[ Cl ust er | DB2]
- r eset Cl ust er
- del et e[ Cl ust er | DB2]


August 2006 43
Options
Parameter Description
- h Prints the usage syntax
- v Runs the script in verbose mode
- si l ent
Writes no messages to st dout
- l <l ogf i l e> Specifies the log file name. Otherwise, the default log name is
sapdb2pol i cy. l og.
- f <conf i gf i l e> Specifies the configuration file name. By default, the script looks for
sapdb2pol i cy. conf in the current directory.
- cr eat e Creates the SA MP domain and DB2 resources
- cr eat eCl ust er Creates the SA MP domain
- cr eat eDB2 Creates the DB2 resources
- r eset Cl ust er Resets an invalid SA MP domain
- del et eCl ust er Deletes the SA MP domain
- del et eDB2 Deletes the DB2 resources

Return Codes
Return Code Meaning
0 The cluster and all its resources are created successfully
1 Error occurred, see log file for details
2 Syntax error in the configuration file
3 Error creating or deleting the cluster
4 Error creating or deleting the DB2 policy resources
5 Error activating the SA MP license file
6 Error defining local users or local groups




44 August 2006
Appendix B - Syntax of SA MP Setup
Scripts
The following sections provide detailed information about:
Script prerequSAM [page 44]
Script installSAM [page 45]
Script uninstallSAM [page 46]


B.1 Script prereqSAM
The script pr er eqSAMdetermines the prerequisites of SA MP on this node. It checks the
level of the operating system, architecture and distribution and the presence of required
software packages.
Syntax
pr er eqSAM [ - - nodel et ei nst l og] [ - - si l ent ]
[ - d <inst-pkg-dir>] [ - l <log-file>]
...
Options
Parameter Description
- - nodel et ei nst l og Prevents removal of old logs. Since logs carry a Process ID (PID) in
their name it is not likely that old logs are overwritten.
- - si l ent Suppresses output to the command line
- d <i nst - pgk- di r >
Allows prerequisite checking based on NLS files in <i nst - pkg-
di r >although pr er eqSAMis not in the package directory.
pr er eqSAMis not dependent on the packages to be installed, but
needs the directory for its message files.
- l <l ogf i l e>
Logs to file <l og- f i l e>instead of / t mp/ pr er eqSAM. <pi d>. l og

Return Codes
Return Code Meaning
0 The version of the operating system is supported and all prerequisite
packages were found installed at the correct version. The log file
contains names and versions of the installed packages.
20 An installed package does not have the correct version. The log file
contains the names and versions of the missing packages.
21 Package has not been found installed
22 Operating system version is not supported
23 Unable to conduct prerequisite checking due to a reason described in
more detail in the log. Reason might be that a file is missing.


August 2006 45
B.2 Script installSAM
The i nst al l SAMscript checks the prerequisites once again and finally installs the SA MP
software on this machine.
Syntax
i nst al l SAM [ - - f or ce] [ - - nol i ccheck]
[ - - nodel et ei nst l og] [ - - si l ent ] [ - - upgr ade]
[ - d <inst-pkg-dir>] [ - l <logfile>]
...
Options
Parameter Description
- - f or ce
Allows downgrading package samif the installed version is higher
than the version of the supplied package
- - nol i ccheck Allows first time installation even if no license file is supplied, or
allows upgrade if no installed license is found. The fact is recorded in
the log.
- - nodel et ei nst l og Prevents removal of old logs. Since logs contain a PID in their name,
it is unlikely that old logs are overwritten.
- - si l ent Suppresses output to the command line
- - upgr ade
Allows to upgrade SA MP if - si l ent is specified
- d <i nst - pgk- di r >
Allows installing packages from directory <i nst - pkg- di r >although
i nst al l SAMis not in the package directory
- l <l ogf i l e>
Logs to file <l ogf i l e>instead of / t mp/ i nst al l SAM. <pi d>. l og

Return Codes
Return Code Description
0 i nst al l SAMincluding prerequisite checking and installation
completed successfully.
1 Package installer returned with return code not 0, return code and
message can be found in the log. Package installer is: i nst al l p for
AIX, r pmfor Linux.
2
Package samis already installed at the same version. If - - f or ce is
specified, the installation overwrites the same version. A warning is
logged and the installation status is returned.
3 Package samis already installed at a higher version. If - f or ce is
specified, the installation overwrites the higher version. A warning is
logged and the installation status is returned.



46 August 2006

4 Package samis already installed at a lower version than package
version and option - si l ent is specified. If - upgr ade is specified,
upgrade from a lower version is performed and upgrade status is
returned.
5 The node on which the installation task is required is online. The task
is not performed.
6 SA MP base license file is not found or no installed license is
detected.
7 i nst al l SAMwas unable to continue because directories or files
could not be detected or other conditions make it fail.
2x Prerequisite checking conducted by pr er eqSAMfailed (see above).


B.3 Script uninstallSAM
The uni nst al l SAMscript removes SA MP software.
Syntax
uni nst al l SAM [ - - nodel et ei nst l og] [ - - si l ent ]
[ - d <inst-pkg-dir>] [ - l <log-file>]
Options
Parameter Description
- - nodel et ei nst l og Prevents removal of old logs. Since logs carry a PID in their name it is
not likely that old logs are overwritten.
- - si l ent Suppresses output to the command line
- d <i nst - pgk- di r >
Allows uninstall from directory <i nst - pkg- di r >although
uni nst al l SAMis not in the package directory
- l <l ogf i l e>
Logs to file <l og- f i l e>instead of / t mp/ pr er eqSAM. <pi d>. l og

Return Codes
Return Code Description
0 uni nst al l SAMcompleted successfully.
1 Error occurred during uninstall.
2 The domain is still online. Uninstall stopped.
3 Uninstall is not possible.



August 2006 47
Appendix C - Diagnosis/Troubleshooting

C.1 Troubleshooting Reference Documentation
For troubleshooting and diagnosis information, see the following documentation:
IBM Tivoli System Automation for Multiplatforms Base Component Users Guide,
section Appendix Troubleshooting, available at:
publib.boulder.ibm.com/tividd/td/ITSAFL/SC33-8210-04/en_US/PDF/halgre20.pdf
IBM Reliable Scalable Cluster Technology (RSCT) Diagnosis Guide, available at:
publib.boulder.ibm.com/epubs/pdf/bl5dia03.pdf
This guide provides information that helps you to inspect the RSCT subsystems. In
addition, this guide covers a detailed description list of messages of the subsystems.


C.2 Requesting SAP Support
To request SAP support, open a message on SAP Service Marketplace using component
BC-DB-DB6.


C.3 Symbol Resolution Failed for db2start on
AIX
Problem
If you have DB2 installed on the shared disk on AIX, the following error can occur when you
want to start DB2:
> db2st ar t
Coul d not l oad pr ogr amdb2st ar t :
Symbol r esol ut i on f ai l ed f or
/ usr / l i b/ t hr eads/ l i bc. a[ ai o_64. o] because:
Symbol kai o_r dwr 64 ( number 0) i s not expor t ed f r omdependent
modul e / uni x.
Symbol l i st i o64 ( number 1) i s not expor t ed f r omdependent
modul e / uni x.
Symbol acancel 64 ( number 2) i s not expor t ed f r omdependent
modul e / uni x.
Symbol i osuspend64 ( number 3) i s not expor t ed f r omdependent
modul e / uni x.
Symbol ai o_nwai t ( number 4) i s not expor t ed f r omdependent
modul e / uni x.
Symbol ai o_nwai t 64 ( number 5) i s not expor t ed f r omdependent
modul e / uni x.
Symbol ai o_nwai t _t i meout ( number 6) i s not expor t ed f r omdependent
modul e / uni x.
Symbol ai o_nwai t _t i meout 64 ( number 7) i s not expor t ed f r omdependent


48 August 2006
modul e / uni x.
Syst emer r or : Er r or 0
Exami ne . l oader sect i on symbol s wi t h t he ' dump - Tv' command.

The error occurs if you do not install DB2 on the node where you did not use db2set up and
you do not have asynchronous I/O (AIO) enabled. Normally, db2set up enables it for you
during setup.
Solution
1. Check if AIO is enabled by the following command:
lsdev Cc aio
If AIO is enabled, the output is as follows:
ai o0 Avai l abl e Asynchr onous I / O ( Legacy)
Otherwise, it is like the following:
ai o0 Def i ned Asynchr onous I / O ( Legacy)
4. Enable AIO as follows:
a. Log on to the node as user r oot .
b. Open AIO configuration in smitty using the following command:
smitty aio
c. Enable AIO by the topic " Conf i gur e def i ned ai o" .

C.4 DB2 Immediately Stops After the
db2start/startdb/startj2eedb Command
Problem
After you have installed SA MP and configured SA MP to manage DB2, the native DB2
db2st ar t command is obsolete. If you use db2st ar t to start a DB2 instance, SA MP does
not know that you want to start DB2 on this node. Once SA MP monitors that DB2 is started
on this node, it immediately stops DB2 according to the rule this resource is supposed to be
offline. On Linux and AIX (if sysl ogd is configured), you see an entry in the system log that
db2_st op. ksh is invoked to bring DB2 down.
During the setup of the cluster the SAP scripts st ar t db and st ar t j 2eedb are replaced by
the script sapdb2post . sh. The new scripts use SA MP commands to start DB2 via SA MP
commands.
Solution
Make sure that the scripts you use to start DB2 are the same as on the SA MP setup images.



August 2006 49
C.5 DB2 Immediately Starts After the
db2stop/stopdb/stopj2eedb Command
Problem
When you have installed SA MP and configured SA MP to manage DB2 the native db2st op
command becomes obsolete. If you use db2st op to stop a DB2 instance, SA MP does not
know that you want to stop DB2 on this node. Once SA MP monitors that DB2 is stopped on
this node, it immediately starts DB2 according to the rule this resource is supposed to be
online. On Linux and AIX (if sysl ogd is configured), you see an entry in the system log that
db2_st ar t . ksh is invoked to start DB2.
During the setup of the cluster the SAP scripts st opdb and st opj 2eedb are replaced by the
script sapdb2post . sh. The new scripts use SA MP commands to stop DB2 using SA MP
commands.
Solution
Make sure that the scripts you use to stop DB2 are the same as on the SA MP setup images.

You might also like