How to limit the number of application connections in DB2?

Asked By 7060 points N/A Posted on -
qa-featured

I want to limit the number of application connections to 1 in DB2 server. And try connecting with 2 applications to check the behavior?

SHARE
Answered By 5 points N/A #82940

How to limit the number of application connections in DB2?

qa-featured

Hi Veronika,

You can achieve it by using DB2 connection parameters MAXAGENTS and MAXAPPLS. MAXAGENTS defines the number of connections allowed in all the database under an instance where MAXAGENTS is set. MAXAPPLS defines the maximum number of connections that are allowed by the database.

To check the value of MAXAGENTS, you can issue the command:

db2 get dbm cfg | grep MAXAGENTS

To change MAXAGENTS parameter value to X:

db2 update dbm cfg using MAXAGENTS X

where X is the desired value to be set.

To check value of MAXAPPLS, issue the command:

db2 connect to <database name>  issue command to connect to target database first then,

db2 get dbm cfg for db <database name> | grep MAXAPPLS

Now you can set connection to 1, issue command:

db2 update dbm cfg for db <database name> using MAXAPPLS 1

 

I hope it helps.

 

 

Related Questions