举例 :
为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.
@ >