If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Looking for GET_DB_CFG function

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-04-07, 04:39
pagwu pagwu is offline
Registered User
 
Join Date: Mar 2007
Posts: 70
Looking for GET_DB_CFG function

Hi all,
I am looking to find the GET_DB_CFG function. We are DB2v8.2 fixpack 14 and I looked in the user defined function folder of

db2 control center but it is not there. Should it be somewhere else?

I'll appreciate your help in locating this very important funcion.

Thanks
Reply With Quote
  #2 (permalink)  
Old 12-04-07, 05:02
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
This is a stored procedure and not a function as found in some documentation.
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 12-04-07, 15:28
pagwu pagwu is offline
Registered User
 
Join Date: Mar 2007
Posts: 70
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
Reply With Quote
  #4 (permalink)  
Old 12-05-07, 06:11
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Not sure what your problem is ... A cutdown version of the sql works for me :

Code:
--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
)
select * from dbcfg
;
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On