SQL0440N returned using table function ENV_GET_SYSTEM_RESOURCES
SQL0440N returned using table function ENV_GET_SYSTEM_RESOURCES
https://www.ibm.com/support/pages/sql0440n-returned-using-table-function-envgetsystemresources
Troubleshooting
Problem
It is possible to recieve error SQL0440n on a routine like "ENV_GET_SYSTEM_RESOURCES" when running a query similar to the following: Example: SELECT CPU_ONLINE, CPU_HMT_DEGREE, CPU_USER, CPU_SYSTEM, CPU_IOWAIT, CPU_IDLE, MEMORY_TOTAL, MEMORY_FREE, MEMORY_SWAP_TOTAL, MEMORY_SWAP_FREE, VIRTUAL_MEM_TOTAL, VIRTUAL_MEM_FREE FROM table(SYSPROC.ENV_GET_SYSTEM_RESOURCES()); DB2 Database Error: ERROR [42884] [IBM][DB2/AIX64] SQL0440N No authorized routine named "ENV_GET_SYSTEM_RESOURCES" of type "FUNCTION" having compatible arguments was found.
Cause
The reason for this maybe because of a function missing from the database, due to it having been migrated or upgrade to V9.7 Fixpack 6 or later. The SQL0440n error is a good indication that the table function is missing.
Diagnosing The Problem
To verify in fact the table function is missing run:
db2 "select substr(funcschema,1,12)as funcs, substr(funcname,1,30) as name from syscat.functions where funcname='function name in question' order by 1,2";
Replace 'function name in question' with the function name that received the SQL0440N, in this case it would be ENV_GET_SYSTEM_RESOURCES so it would like this:
db2 "select substr(funcschema,1,12)as funcs, substr(funcname,1,30) as name from syscat.functions where funcname='ENV_GET_SYSTEM_RESOURCES' order by 1,2";
Resolving The Problem
If the query:
db2 "select substr(funcschema,1,12)as funcs, substr(funcname,1,30) as name from syscat.functions where funcname='ENV_GET_SYSTEM_RESOURCES' order by 1,2";
comes back with no records:
FUNCS NAME
------------ ------------------------------
0 record(s) selected.
Then you may need to run:
db2updv97 -d dbname
Where dbname is as at put the name of the database in question.
------------------------------------------------------------------------------------------
如果你觉得文章有用,欢迎打赏
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!