創建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.
@ >


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章