Hi sathyaram,
You are quite right. It is a store procedure. How then can I use it in a script?
Take this script for example:
--call the stored procedure to load up the db config parms into a global temp table called
-- session.db_config
call sysproc.get_db_config();
-- this query shows the percentage of lock list currently being used, and the percentage
-- of maxlocks that this represents.
-- if you are over 100% of maxlocks then any one application may be approaching the maxlocks
-- limit (depending on which applications are the holders of the most locks.
with dbcfg as
( select 1 as row,
float(locklist*4096) as locklist,
float(maxlocks) as maxlocks
from session.db_config
where dbconfig_type = 1
),
dbsnap as
( select 1 as row,
lock_list_in_use,
appls_cur_cons as NumCons
from db2$mon_db
)
select dec((lock_list_in_use/locklist)*100,4,1) as "% Lock List",
dec((lock_list_in_use/(locklist*(maxlocks/100))*100),4,1) as "% to Maxlock",
NumCons as "Number of Cons",
lock_list_in_use/numcons as "Avg Lock Mem Per Con (bytes)"
from dbcfg c, dbsnap s
where c.row = s.row
;
When I try to run this in my linux environment, I am getting the following error
SQL0204N "SESSION.DB_CONFIG" is an undefined name. SQLSTATE=42704.
Have any idea what is wrong here?
Thanks