Aryah T
Aryah T

Reputation: 23

Is there a way to check the DB2 sql log for actual SQL operations executed into it?, ie how many rows were fetched etc?

I am using a DB2 v10.5, and I am pushing messages into the database I created using a gateway. Is there a way to check the DB2 sql logs for actual SQL operation executed?, ie how many rows were fetched etc? While googling, I find these logs inside the DB2 server in the DIAGPATH /db2/db2inst1/sqllib/db2dump/ but I don't see any SQL messages in there.

I have been checking DB2 guides as well but any ideas to help me on this is greatly appreciated. Thank you.

Upvotes: 2

Views: 4797

Answers (2)

Paul Vernon
Paul Vernon

Reputation: 3901

There is also the package cache. This holds aggregate metrics for all executions of a statement that are still in the package cache (entries get evicted from the cache as newer statement arrive). MON_GET_PKG_CACHE_STMT

You can also use the Db2 Database Management Console which is

A new browser-based console that helps you administer, monitor, manage and optimize the performance of IBM Db2 for Linux, UNIX and Windows databases.

and which itself collects data via functions such as MON_GET_PKG_CACHE_STMT and Activity Event Monitors

Upvotes: 1

Mark Barinstein
Mark Barinstein

Reputation: 12359

Activity event monitoring

Briefly: It acts like "logger" for executed statements. The information is written to the tables of such an event monitor for sessions with such a "logging" enabled.

Upvotes: 1

Related Questions