Search
 
SCRIPT & CODE EXAMPLE
 

SQL

oracle kill job by sid

-- 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;
-- Or simply a session
SELECT SID, SERIAL#, STATUS, SERVER FROM V$SESSION WHERE USERNAME = '<username>';
-- Kill session with IDs and wait for rollback if any...
ALTER SYSTEM KILL SESSION 'SID,SERIAL#' IMMEDIATE;
-- To simply stop job without killing session:
BEGIN
    DBMS_SCHEDULER.STOP_JOB(JOB_NAME => 'scheme.job_name', FORCE => TRUE);
END;
Comment

PREVIOUS NEXT
Code Example
Sql :: mysql get domain from url 
Sql :: oracle export trigger ddl 
Sql :: for loop postgresql 
Sql :: postgres check timezone 
Sql :: load mysql dumb 
Sql :: age postgres 
Sql :: postgresql create table with timestamp 
Sql :: how to check nls timestamp format in oracle 
Sql :: install mysql in amazon linux 2 
Sql :: sql output inserted id 
Sql :: my sql version 
Sql :: sql join exists 
Sql :: how to delete duplicate rows in oracle 
Sql :: change table to innodb mysql 
Sql :: how do you use sql in you company 
Sql :: mysql int range 
Sql :: sql server count all tables rows 
Sql :: show all users in mysql 
Sql :: oracle sequence last_number 
Sql :: Oracle Column Names of a table 
Sql :: get first 3 letter of department name in sql 
Sql :: postgres convert text to number 
Sql :: how to check current user in mysql 
Sql :: how to create an empty table from an existing table 
Sql :: ubuntu install postgresql 12 
Sql :: create a unqie constraint mysql 
Sql :: get two decimal places in sql server 
Sql :: date in where on datetime column clause mysql 
Sql :: mysql jdbc timezone 
Sql :: how to drop a database in sql server when it is in use 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =