>pskill PsKill v1.16 - Terminates processes on local or remote systems Copyright (C) 1999-2016 Mark Russinovich Sysinternals - Usage: pskill [-t] [\\computer [-u username [-p password]]] <process ID | name> -t Kill the process and its descendants. -u Specifies optional user name for login to remote computer. -p Specifies optional password for user name. If you omit this you will be prompted to enter a hidden password. -nobanner Do not display the startup banner and copyright message. >pskill -t Sm.Cash.Server.exe
CREATE OR REPLACE PROCEDURE disconnect_idle_sessions
AS
BEGIN
FOR s IN (SELECT s.sid, s.serial# FROM v$session s, supermag.sslocks l WHERE status='INACTIVE' AND prev_exec_start < SYSDATE - INTERVAL '20' MINUTE AND program = 'Sm.Main.exe' and S.SERIAL# = L.SERNUM)
LOOP
BEGIN
EXECUTE IMMEDIATE 'ALTER SYSTEM DISCONNECT SESSION ''' || s.sid || ',' || s.serial# || ''' IMMEDIATE';
EXECUTE IMMEDIATE 'DELETE FROM SUPERMAG.SSLOCKS where sid=' || s.sid || ' and sernum=' || s.serial#;
COMMIT;
exception when others then null;
END;
END LOOP;
END;
/
BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'disconnect_idle_sessions_job',
job_type => 'STORED_PROCEDURE',
job_action => 'disconnect_idle_sessions',
start_date => SYSTIMESTAMP,
repeat_interval => 'FREQ=MINUTELY; INTERVAL=1',
enabled => TRUE);
END;
/
BEGIN
DBMS_SCHEDULER.SET_ATTRIBUTE (
name => 'disconnect_idle_sessions_job',
attribute => 'logging_level',
value => DBMS_SCHEDULER.LOGGING_OFF);
END;
/