I'm trying to get a list of SQL statements in the package cache using the follow statement but I'm getting the error below. This works on all of my internal databases and all of my clients except for one. I'm running db2 9.7 FP 3 on AIX. Does anyone have any ideas why this database is giving this error?
From config file
db2 get db cfg for mydb |grep MON|grep METRICS
Request metrics (MON_REQ_METRICS) = BASE
Activity metrics (MON_ACT_METRICS) = BASE
Object metrics (MON_OBJ_METRICS) = BASE
SECTION_TYPE , TOTAL_CPU_TIME , NUM_EXEC_WITH_METRICS,
FROM TABLE(MON_GET_PKG_CACHE_STMT ( NULL, NULL, NULL, -2)) as T
WHERE T.NUM_EXEC_WITH_METRICS <> 0
ORDER BY AVG_CPU_TIME desc
FETCH FIRST 20 ROWS ONLY;
Routine "*CHE_STMT" (specific name "MON_GET_PKG_CACHE_STMT") is implemented with code in library or path "...trusted", function "monGetPkgCacheStmtv97fp6" which cannot be accessed. Reason code: "6".. SQLCODE=-444, SQLSTATE=42724, DRIVER=4.17.30
Problem resolved. We upgraded to Fix Pack 9. The original database was taken from DB2 9.7 FP 7 and restored into a site with FP 3. Upgrading to FP 9 seems to have fixed the problem. Thanks everyone for your replies.