Group Team

This article is used to explain how to kill any session based on the object name.

a. Getting the session id for the Object name

Object type for the object name to be killed can be any one of the following
1.       TYPE
2.       CURSOR
3.       FUNCTION
4.       INDEX
5.       JAVA CLASS
6.       LIBRARY
7.       MULTI-VERSIONED OBJECT
8.       NON-EXISTENT
9.       NONE
10.    PACKAGE
11.    PACKAGE BODY
12.    PROCEDURE
13.    RULE EVALUATION CONTEXT
14.    SEQUENCE
15.    SYNONYM
16.    TABLE
17.    TRIGGER
18.    VIEW

Get the session id based on the object name based on below query

SELECT SID,
              owner,
                              OBJECT,
                              TYPE
  FROM v$access
 WHERE OBJECT = ‘Object Name’

b. Get the serial number for the session based on the session id got from above qyery.

SELECT SID,
             serial#,
                             ownerid,
                             status,
                             server,
                             username,
                             osuser,
                             process,
                             machine
  FROM v$session
 WHERE SID = ‘Session id from above query’

c. Command to kill the session

   ALTER SYSTEM KILL SESSION 'Sid from query2, Serial# from Query 2'

Labels: edit post
2 Responses

  1. Sridevi K Says:

    Regards
    Sridevi Koduru (Senior Oracle Apps Trainer Oracleappstechnical.com)
    LinkedIn profile - https://in.linkedin.com/in/sridevi-koduru-9b876a8b
    Please Contact for One to One Online Training on Oracle Apps Technical, Financials, SCM, SQL, PL/SQL, D2K at training@oracleappstechnical.com | +91 - 9581017828.


Post a Comment