Search
 
SCRIPT & CODE EXAMPLE
 

SQL

oracle kill session by sql_id

-- 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 :: sql get domain from url 
Sql :: oracle show trigger code 
Sql :: mysql date format unix timestamp 
Sql :: oracle scan source ddl 
Sql :: host is not allow to connect to this mysql server 
Sql :: set password mysql 
Sql :: hibernate with springboot mysql 
Sql :: oracle nls parameters 
Sql :: oracle sql first day of year 
Sql :: postgresql show owner of database 
Sql :: mysql user permission database 
Sql :: mqtt Error: Address not available 
Sql :: mysql show data from table 
Sql :: install mysql 8 ubuntu 18.04 
Sql :: truncate left characters mysql 
Sql :: mysql mediumint max value 
Sql :: mysql order by desc limit 
Sql :: sqlserver create table from select 
Sql :: oracle current sequence value 
Sql :: How to View column names of a table in SQL 
Sql :: get first n letter of department name in sql 
Sql :: oracle substring 
Sql :: postgresql array last element 
Sql :: how to define a composite primary key in sql 
Sql :: reset identity column values in sql server 
Sql :: mysql Like(searching in the string) 
Sql :: mysql last year 
Sql :: minus vs intersect in sql 
Sql :: sql display number without decimals 
Sql :: MySQL shutdown unexpectedly. 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =