SELECT
EXECUTABLE_ID
,NUM_EXECUTIONS
,DEADLOCKS
,last_metrics_update
FROM TABLE(MON_GET_PKG_CACHE_STMT ( NULL, NULL, '<modified_within>30</modified_within>', -2)) as T
WHERE T.NUM_EXEC_WITH_METRICS <> 0 ORDER BY AVG_CPU_TIME
SELECT
EXECUTABLE_ID
,SUBSTR(STMT_TEXT,1,500) as STATEMENT
FROM TABLE(MON_GET_PKG_CACHE_STMT ( NULL, EXECUTABLE_ID, NULL, -2)) as T
WHERE T.NUM_EXEC_WITH_METRICS <> 0 ORDER BY AVG_CPU_TIME