How to find all open/active connections in DB2 (8.

2019-02-12 22:49发布

I'm currently working with Db2 Enterprise Server V 8.2 with FixPak 10

And I want to retrieve list of all the open active connections with an instance.

In Oracle there is a utility program called "Top Session" which does the similar task. Is there any equivalent in DB2?

Thanks in advance, Kamal

标签: sql db2
3条回答
2楼-- · 2019-02-12 23:39

CLP:

db2 list applications

QUERY:

SELECT * FROM SYSIBM.APPLICATIONS
SELECT * FROM SYSIBM.SESSION
查看更多
贪生不怕死
3楼-- · 2019-02-12 23:40

The command you seek is:

LIST APPLICATIONS

In the DB2 Command Center there is a tool which list the applications and displays them in a human friendly format as well.

查看更多
甜甜的少女心
4楼-- · 2019-02-12 23:45

To get more detailed information from list applications:

db2 list applications for database {dbName} show detail

For applications with lots of active connections it is useful to pipe the results to grep to find only the threads currently executing or locked.

db2 list applications for database {dbName} show detail | grep -i "executing"

and

db2 list applications for database {dbName} show detail | grep -i "lock"
查看更多
登录 后发表回答