#auto kill idle session for 10 mins
0,30 * * * * su - oracle -c /oracle/scripts/kill_idle_10min.sh > /dev/null 2>&1
sqlplus "/ as sysdba" <<EOF
set pagesize 0
spool /oracle/scripts/kill.sql
select 'alter system kill session '''|| SID || ','||SERIAL#|| ''' immediate ;' from v\$session where machine in ('SVRXX','SVRXXX') and status = 'INACTIVE' and TRUNC(MOD (sysdate - logon_time , 1) * 86400) > 600 and LAST_CALL_ET > 600;
spool off
spool /oracle/scripts/kill.log
start /oracle/scripts/kill.sql
spool off
EOF
沒有留言:
張貼留言