
|| ' VALUES (sys_context(''USERENV'', ''BG_JOB_ID''), SYSDATE, USER, l_error) 'ĭBMS_OUTPUT.put_line ('Launched DBMS_JOB #: ' || l_job || ' to kill the session with SID: ' || p_sid || ', Serial#: ' || p_serial || ' on RAC Instance #: ' || p_instance_number || ' (RAC Node: ' || l_instance_name || ').') || ' INSERT INTO dbms_job_errors (job_number, failure_date, username, error_message) ' || ' EXECUTE IMMEDIATE ''ALTER SYSTEM KILL SESSION ''''' , what => 'DECLARE l_error VARCHAR2(4000) ' WHERE instance_number = p_instance_number * We must use DBMS_JOB with the instance parameter in order to kill this session IF p_instance_number = l_this_instance_number THENĮXECUTE IMMEDIATE 'ALTER SYSTEM KILL SESSION ''' || p_sid || ',' || p_serial || '''' ĭBMS_OUTPUT.put_line ('Successfully Killed the session with SID: ' || p_sid || ', Serial#: ' || p_serial || ' on RAC Instance #: ' || p_instance_number || ' (RAC Node: ' || l_this_instance_name || ').') Just issue the ALTER SYSTEM KILL SESSION command. * If they are trying to kill a session on this instance First see if the session really exists.


L_this_instance_name v$instance.instance_name%TYPE L_this_instance_number v$instance.instance_number%TYPE L_instance_name gv$instance.instance_name%TYPE

P_instance_number IN gv$instance.instance_number%TYPE * - */ĬREATE OR REPLACE PROCEDURE SYS.rac_kill_session GRANT SELECT ON dbms_job_errors TO PUBLIC

, CONSTRAINT dbms_job_errors_pk PRIMARY KEY (job_number, failure_date)ĬREATE OR REPLACE PUBLIC SYNONYM dbms_job_errors FOR dbms_job_errors , failure_date DATE DEFAULT SYSDATE NOT NULL Please offer your advice on if it is "evil" or not.ĭROP TABLE dbms_job_errors CASCADE CONSTRAINTS ĬREATE TABLE dbms_job_errors (job_number INTEGER NOT NULL Hopefully it will help other RAC users out there. I believe this code will do what you propose. I saw your recommendation for this - and I ran with it.
