使用profile来限制资源使用
-
msdnchina
2011-08-15 22:27:22
-
IT综合
-
原创
alter system set RESOURCE_LIMIT=true; --立即生效
添加一个oracle profile ,idle time 设置为1分钟
新建一个user,赋予connect和resource 权限,此user使用刚刚建立的profile
用此user登录sqlplus,不执行任何的命令,放置在那里即可
select * from v$session where 条件是此用户,主要查看status列,一开始是inactive,后来是sniped
等status状态变为sniped之后,去执行一条sql,就会报提示,
SQL> select * from user_tables where 1=2;
select * from user_tables where 1=2
*
第 1 行出现错误:
ORA-02396: 超出最大空闲时间, 请重新连接
此时select * from v$session where 条件是此用户 ,查询结果为空。[@more@]