Identify Sessions using an Object/ many Objects

Identify Sessions using Objects

set lines 300
col osuser for a12
col USERNAME for a20
col MACHINE for a40
select
sid,
serial#,LOGON_TIME, OSUSER,USERNAME,machine,sql_id
from
(
select
sid,
serial#,LOGON_TIME, OSUSER,USERNAME,machine,sql_id
from
v$session
) y,
(
select
b.session_id
from
(
select
object_id,
session_id,
locked_mode
from
v$locked_object
) b,
(
select
object_id,
object_name,
owner
from
dba_objects
where
object_name in ('SK_INVOCATION')
) c
Where
b.object_id = c.object_id
) x
Where
x.session_id = y.sid ;

-- to kill a session
--- alter system kill session '41,45327';
 

1 comment: