oracle stop job

Solutions on MaxInterview for oracle stop job by the best coders in the world

showing results for - "oracle stop job"
Emiliano
05 Apr 2016
1-- To simply stop job without killing session:
2BEGIN
3    DBMS_SCHEDULER.STOP_JOB(JOB_NAME => 'scheme.job_name', FORCE => TRUE);
4END;
5-- Killing job's session: first get Job session IDs
6SELECT jr.JOB, s.USERNAME, s.SID, s.SERIAL#, p.SPID, s.LOCKWAIT, s.LOGON_TIME
7FROM DBA_JOBS_RUNNING jr, V$SESSION s, V$PROCESS p
8WHERE jr.SID = s.SID AND s.PADDR = p.ADDR
9ORDER BY jr.JOB;
10-- Kill session with IDs and wait for rollback if any...
11ALTER SYSTEM KILL SESSION 'SID,SERIAL#' IMMEDIATE;