Trace SQL statements in DB2 database

Trace SQL statements in DB2 database
#1-Create event monitor- make sure you’ve got write permissions to stated folder:db2 “CREATE EVENT MONITOR stmon FOR STATEMENTS WRITE TO FILE ‘/tmp'”#2 Turn on event monitor: db2 SET EVENT MONITOR stmon STATE = 1

#3. (Do stuff to the database that you want to monitor)

#4. Turn off event monitor: db2 SET EVENT MONITOR stmon STATE 0

#5. Translate event monitor into readable stuff: db2evmon -path /tmp > /tmp/filtered.out

#6. Read the events: vi /tmp/filtered.out

#7. Delete event monitor:db2 DROP EVENT MONITOR stmon

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s