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 > Updating dbm cfg parameters from Application Program

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-07-07, 00:47
lekhrajm lekhrajm is offline
Registered User
 
Join Date: Dec 2007
Posts: 8
Updating dbm cfg parameters from Application Program

Hi,
I want to update dbm cfg parameters DFT_MON_BUFPOOL and
DFT_MON_STMT from C program. I am using db2 version 9.1.2 on Linux
platform

When I use
"db2 update dbm cfg using DFT_MON_BUFPOOL ON DFT_MON_STMT ON"
command for this purpose "db2 get dbm cfg show detail" command
reflects changes in both current and delayed values of DFT_MON_BUFPOOL
and DFT_MON_STMT immediately.

I want to do same thing from C application programming

my code for this is given below..

==============================================
sqleatin(node, userid, passwd, &sqlca);
DB2_API_CHECK("Attach to instance");

EXEC SQL CONNECT TO :dbalias USER :userid USING asswd;
EMB_SQL_CHECK("Connecting to database");

EXEC SQL CALL SYSPROC.ADMIN_CMD('UPDATE DBM CFG USING
DFT_MON_BUFPOOL ON DFT_MON_STMT ON IMMEDIATE');
EMB_SQL_CHECK("update dbm cfg");
sqledtin (&sqlca);
DB2_API_CHECK("Detach from instance");
EXEC SQL CONNECT RESET;
==============================================

but "db2 get dbm cfg show detail" command reflects changes only in
delayed values of both parameters not in current values.

I tried to update it by using API "sqlfusys" instead of " EXEC SQL
CALL SYSPROC.ADMIN_CMD('UPDATE DBM CFG USING DFT_MON_BUFPOOL ON
DFT_MON_STMT ON IMMEDIATE')" , but I got same results.

Can someone help me with this?

Regards
Lekh Raj
Reply With Quote
  #2 (permalink)  
Old 12-07-07, 05:19
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Whether or not a change to db or dbm cfg takes effect immediate has nothing to do with the syntax.

Some changes to db cfg require that all connections to the database be gone (database is de-activated state) to take effect immediately.

In the case of the dbm cfg, some changes require that db2 instance be restarted.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #3 (permalink)  
Old 12-07-07, 08:15
lekhrajm lekhrajm is offline
Registered User
 
Join Date: Dec 2007
Posts: 8
thanks Marcus_A for quick reply..
all dbm cfg switches are configurable online configuration parameters and all online parameters should take effect immediately.

http://publib.boulder.ibm.com/infoce...n/t0005243.htm
Reply With Quote
  #4 (permalink)  
Old 12-07-07, 09:30
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Quote:
Originally Posted by lekhrajm
thanks Marcus_A for quick reply..
all dbm cfg switches are configurable online configuration parameters and all online parameters should take effect immediately.

http://publib.boulder.ibm.com/infoce...n/t0005243.htm
I don't know what exact text you are reading, but some db and dbm parameters do not take effect immediately, even though you can change them on-line. One way you will know whether they take effect immediately is to run the "get db/dbm cfg" command with "show detail" option.

There is sometimes more specific information in the "Administration - Performance" reference manual for each parameter as to whether it takes effect immediately without a deactivation of the database (for db parms) or instance restart (dbm parms).
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #5 (permalink)  
Old 12-10-07, 00:13
lekhrajm lekhrajm is offline
Registered User
 
Join Date: Dec 2007
Posts: 8
hi,
If I update dbm cfg parameters DFT_MON_STMT and DFT_MON_BUFPOOL through command line processor, they takes effect immediately without de-activating database or restarting instance. But if I update these params through C program (code is given in my first post) they don't take effect immediately, only delayed values changes.

My doubt is that, Do I really need to restart instance or I am doing something wrong?
Reply With Quote
  #6 (permalink)  
Old 12-10-07, 04:26
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
You might want to look at the MONITOR SWITCHES, which are designed to be turned on and off with immediate effect.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
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