Verify the currently installed Db2 version

Use the db2ls command to display the db2level along with the install path and install date:
Install Path       Level   Fix Pack   Special Install Number   Install Date    Installer UID
--------------------------------------------------------------------------------------------
/opt/ibm/db2/V11.5  11.5.4.0        7                    Fri Aug  21 12:25:53 2020 CDT     0

You can also use the db2level and db2licm -l . When issued as the instance owner, these two commands will provide the information necessary to determine the Product, Version and Build level of the instance.

The db2level command provides the instance's name, version and build level as well as its installation location. The following is sample output of the db2level command:

DB21085I  This instance or install (instance name, where applicable: "db2inst1")
uses "64" bits and DB2 code release "SQL11054" with level identifier "0605010F".
Informational tokens are "DB2 v11.5.4.0", "s2006161200", "DYN2006161200AMD64",
and Fix Pack "0".
Product is installed at "/opt/ibm/db2/V11.5".

The above output indicates that the instance “db2inst1” is a 64 bit instance (uses “64” bits) and is a Db2 Version 11.5.4 instance. The version and build level are provided more than once in the output. The first line contains the version and build level in the “Db2 line code release “SQL09075”” section. The version and build level are also listed in the third line in the “Informational tokens “DB2 v11.5.4.0” section. The last part of this line mentions the Fix Pack level by number.

The Product can be determined from the db2licm -l output. Below is a sample of this output.

Product name:                            "Db2 Advanced Edition"
License type:                            "Virtual Processor Core"
Expiry date:                             "Permanent"
Product identifier:                      "db2adv"
Version information:                     "11.5"
Enforcement policy:                      "Hard Stop"
Features:
IBM Db2 Performance Management Offering: "Not Licensed"

The “Product name” field provides the name of the Db2 product installed. Which in this case is “Db2 Advanced Edition”. If the command returns information for more than one product, you can identity the product for the instance by going to the location returned by the db2level command and changing the directory to the cfg directory at the location. You can then check for a file with the same name as the “Product Identifier” field from the db2licm output with a “.lvl” extension. For the above example this file would be called db2ese.lvl and located in the /opt/ibm/db2/V11.5 directory.

In Windows environments an instance belongs to a copy; a complete installation of a Db2 product. In Linux and Unix environments, an instance belongs to a single user. The copy name to use is chosen at the time of installation. The copy name appears as a folder name in the Start menu under the IBM Db2 folder. To ensure that you are checking the information for a specific copy, open a Command Window from the copy in this menu, found under the copy name folder. Once the Command Window is open, confirm that the instance you are interested in is associated with the copy by searching for the name in the list returned by the db2ilist command. If the instance is a part of the copy issue the db2level command. The output returned from the db2level command will be similar to the following:
DB21085I  This instance or install (instance name, where applicable: "DB2")
uses "64" bits and DB2 code release "SQL11057" with level identifier "0608010F".
Informational tokens are "DB2 v11.5.7000.1973", "s2111221000",
"DYN2111221000WIN64", and Fix Pack "0".
Product is installed at "C:\PROGRA~1\IBM\SQLLIB" with DB2 Copy Name "DB2COPY1".

The above output is nearly identical to the output returned from the command in Unix and Linux. The location of the files for the copy is identified by the last line of the output.

Next, issue the db2licm -l command. The output from this command is identical to the output returned in the Unix and Linux environment.

As in the Unix and Linux environment you can confirm what product is installed if more than one product returns from the db2licm -l command, by checking for a file with the same name as the “Product Identifier” field with a “.lvl” extension. In the case of the above example this file would be called db2ese.lvl and located in the C:\PROGRA~1\IBM\SQLLIB\cfg directory.

You can also identify the product by checking the installed programs output from the Control Panel for the copy name.

For more information, see db2ls - List installed Db2 products and features command, db2level - Show Db2 service level command, db2licm - License management tool command, and ../../com.ibm.db2.luw.admin.cmd.doc/doc/r0002059.dita