How to limit the number of application connections in DB2?
I want to limit the number of application connections to 1 in DB2 server. And try connecting with 2 applications to check the behavior?
I want to limit the number of application connections to 1 in DB2 server. And try connecting with 2 applications to check the behavior?
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.
Â
Â