database 获取 ORA-02391:SESSIONS_PER_USER 限制

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32525642/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 07:58:59  来源:igfitidea点击:

Getting ORA-02391: SESSIONS_PER_USER limit

databaseoracle

提问by user2665166

Is there a query which I can use to grab the amount of sessions I can use concurrently? I am threading some database connections and getting the error:

是否有一个查询可以用来获取我可以同时使用的会话数量?我正在处理一些数据库连接并收到错误:

ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit

ORA-02391: 超出同时 SESSIONS_PER_USER 限制

How can I get the value for this limit?

如何获得此限制的值?

回答by Husqvik

It's profile setting

这是个人资料设置

SELECT * FROM DBA_PROFILES WHERE RESOURCE_NAME = 'SESSIONS_PER_USER';

You can change it using

您可以使用更改它

ALTER PROFILE <profile name> LIMIT SESSIONS_PER_USER <number>;

or

或者

ALTER PROFILE <profile name> LIMIT SESSIONS_PER_USER UNLIMITED;

回答by kevinsky

start with this query to find out how many sessions you are using

从这个查询开始,找出你正在使用的会话数

select count(*) from v$session where username='YourUser';

then find out how many you are allowed in the profile for your user

然后找出您的用户的个人资料中允许的数量

select profile from dba_users where username ='YourUser';

finally

最后

select PROFILE, LIMIT
from dba_profiles
WHERE RESOURCE_NAME = 'SESSIONS_PER_USER'
AND PROFILE = 'YourUserProfile';

and the fix

和修复

Alter profile YourUserProfile  limit SESSIONS_PER_USER 100;

Limits are in place for a reason as each session consumes resources. If you increase the limit some careful planning is in order for production systems so you don't run out of memory.

由于每个会话消耗资源,因此存在限制。如果你增加限制,一些仔细的计划是为了生产系统,所以你不会用完内存。

回答by thatjeffsmith

Get the PROFILE for that user

获取该用户的个人资料

select profile from dba_users where username = :who;

Then get the resource limit for that profile

然后获取该配置文件的资源限制

SELECT P1.LIMIT AS "Concurrent Sessions (Per User)"
FROM   DBA_PROFILES P1
WHERE  P1.PROFILE       = :PROFILE
   AND P1.RESOURCE_NAME = 'SESSIONS_PER_USER';

Or

或者

In SQL Developer, open the DBA panel and browse the users & profiles under 'security'

在 SQL Developer 中,打开 DBA 面板并浏览“安全”下的用户和配置文件

browsing users and profiles in SQL Developer

browsing users and profiles in SQL Developer