如何限制用户session连接数

首页    知识库    常见问题    如何限制用户session连接数

问题原因

客户连接数过多,报错YAS-06004 maximum number of sessions exceeded

 

问题的风险及影响

后续连接业务报错,影响测试和业务使用

 

解决方法及规避方式

1、$YASDB_DATA/log/listener/listener.log,查找历史连接多的用户,关掉相关应用。

2、限制每个用户的session连接数

CREATE PROFILE用于创建一个profile,profile为系统对用户的一组资源限制的集合。

yashandb profile相关能限制的相关资源,总共有十项,如下图:

密码设置6项,session连接两项,ip黑白名单两项。

IMG_256

创建一个profile,通过sessions_per_user限制用户的连接数,默认profile是不限连接数的

drop profile cur_sess_profile;

-- 限制用户连接数为200个。

create profile cur_sess_profilelimit sessions_per_user 200;

 -- 设置mydata用户的profile为cur_sess_profile

alter user mydata profile CUR_SESS_PROFILE;

查看用户所属的profile

IMG_256

该用户超过连接数后,连接报错如下:

IMG_256

3、设置用户连接数可以控制住用户的连接,如果要彻底解决相关问题,还是要调整应用的连接策略。

 

浏览量:0