DB2 Top 10 SQL by Number of Executions

How to obtain the top 10 SQL sorted by number of executions on your database?


db2 "SELECT NUM_EXECUTIONS as EXECUTIONS, AVERAGE_EXECUTION_TIME_S as TIME_SECONDS, STMT_TEXT as TEXT FROM SYSIBMADM.TOP_DYNAMIC_SQL WHERE upper(STMT_TEXT) like 'SELECT%' ORDER BY NUM_EXECUTIONS DESC FETCH FIRST 10 ROWS ONLY"

I hope you find it useful!


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Cookies use

This web uses cookies to enhance your user experience, collect anonymous usage statistics and integrate content from third-party services. If you continue browsing you are giving your consent for us to set cookies. More information.

ACEPTAR
Aviso de cookies