Walker News

How To Check DB2 Instance Name In Used?

One IBM DB2 server can hosts multiple database manager instances. Each of these database manager instances has its own configuration files, directories, and databases.

Screenshot taken from DB2 v9 – database objects:

The hierarchy of DB2 database objects. What is a DB2 instance?

If there is a need to check or find out which DB2 instance you are working on now, use the db2pd command:
db2pd -inst | head -2

Alternatively, connect to one of the databases and then execute the following SQL code to retrieve current DB2 instance name from ENV_INST_INFO administrative view:
SELECT * FROM SYSIBMADM.ENV_INST_INFO

To retrieve only the instance name, specify the INST_NAME column field instead of “*” for all fields.

To display available columns / fields of SYSIBMADM.ENV_INST_INFO, run this db2 command:
db2 describe table SYSIBMADM.ENV_INST_INFO

With reference to ENV_INST_INFO administrative view, most of the fields are retrieved and shown by db2level command, such as bit size of DB2 instance, Fix Pack number, etc.

Custom Search

2014  •  Privacy Policy