实施步骤:
1. 更改init参数resource_limit为TRUE;重新启动数据库;
2. 更改用户概要文件profile的“空闲连接时间”;
3. 在数据库中查询session状态是“SNIPE”的,通过操作系统orakill命令清除;
4.定义windows执行计划,执行kill_session_sql.bat脚本。
脚本:
kill_session_sql.bat内容:
set ORACLE_SID=ora9 /**数据库instance SID**/
sqlplus system/oracle@ora9 @c:kill_session.sql
c:kill_session.bat
kill_session.sql内容:
spool c:kill_session.bat
set head off
set feedback off
set pagesize 1000
set term off
COLUMN EVENT FORMAT A30
Select 'orakill ora9 ' || p.spid || '' From v$process p, v$session s Where p.addr = s.paddr and status ='SNIPED' and s.username is not null;
spool of
exit