How to view the currently running SQL statements in DB2?
In DB2, you can use the following command to view the SQL statements that are currently running:
- Connect to the DB2 database instance using the command line tool.
- Use the following command to view the SQL statements currently running:
SELECT APPLICATION_HANDLE, STMT_TEXT
FROM SYSIBMADM.APPLICATIONS
WHERE APPL_STATUS = 'UOWEXECUTING';
This SQL statement will return the application handle and statement text of the currently executing SQL statement. You can use the results to view the specific content of the SQL statement.