DB2 trace sql - how can I set up a trace to capture all sql statements? Use this process to record all sql statements for a give period of time on DB2. In other words , a DB2 trace #connect to db #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... Read more →