Answers for "oracle stop a job"

SQL
1

oracle stop job

-- To simply stop job without killing session:
BEGIN
    DBMS_SCHEDULER.STOP_JOB(JOB_NAME => 'scheme.job_name', FORCE => TRUE);
END;
-- Killing job's session: first get Job session IDs
SELECT jr.JOB, s.USERNAME, s.SID, s.SERIAL#, p.SPID, s.LOCKWAIT, s.LOGON_TIME
FROM DBA_JOBS_RUNNING jr, V$SESSION s, V$PROCESS p
WHERE jr.SID = s.SID AND s.PADDR = p.ADDR
ORDER BY jr.JOB;
-- Kill session with IDs and wait for rollback if any...
ALTER SYSTEM KILL SESSION 'SID,SERIAL#' IMMEDIATE;
Posted by: Guest on April-21-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language