How To
Summary
By default, a Db2 database activates implicitly by an incoming database connection, and deactivates implicitly if all the database connections gone away.
However, unexpected deactivate database can cause poor performance in later database requests.
So, it's important to activate a database explicitly by ACTIVATE DATABASE command from performance point of view.
Objective
This note guides you on how to check whether a database is acitvated explicitly or implicitly.
Environment
Db2 V10.5 or later.
Steps
There are two methods to check whether given database is activated explicitly.
- Check DB_ACTIVATION_STATE in MON_GET_DATABASE table function
- Connect to the database
db2 connect to <database_name>
- Query MON_GET_DATABASE. DB_ACTIVATION_STATE=NONE means the database is activated implicitly, and EXPLICIT means the database is activated explicitly.
db2 "select DB_CONN_TIME, DB_ACTIVATION_STATE from table(mon_get_database(-1)) as t" DB_CONN_TIME DB_ACTIVATION_STATE -------------------------- ------------------- 2021-09-14-08.20.46.000000 NONE
- Connect to the database
- Check START: DATABASE entries in db2diag.log
Run the db2diag command as follows, ACTIVATED: NO means the database is activated implicitly, and ACTIVATED: YES means the database is activated explicitly.
NOTE: The following example prints last 7 days in the db2diag.log.db2diag -gi db=<database_name>,funcname:=sqeLocalDatabase -H 7d
Related Information
Document Location
Worldwide
[{"Type":"MASTER","Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"ARM Category":[{"code":"a8m500000008PkgAAE","label":"Database Objects"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"10.5.0;11.1.0;11.5.0"}]
Was this topic helpful?
Document Information
Modified date:
11 September 2022
UID
ibm16502945