千家信息网

创建profile时 sessions_per_user的用法:

发表于:2024-10-24 作者:千家信息网编辑
千家信息网最后更新 2024年10月24日,举例 :为xiaoming 创建profile 同时允许两个用户连接进来SYS@ odb>create profile prof_xiaoming limit sessions_per_user 2;
千家信息网最后更新 2024年10月24日创建profile时 sessions_per_user的用法:

举例 :

为xiaoming 创建profile 同时允许两个用户连接进来

SYS@ odb>create profile prof_xiaoming limit sessions_per_user 2;

Profile created.

//用户和profile 绑定起来;

SYS@ odb>alter user xiaoming profile prof_xiaoming;

User altered.

//赋予创建会话的权限

SYS@ odb>grant create session to xiaoming;

随后用该用户登录几个客户端都无报错;疑问:这里限制登录session数量为2 为何终端登录3个4个 还是可以的,没提示报错;

原来是没有启用资源限制


SYS@ odb>alter system set resource_limit=true;

System altered.

在重新以xiaoming用户登录就会提示 超出限制,不能登录;


SYS@ odb>conn xiaoming/xiaoming
ERROR:
ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit


Warning: You are no longer connected to ORACLE.
@ >


0