IBM Support

Weekly Tips from DB2 Experts: Determine what DB2 products are installed on your system

Technical Blog Post


Abstract

Weekly Tips from DB2 Experts: Determine what DB2 products are installed on your system

Body

 

Here is a simple DB2 command which will display the DB2 products that are installed on the system:
db2ls - it displays the Install path, product level, fix pack details, Special Install Number, Installation date , Installer UID. The db2ls command is the only method to list all DB2 product at Version 9 or later. However you cannot use the db2ls command on Windows operating systems.


$ db2ls
Install Path                           Level        Fix Pack   Special Install Number   Install Date                                   Installer UID
-------------------------------------------------------------------------------------------------------------------------------------------------------
/opt/ibm/db2/V10.5            10.5.0.2         2                                                   Tue Feb  4 16:15:21 2014 CST            0
/opt/ibm/db2/V10.1            10.1.0.3         3                                                   Wed Feb  5 12:47:19 2014 CST          0
/opt/ibm/db2/V9.7                9.7.0.9         9                                                   Thu Feb  6 16:13:38 2014 CST            0
/opt/ibm/db2/V9.5                9.5.0.4         4                                                   Wed Sep 24 18:20:49 2014 CDT         0

Installer UID = 0 tell us its a root installation

For non-root user, the Installer UID is the UID of the non-root user ID.
[nruser@xx-xxxx ~]$ db2ls
 
Install Path                          Level          Fix Pack   Special Install Number   Install Date                                   Installer UID
---------------------------------------------------------------------------------------------------------------------------------------------------------
/home/nruser/sqllib           10.1.0.2          2                                                   Mon Oct 27 15:25:14 2014 CDT          528

Where Installer UID 528 is the UID of user nruser.

For programming purpose use the -c option which displays the output as colon-separated tokens.

$ db2ls -c
#PATH:VRMF:FIXPACK:SPECIAL:INSTALLTIME:INSTALLERUID
/opt/ibm/db2/V10.5:10.5.0.2:2 ::Tue Feb  4 16:15:21 2014 CST :0
/opt/ibm/db2/V10.1:10.1.0.3:3 ::Wed Feb  5 12:47:19 2014 CST :0
/opt/ibm/db2/V9.7:9.7.0.9:9 ::Thu Feb  6 16:13:38 2014 CST :0
/opt/ibm/db2/V9.5:9.5.0.4:4 ::Wed Sep 24 18:20:49 2014 CDT :0

The -b option along with the -q path option displays all the products and features in the given path.
[db2v101@ts-sbadiger ~]$ db2ls -q -b /opt/ibm/db2/V10.5

Install Path : /opt/ibm/db2/V10.5

Feature Response File ID                                    Level     Fix Pack   Feature Description
---------------------------------------------------------------------------------------------------------------------
BASE_CLIENT                                                     10.5.0.2          2     Base client support
JAVA_SUPPORT                                                 10.5.0.2          2     Java support
SQL_PROCEDURES                                         10.5.0.2          2     SQL procedures
BASE_DB2_ENGINE                                           10.5.0.2          2     Base server support
CONNECT_SUPPORT                                       10.5.0.2          2     Connect support
DB2_DATA_SOURCE_SUPPORT                     10.5.0.2          2     DB2 data source support
SPATIAL_EXTENDER_SERVER_SUPPORT    10.5.0.2          2     Spatial Extender server support
JDK                                                                      10.5.0.2          2   IBM Software Development Kit (SDK) for Java(TM)
LDAP_EXPLOITATION                                        10.5.0.2          2   DB2 LDAP support
INSTANCE_SETUP_SUPPORT                         10.5.0.2          2   DB2 Instance Setup wizard
ACS                                                                     10.5.0.2          2   Integrated Flash Copy Support
SPATIAL_EXTENDER_CLIENT_SUPPORT      10.5.0.2          2   Spatial Extender client
COMMUNICATION_SUPPORT_TCPIP              10.5.0.2          2   Communication support - TCP/IP
APPLICATION_DEVELOPMENT_TOOLS         10.5.0.2          2   Base application development tools
DB2_UPDATE_SERVICE                                   10.5.0.2          2   DB2 Update Service
REPL_CLIENT                                                    10.5.0.2          2   Replication tools
DB2_SAMPLE_DATABASE                                10.5.0.2          2   Sample database source
TEXT_SEARCH                                                  10.5.0.2          2   DB2 Text Search
INFORMIX_DATA_SOURCE_SUPPORT          10.5.0.2          2   Informix data source support
ORACLE_DATA_SOURCE_SUPPORT            10.5.0.2          2   Oracle data source support
FIRST_STEPS                                                    10.5.0.2          2   First Steps
GUARDIUM_INST_MNGR_CLIENT                    10.5.0.2          2   Guardium Installation Manager Client

The -p option along with the -q and -b option displays the product type in the given path.
[db2v101@ts-sbadiger ~]$ db2ls -p -q -b /opt/ibm/db2/V10.5

Install Path : /opt/ibm/db2/V10.5

Product Response File ID                       Level        Fix Pack        Product Description
---------------------------------------------------------------------------------------------------------------------
DB2_SERVER_EDITION                      10.5.0.2          2                DB2 Server Edition

Use the -a option to display the hidden features which are not displayed with the other options.
For example
[sbadiger@ts-sbadiger ~]$ db2ls -q -a -b /opt/ibm/db2/V10.5

Install Path : /opt/ibm/db2/V10.5

Feature Response File ID                                     Level   Fix Pack   Feature Description
---------------------------------------------------------------------------------------------------------------------
BASE_CLIENT_R                                                10.5.0.2          2   Base Client Support for installation with root privileges
DB2_PRODUCT_MESSAGES_EN                    10.5.0.2          2   Product Messages - English
BASE_CLIENT                                                     10.5.0.2          2   Base client support
JAVA_RUNTIME_SUPPORT                               10.5.0.2          2   Java Runtime Support
DB2_JAVA_HELP_EN                                         10.5.0.2          2   Java Help (HTML) - English
BASE_DB2_ENGINE_R                                      10.5.0.2          2   Base server support for installation with root privileges
GSK                                                                      10.5.0.2          2   Global Secure ToolKit
JAVA_SUPPORT                                                  10.5.0.2          2   Java support
SQL_PROCEDURES                                          10.5.0.2          2   SQL procedures
ICU_SUP                                                               10.5.0.2          2   ICU Utilities
JAVA_COMMON_FILES                                       10.5.0.2          2   Java Common files
BASE_DB2_ENGINE                                           10.5.0.2          2   Base server support
DB2_CONTROL_CENTER_HELP_EN              10.5.0.2          2   Control Center Help (HTML) - English
CONNECT_SUPPORT                                       10.5.0.2          2   Connect support
RELATIONAL_WRAPPERS_COMMON             10.5.0.2          2   Relational wrappers common
DB2_DATA_SOURCE_SUPPORT                     10.5.0.2          2   DB2 data source support
SPATIAL_EXTENDER_SERVER_SUPPORT    10.5.0.2          2   Spatial Extender server support
JDK                                                                      10.5.0.2          2   IBM Software Development Kit (SDK) for Java(TM)
LDAP_EXPLOITATION                                        10.5.0.2          2   DB2 LDAP support
INSTANCE_SETUP_SUPPORT                         10.5.0.2          2   DB2 Instance Setup wizard
ACS                                                                     10.5.0.2          2   Integrated Flash Copy Support
SPATIAL_EXTENDER_CLIENT_SUPPORT      10.5.0.2          2   Spatial Extender client
COMMUNICATION_SUPPORT_TCPIP              10.5.0.2          2   Communication support - TCP/IP
APPLICATION_DEVELOPMENT_TOOLS          10.5.0.2          2   Base application development tools
DB2_UPDATE_SERVICE                                   10.5.0.2          2   DB2 Update Service
DATABASE_PARTITIONING_SUPPORT           10.5.0.2          2   Parallel Extension
EDB                                                                     10.5.0.2          2   EnterpriseDB code
REPL_CLIENT                                                    10.5.0.2          2   Replication tools
DB2_SAMPLE_DATABASE                                10.5.0.2          2   Sample database source
ITLM                                                                     10.5.0.2          2   itlm
TEXT_SEARCH                                                  10.5.0.2          2   DB2 Text Search
CLPPLUS                                                            10.5.0.2          2   Command Line Processor Plus
INFORMIX_DATA_SOURCE_SUPPORT           10.5.0.2          2   Informix data source support
ORACLE_DATA_SOURCE_SUPPORT             10.5.0.2          2   Oracle data source support
FIRST_STEPS                                                    10.5.0.2          2   First Steps
ESE_PRODUCT_SIGNATURE                           10.5.0.2          2   Product Signature for DB2 Server Edition
GUARDIUM_INST_MNGR_CLIENT                     10.5.0.2          2   Guardium Installation Manager Client

If user has access permission to the path of non-root install then -q -b options displays the product in that directory.
$ db2ls -p -q -b /home/nruser/sqllib

Install Path : /home/nruser/sqllib

Product Response File ID                               Level   Fix Pack   Product Description
---------------------------------------------------------------------------------------------------------------------
ENTERPRISE_SERVER_EDITION               10.1.0.2          2   DB2 Enterprise Server Edition

Thanks for reading!  Please feel free to post your comments/feedback.

 

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

UID

ibm11141294