469,362 Members | 2,548 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,362 developers. It's quick & easy.

DB2 - check if product installed on Solaris/AIX/HPUX

pwu
Hi,

I am doing an automated scan of a large number of UNIX machines which
can be Solaris, AIX or HPUX.

I want to find out for a machine via a script if:
1) DB2 is installed?
2) If installed what version is installed

What file/process/user can I check to achieve this?

Thanks for any help.
Oct 10 '08 #1
4 12156
On Oct 10, 11:37*am, p...@qantas.com.au wrote:
Hi,

I am doing an automated scan of a large number of UNIX machines which
can be Solaris, AIX or HPUX.

I want to find out for a machine via a script if:
1) DB2 is installed?
2) If installed what version is installed

What file/process/user can I check to achieve this?

Thanks for any help.
you can write a script using db2ls and db2level ...command
Oct 10 '08 #2
DB2 v9 is default installed in /opt, older version may have a default
install in /usr. You might have a custom install directory.
you might check these directories for the occurence of the file db2level

find /opt /usr -name db2level -print
/opt/IBM/db2/V9.5/bin/db2level
/usr/opt/db2_08_01/bin/db2level
/usr/opt/db2_08_01/bin64/db2level
/usr/opt/db2_08_01/das/bin/db2level
/usr/opt/db2_08_01/das/bin64/db2level

this shows i have v9.5 and v8.1 db2 products installed on my AIX machine

<pw*@qantas.com.auwrote in message
news:bc**********************************@p10g2000 prf.googlegroups.com...
Hi,

I am doing an automated scan of a large number of UNIX machines which
can be Solaris, AIX or HPUX.

I want to find out for a machine via a script if:
1) DB2 is installed?
2) If installed what version is installed

What file/process/user can I check to achieve this?

Thanks for any help.
Oct 10 '08 #3
I can only speak for AIX - but it might work for HP-UX and Solaris
also...

In the directory /var/db2 (if it exists - if not DB2 should not be
installed)
you'll find a file named "global.reg"
It contains all informations about installed software and instances.
It is a binary file - so a bit hard to get informations from...

First of all: If it exists, this is an indicator that DB2 is installed
- or was installed.

You can use "strings" to look for pathnames in this file and parse
them and check if it contains a subdirectory "bin" and a program
"db2ilist" or "db2greg". The last one gives readable output for the /
var/db2/global.reg
This you can use to obtain the software installed (might be deleted)
and the instances with their software level.

The informations about instances should be actual, the ones about
installed software not - we delete manually "old" fixpack versions and
so they stay in this file. Check the directories if they are
populated.

Keep in mind, that you can have several versions of DB2 and fixpack
levels installed and active.
For each instance you'll find the level inside /var/db2/global.reg
On Oct 10, 8:37*am, p...@qantas.com.au wrote:
Hi,

I am doing an automated scan of a large number of UNIX machines which
can be Solaris, AIX or HPUX.

I want to find out for a machine via a script if:
1) DB2 is installed?
2) If installed what version is installed

What file/process/user can I check to achieve this?

Thanks for any help.
Oct 10 '08 #4
pw*@qantas.com.au wrote:
Hi,

I am doing an automated scan of a large number of UNIX machines which
can be Solaris, AIX or HPUX.

I want to find out for a machine via a script if:
1) DB2 is installed?
2) If installed what version is installed

What file/process/user can I check to achieve this?

Thanks for any help.
The way as defined by IBM:

/usr/local/bin/db2ls -c

This will give you an output that should be relatively easily parsed by
code. If db2ls is not found, then DB2 9 or later is not installed (or at
least, not installed properly).
Oct 10 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Stephen Boulet | last post: by
10 posts views Thread by eyh5 | last post: by
4 posts views Thread by Denny | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.