1. 首页 > ITPUX技术网 > 正文

oracle profile sessions_per_user的用法

oracle profile sessions_per_user的用法

sessions_per_user的作用是限制每个user能登录的最多会话数,如果没启用资源限制的话,那这个参数
即使设置了也不会生效的:

以下为测试过程:
创建每个用户只允许一个会话的限制
create profile one_session limit sessions_per_user 1;

将这个资源限制赋予给test用户
alter user test profile one_session;

启用资源限制
alter system set resource_limit=true;

测试:
C:\Documents and Settings\paulyi>sqlplus test/test@test
SQL*Plus: Release 9.2.0.1.0 – Production on 星期日 2月 7 12:04:03 2010
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

连接到:
Oracle9i Enterprise Edition Release 9.2.0.1.0 – Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 – Production
SQL>
SQL>

第二个用户登录时就报超过限制的报错了
C:\Documents and Settings\paulyi>sqlplus test/test@test
SQL*Plus: Release 9.2.0.1.0 – Production on 星期日 2月 7 12:04:21 2010
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
ERROR:
ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit

请输入用户名:

设置成功

本文由风哥教程整理发布,仅用于学习测试使用,转载注明出处:http://www.fgedu.net.cn/10327.html

联系我们

在线咨询:点击这里给我发消息

微信号:itpux-com

工作日:9:30-18:30,节假日休息