db2_trace_connection - Trace a DB2 connection
db2_trace_connection -dbname <database> [ -user <userid> ] [ -agent <agent id> ] [ -time <wait time> ] [ -repeat ]
db2_trace_connection -dbname FOOBAR db2_trace_connection -dbname FOOBAR -user myuserid db2_trace_connection -dbname FOOBAR -agent 789
The db2_trace_connection script is used to trace a DB2 connection. It runs two application snapshots in close succession, then shows application activity in between the snapshots.
db2_trace_connection
When invoked with only a -dbname parameter, it displays a list of users connected to the database. When the -user parameter is added, it displays a list of database connections for that userid. The application snapshot is only collected when the -agent parameter is specified.
-dbname
-user
-agent
This mandatory option specifies the database name. This must be a database name or alias defined in the local database directory.
If no other options are specified, the script will display a list of connected users.
This option specifies a userid for which connections should be listed. It is ignored in the presence of the -agent option. When -user is specified, the script will display a list of active connections for the application.
-agent option
This option specifies the agent id to be traced.
This option specifies the delay between snapshots in seconds. The default is 5 seconds.
This option causes db2_trace_connection to keep getting snapshots every few seconds and to display the incremental changes.
As it stands, this script only runs locally, i.e. on the database server. If you have SYSMON privilege and can map from database alias to instance name (based on the node directory), you can make it work remotely as well.
Hildo Biersma
DB2::Admin(3)
To install DB2::Admin, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DB2::Admin
CPAN shell
perl -MCPAN -e shell install DB2::Admin
For more information on module installation, please visit the detailed CPAN module installation guide.