How to Check Db2 Version

How to check DB2 installation in a Linux machine(Ubuntu)

  1. To see all running db2instances.

ps -ef | grep db2sysc


  1. db2ilist

Lists all the instances that are created using the db2icrt command from the same DB2® copy location that you are running the db2ilist command.
https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0002059.html


  1. You can also look for instance footprints. find something like the sqllib directory. Each instance has one.

Get DB2 instance name using SQL

For DB2 LUW you can use ENV_INST_INFO. The instance name is in the column INST_NAME:

SELECT INST_NAME FROM SYSIBMADM.ENV_INST_INFO

How to identify primary key column in DB2 version 7.1

If you are using Db2 for i-Series (formerly AS/400) as suggested by the db2-400 tag you put on the question, check the catalog QSYS2.SYSCST - it has a column CONSTRAINT_TYPE whose value is 'P' for primary key. You may need to join with other catalog objects (exammple QSYS2.SYSTABLES, QSYS2.SYSCOLUMNS) depending on the details of what you seek.

The Knowledge center for Db2 for i series R7.1 is still online.

show all tables in DB2 using the LIST command

To get a list of tables for the current database in DB2 -->

Connect to the database:

db2 connect to DATABASENAME user USER using PASSWORD

Run this query:

db2 LIST TABLES

This is the equivalent of SHOW TABLES in MySQL.

You may need to execute 'set schema myschema' to the correct schema before you run the list tables command. By default upon login your schema is the same as your username - which often won't contain any tables. You can use 'values current schema' to check what schema you're currently set to.

Choosing the correct DB2 drivers to get data acceleration

To access Db2-for-Z/OS from either Excel or C# .net you will need a CLI driver for Db2 with matching bitness.

Depending on how your Db2-for-Z/OS subsystems are licensed you may also need a license-file on the Microsoft-windows workstation, becase IBM supplied CLI drivers are not free for accessing Db2-fo-Z/OS. Speak with your Z-DBA or passport-advantage-coordinator to get the license-file (and the correct version of it to match your version of Db2-for-Z/OS) or to determine if the target subsystem has already db2connectactivate enabled ( meaning no workstation based licenses are required).

IBM and other companies offer CLI drivers for Db2 for various operating systems including Microsoft Windows.

IBM offers different sizes of CLI driver, depening on how much functionality you need.

Any of these should work with IDAA as long as they are "current", and the keywords needed for IDAA exploitation should be common between the IBM supplied CLI drivers.

The smallest footprint, minimal function, zero install CLI driver from IBM is the "ODBC and CLI" driver, which is a zipfile (just unzip and register it per the docs). Get it via this link, and then install it per this documentation. Note that this driver gets frequently updated, as it is used by all CLI/ODBC based tools (perl, python, r, c#, ruby, c++, ...). It's also possible to use wget to download it. google for that.

A larger driver is the "Db2 runtime client", which has more functionality and the clpplus interface. This is available via the IBM Passport Advantage website , or via fix central for latest fixpacks.

The full Db2 client is a large image, and has all functionality that IBM offers for client side use. Get this via the IBM Passport Advantage website, or via fix central for latest fixpacks.



Related Topics



Leave a reply



Submit