Kill session not killing.

I have searched the forum and could not find anyone with this problem.
I have many sql tools to get the serial# and session data to kill sessions that have been connected for more than 3-7 days.
I alter system kill session 'sid, serial';
result: system altered.
But when I query again the same "killed" session is still showing. Has anyone had this issue before? Is there such a thing as "zombie" sessions that hit Oracle. Most of theses sessions I am trying to kill are more than 2 weeks old and I assume idle.
We are running 10g (10.1.0.2.0) on Linux AS3.

Hi,
54 ?? Then you you can kill these processes on OS level: kill <spid>
Be sure you do not kill background processes such as below:
SYSTEM@ORACLE10> select c.name, b.spid, a.sid
  2  from v$session a, v$process b, v$bgprocess c
  3  where c.paddr  <> '00'
  4  and c.paddr =  b.addr
  5  and b.addr  =  a.paddr;
NAME  SPID                SID
PMON  3313                280
MMAN  3315                279
DBW0  3317                278
LGWR  3319                277
CKPT  3321                276
SMON  3323                275
RECO  3325                274
CJQ0  3327                273
QMNC  3333                269
MMON  3335                268
MMNL  3337                266Cheers

Similar Messages

  • Alter System Kill Session Not Working

    I'm not certain as to what the problem may be, but the following code does not work in that the session is not being disconnected.
    The attempt is to have this trigger kill a user's logon session if the user is attempting to run a program named 'ex_oc.exe'
    I've tested the code (getting the values back to the table as expected) and it appears to be working but it doesn't execute.
    I've also tried ''ALTER SYSTEM DISCONNECT SESSION'.
    Database is 11g.
    Any ideas?
    Thanks
    CREATE OR REPLACE TRIGGER SYS.DENY_MSB_TRIGGER_UPDATEDD
    AFTER LOGON ON Database
    DECLARE
    v_programname varchar2(64);
    v_logontime date;
    v_process varchar2(24);
    v_machine varchar2(64);
    v_sid number;
    v_serialnum number;
    v_username varchar2(30);
    v_stmt2run VARCHAR2(327);
    cur INTEGER;
    ret INTEGER;
    v_string VARCHAR2(500);
    BEGIN
    SELECT PROGRAM, PROCESS, MACHINE, SID, SERIAL#, USERNAME
    INTO v_programname, v_process, v_machine, v_sid, v_serialnum, v_username
    FROM V$SESSION
    WHERE PROGRAM = LOWER('ex_oc.exe');
    INSERT INTO SAUDIT.DENYMSB (PROGRAM, PROCESS, MACHINE, SID, SERIALNUM, USERNAME)
    VALUES (v_programname, v_process, v_machine, v_sid, v_serialnum, v_username );
    v_string := 'ALTER SYSTEM KILL SESSION' || CHR(39)||v_sid||','||v_serialnum|| CHR(39)||' IMMEDIATE';
    EXECUTE IMMEDIATE v_string;
    END;
    Edited by: user12451703 on Jan 14, 2010 8:57 AM
    Edited by: user12451703 on Jan 14, 2010 8:58 AM

    user12451703 wrote:
    I'm not trying to kill my own session.
    Trigger written by Sys and running it as a generic user.You completely misunderstand triggers. Same as SP/SF trigger is always executed in invoking session on behalf of trigger owner. Below is a slighly modified version of your trigger that does not allow user U1 to connect by killing user U1 session:
    SQL> connect scott as sysdba
    Enter password: *****
    Connected.
    SQL> CREATE OR REPLACE TRIGGER SYS.DENY_MSB_TRIGGER_UPDATEDD
    2 AFTER LOGON ON Database
    3 DECLARE
    4 v_programname varchar2(64);
    5 v_logontime date;
    6 v_process varchar2(24);
    7 v_machine varchar2(64);
    8 v_sid number;
    9 v_serialnum number;
    10 v_username varchar2(30);
    11 v_stmt2run VARCHAR2(327);
    12 cur INTEGER;
    13 ret INTEGER;
    14 v_string VARCHAR2(500);
    15 BEGIN
    16 SELECT PROGRAM, PROCESS, MACHINE, SID, SERIAL#, USERNAME
    17 INTO v_programname, v_process, v_machine, v_sid, v_serialnum, v_username
    18 FROM V$SESSION where username = 'U1';
    19 EXECUTE IMMEDIATE ('ALTER SYSTEM KILL SESSION ''' || v_sid || ',' || v_serialnum || '''');
    20 EXCEPTION
    21 WHEN OTHERS THEN
    22 RAISE_APPLICATION_ERROR(-20001, 'Execution of this program not allowed', TRUE);
    23 END;
    24 /
    Trigger created.
    SQL> create user u1 identified by u1
    2 /
    User created.
    SQL> grant create session to u1
    2 /
    Grant succeeded.
    SQL> connect u1/u1
    ERROR:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-20001: Execution of this program not allowed
    ORA-06512: at line 20
    <font color=red size =2>ORA-00027: cannot kill current session</font>
    Warning: You are no longer connected to ORACLE.
    SQL>
    Also, user not that keen to change the name of the exe.Is cex_soc.exe client side executable? If so what prevents user from renaming it?
    SY.

  • Regarding kill session

    Hello Everybody,
    I am new to Oracle. I have few questions regarding session kill.
    1)Does “killed” session consume any system resources like RAM, CPU?
    2)Whether one should kill the process rather than the session?
    3) Does ALTER SYSTEM KILL SESSION command kill both user session and server process?
    With Regards.

    1)Does “killed” session consume any system resources like RAM, CPU? Killed Status In v$Session Indicates PMON is too busy to clean up.
    You could refer to
    http://www.oracle-base.com/articles/misc/KillingOracleSessions.php
    2)Whether one should kill the process rather than the session?Refer to
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:4974573906087
    3) Does ALTER SYSTEM KILL SESSION command kill both user session and server process?session is not a process, a process is not a session.
    please refer to Tom Link.

  • BI7.x sessions did not killed

    Hi,
    We are facing the issue on the number of sessions that are generated in R/3 when a user is active on the portal. If I watch my user is transaction SM04, I see many sessions are being created and when logging of, users dont get closed. This is happening only If I execute the report 7.x template.
    I found many notes but no result.Can you please help .
    - Lisa

    Hi Lisa,
    I do not have a solution to this issue.
    But I observed an interesting thing while opening 3-4 web templates.
    As you said, on closing a web template the session still can be seen in SM04 for the user. However, I saw that the memory consumed (last column - Megabyte in SM04) reduced from 4 to 1.
    Secondly, if I opened a new web template, it did not create a new session, but used the existing one (which remained after closure of the previous template) and increased the memory utilized for that session from 1 to 4 MB.
    So I guess that though SAP does not kill these sessions immediately (maybe it does after a certain period of time), it does try to optimize the resource (memory) utilization.
    Hope this helps!
    Regards,
    Saurabh

  • Kill Session option is not rac aware?

    Connected to a RAC db, tried to kill session but SD kept complaining that session doesn't exist. It seems it shows sessions from gv$session but while issuing kill, it assumes session on local node.
    Would it not be possible to enhance the kill to use 'rac-aware' command ? alter system kill session 'sid,serial#@inst_id' ?

    Connected to a RAC db, tried to kill session but SD kept complaining that session doesn't exist. It seems it shows sessions from gv$session but while issuing kill, it assumes session on local node.
    Would it not be possible to enhance the kill to use 'rac-aware' command ? alter system kill session 'sid,serial#@inst_id' ?
    I can't address the Sql Dev specifics but the 'kill' statement itself is NOT rac-aware in versions prior to 11.1 (you did NOT provide your DB  version.
    And for 11.1 and later you have to provide the instance id for the third parameter.
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_2013.htm
      For the optional integer3, specify the ID of the instance where the target session to be killed exists. You can find the instance ID by querying the GV$ tables.
    I suggest you edit your post and provide more info so someone from the sql dev team can respond to how sql dev issues that particular statement. Depending on your sql dev version the actual sql issued would be shown in the log window if you have it open.
    1. full DB version - that 3rd parameter is NOT supported for versions prior to 11.1
    2. full Sql version

  • SAPSYS user session  in CLNT 000 not killed

    Hi all!
    I have question.
    When i check in SM04 i have like 50+ user sessions where the user is SAPSYS in clnt 000 the session type is Plugin HTTP. As terminal info there's a IP-number.
    I don't no if its relevant but I'm running an internal ITS. I also run a locally installed IPC (on my laptop since it is a test system).
    My question is why are the sessions not closed down when i log out.
    I understand that the system is creating the sessions.
    Hope you can help me understand!
    //Roland

    Hi Disha!
    We have had memory bottleneck problems and we have applied note 742048 (extending em/global_memory_mb), still this didn't solve the problems with the internal sessions not closing.
    Regards,
    Roland

  • Killed sessions

    Hi,
    I kill a session with the commands:
    select username, sid, serial#, status from v$session where username like 'RION%'
    alter system kill session 'sid, serial#'
    and if I give again the first select command at the status column appears KILLED. I want not to have KILLED in the status column.
    Thank you,
    Mihaela

    hi all,
    As u know you are seeing the status of at v$session view as killed, I wanna confirm that this will exists in two senario.
    When a Session is in inactive state and a kill command on that session is issued then the "status" column of v$session will be updated as killed as to indicate/mark as it is killed, and the "server " column will be updated as psuedo. when the user again try to connect to the session user will receive 0ra-00028 error and the entry will be removed from v$session.
    Another senario is that the transaction is at its half way, either in commiting or at the roleback stage for that partucular session then also you can find that the v$table is updated as above.
    more information, go through the documentation, at the Server Process handling section.
    i hope it cleared your confussion,

  • Kill Session in Oracle 10g

    Oracle 10g r2
    I killed a session after fetching the sid and serial from the v$session as under
    select * from v$session where username='SAM';
    alter system kill session '530,7420'
    Now the status showed killed.
    But again after some time one i query the v$session the status turn to inactive.
    Why so?

    Yeah Madrid....
    Thanks for that.. at the developer side.. they did get session killed.
    But actually my doubt here was. that once i killed the session then i go the status as "killed" in the v$session
    but less then a minute when i again query the v$session then i see the status aa inactive. This is what is not clear to me.

  • Unable to Kill Session

    Good day all
    in my db i found the one session hang my table .but when i try to kill it i receive the following message 'session marked as kill'
    when i run
    SELECT SID, SERIAL#, STATUS
    FROM V$SESSION
    i found its status is kill but it still make my table busy.
    how can i kill it
    note : im use oracle 10g under Linux

    Then it might be that something else is blocking your session or the os process. Also this is not a PL/SQL or SQL question. One of the DBAs in the Database - General forum might give you a better answer.

  • Kill session permission without alter system permission?

    Syntax to kill session is
    ALTER SYSTEM KILL SESSION 'session info';
    Is there a way to allow a user to kill his/her own session without granting rights to SYSTEM? I don't want anyone to be able to drop the database, but they need to be able to kill their own session. I've looked everywhere...
    Thanks in advance!

    Yes, assuming you are using standard definer's rights stored procedures. Only if you specify AUTHID CURRENT_USER when creating the stored procedure will you get an invoker's rights stored procedure, which would run with the privileges of the caller, not of the definer.
    Justin

  • To kill session in one schema from another schema

    Hi Team,
    I got a problem like a table from one of my schema has been locked. I am getting 'ORA-00054: resource busy and acquire with NOWAIT specified' error when trying to delete rows from that table or even when trying to truncate that table.
    Let the table be 'T1' present in schema 'VIEW'
    I tried to kill the session which is active for that schema by below query
    select sid,serial#,status from v$session where username='VIEW' and STATUS = 'ACTIVE';
    alter system kill session '681,2586';
    But i couldn't do the above as i don't have DBA privilege for that. But i have DBA privilege for another schema let it be 'ADMIN'
    Now how can i kill the session in schema 'VIEW' from schema 'ADMIN'
    can any one get me solution.
    Thanks in Advance
    11081985

    I got a problem like a table from one of my schema has been locked. I am getting 'ORA-00054: resource busy and acquire with NOWAIT specified' error when trying to delete rows from that table or even when trying to truncate that table.
    Before you do anything why don't you actually find out WHY that table has been locked.
    You generally should NOT be killing sessions without knowing what is causing the problem to begin with.
    Then you also need to determine if you should use KILL SESSION or instead use DISCONNECT SESSION and well as whether the use of IMMEDIATE is appropriate.
    Each of those choices acts differently. Many people use KILL when they should really use DISCONNECT.
    See DISCONNECT SESSION Clause and KILL SESSION Clause in the ALTER SESSION chapter of the SQL Language doc
    http://docs.oracle.com/cd/E11882_01/server.112/e17118/statements_2014.htm#i2282145

  • Regarding Alter System Kill Session

    Hi Guys,
    I have to do db refresh from the build .For this I have to kill the sessions and drop the users and recreate the users with the latest build.As the application is running and there are some idle sessions, I have to kill the sessions and drop the users for that I am using a code as below
    DECLARE
    v_alt_stmt VARCHAR2(1000) := 'ALTER SYSTEM KILL SESSION ''';
    v_kill_stmt VARCHAR2(1000);
    CURSOR cur_session IS
    SELECT s.type type,
    s.sid sid,
    s.serial# srl_no,
    s.username user_name,
    s.PROGRAM prog_name
    FROM v$session s JOIN gv$process p ON p.addr = s.paddr and s.type='USER';
    BEGIN
    EXECUTE IMMEDIATE 'ALTER SYSTEM ENABLE RESTRICTED SESSION';
    DBMS_OUTPUT.PUT_LINE('The Session has been put in the restricted mode');
    FOR v_cur_ssn IN cur_session
    LOOP
    BEGIN
    v_kill_stmt := v_alt_stmt || v_cur_ssn.sid || ',' || v_cur_ssn.srl_no || '''';
    DBMS_OUTPUT.PUT_LINE(v_kill_stmt);
    EXECUTE IMMEDIATE v_kill_stmt;
    EXCEPTION
    WHEN others THEN
    -- DBMS_OUTPUT.PUT_LINE('The current sessions sid is ' || v_cur_ssn.sid || ' and the srl no is ' || v_cur_ssn.srl_no || ' can not be killed');
    END;
    END LOOP;
    EXECUTE IMMEDIATE 'ALTER SYSTEM DISABLE RESTRICTED SESSION';
    DBMS_OUTPUT.PUT_LINE('The restricted mode of the system has been removed');
    END;
    But sometimes after killing the sessions there are some os processes are going on,to avoid that I have to use 'ALTER SYSTEM DISCONNECT SESSION ''' and 'MMEDIATE' it is workig fine .
    Can Any one tell me the logical difference between kill sessions and disconnect
    Any information will be highly appreciated.
    Thanks in advance
    Prafulla

    >
    Can Any one tell me the logical difference between kill sessions and disconnect
    >
    Disconnect can be used to disconnect immediately without waiting for any ongoing transactions to complete and recovers all session resousrces.
    Kill rolls back ongoing transactions and partially recovers session resources.
    Kill is simiilar to SHUTDOWN IMMEDIATE while disconnect is more like SHUTDOWN ABORT.
    See DISCONNECT SESSION Clause in the SQL Language doc
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_2013.htm
    >
    Use the DISCONNECT SESSION clause to disconnect the current session by destroying the dedicated server process (or virtual circuit if the connection was made by way of a Shared Sever).
    •The IMMEDIATE setting disconnects the session and recovers the entire session state immediately, without waiting for ongoing transactions to complete.
    >
    And KILL SESSION in the same doc next section
    >
    The KILL SESSION clause lets you mark a session as terminated, roll back ongoing transactions, release all session locks, and partially recover session resources.
    IMMEDIATE Specify IMMEDIATE to instruct Oracle Database to roll back ongoing transactions, release all session locks, recover the entire session state, and return control to you immediately.

  • Alter system kill session always gives ORA-00030

    Hello
    Im writing a tool for oracle and one of its features requires killing user session (Im connecting with JDBC). The database Im testing on is 11.2.0.2.
    I find the sid and the serial# without problems, than I issue the "alter system kill session 'x,y' immediate" command.
    So far so good, but I always get an ORA-00030 error saying this session cannot be found.
    I double check and the session does exist in the database.
    Because I want the tool to make the kill, killing via the OS is not an option.
    Its doesn't look like a permission problem because it gives the same error even when connected as system.
    Whats wrong ? does this kill command work at all ? Whats its limitations ?
    Thanks
    Guy Shilo
    Edited by: user13266377 on Jun 9, 2011 1:15 AM

    user13266377 wrote:
    Hello
    Im writing a tool for oracle and one of its features requires killing user session (Im connecting with JDBC). The database Im testing on is 11.2.0.2.
    I find the sid and the serial# without problems, than I issue the "alter system kill session 'x,y' immediate" command.
    So far so good, but I always get an ORA-00030 error saying this session cannot be found.
    I double check and the session does exist in the database.
    Because I want the tool to make the kill, killing via the OS is not an option.
    Its doesn't look like a permission problem because it gives the same error even when connected as system.
    Whats wrong ? does this kill command work at all ? Whats its limitations ?
    Thanks
    Guy Shilo
    Edited by: user13266377 on Jun 9, 2011 1:15 AMyou cannot kill the session already killed or disconnected from the session.
    refer the link:- this may help you to write scripts to kill session using dbms_scheduler
    Grant restricted and kill sessions.

  • Alter system kill session in RAC

    Hi,
    After identifying all inactive jdbc sessions or blocking sessions from gv$session or gv$lock respectively, should alter system kill session executed in both instances of RAC?, Can't we execute like alter system kill session ' inst_id,sid,serial#' from a single instance to kill all the session of RAC instances?
    So, above problem answered in 11g as:
    Alter system kill session ‘SID, serial#, @instance_id’;
    Eg: ALTER SYSTEM KILL SESSION ‘115,9779,@1';
    So, In our environment, most of the databases are in 10gR1 or 10g R2. Is there any patch for 10g Where instance_id can be recognized by alter system kill session?
    Thanks,
    Sunil.

    Hi Dan,
    Not sure what you mean by "instance specific kill session capability".
    To be clear, I'm speaking of a new feature, introduced in 11gR1, that provides for an optional third parameter to 'alter system kill session', which allows you to kill a session on a remote instance, in a RAC environment.
    Documentation is here:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_2013.htm#i2065117
    -Mark

  • Trace File Created Upon Execution of "alter system kill session sid, serial# immediate;"

    A problem within a third-party application is causing it to create and abandon Oracle sessions. At times three hundred or more abandoned sessions accumulated in the instance. The software company is working on the problem. Oracle's background processes will get rid of those sessions after several hours, but at times there were so many they caused the server to start using paging space. We wrote a SQL*Plus script to identify the abandoned sessions and kill them with command "alter system kill session <sid, serial#> immediate;". We automated the execution of the script a week ago. Today I noticed that in my udump directory an Oracle trace file has been created each time our script kills a session. A single trace file is created regardless of how many sessions are killed. No errors appear in the trace file.
    Is the creation of these trace files an indication that problems have occurred or are they there for information only?
    Since I know how and why the sessions are being killed, is it safe to ignore the trace files?
    Thank you,
    Bill

    The OS is AIX 5.2. The database server is 10.2.0.2. We are in the processing of upgrading to AIX 7.1 and database server 11.2.0.3.6.
    The script does not enable tracing for the SQL*Plus session.
    Below is the alert log message from a session killed at 11:22, and the corresponding trace file created at that same time:
    From alert_<sid>.log: 
    Wed Jul 31 11:22:01 2013
    Immediate Kill Session#: 1119, Serial#: 59885
    Immediate Kill Session: sess: 70000014dc4a7e0 OS pid: 267254
    /u02/admin/EXPRESS/udump $ ls -l express_ora_113358.trc
    -rw-r----- 1 oracle dba 2276 Jul 31 11:22 express_ora_113358.trc
    /u02/admin/EXPRESS/udump $ pg express_ora_113358.trc
    Dump file /u02/admin/EXPRESS/udump/express_ora_113358.trc
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    ORACLE_HOME = /u01/app/oracle/product/10.2.0
    System name: AIX
    Node name: navis
    Release: 2
    Version: 5
    Machine: 0005CD8C4C00
    Instance name: EXPRESS
    Redo thread mounted by this instance: 1
    Oracle process number: 225
    Unix process pid: 113358, image: oracleEXPRESS@navis
    *** ACTION NAME:() 2013-07-31 11:22:01.181
    *** MODULE NAME:(SQL*Plus) 2013-07-31 11:22:01.181
    *** SERVICE NAME:(EXPRESS.WORLD) 2013-07-31 11:22:01.181
    *** SESSION ID:(1723.61000) 2013-07-31 11:22:01.181
    SO: 70000014d44d278, type: 2, owner: 0, flag: INIT/-/-/0x00
    (process) Oracle pid=463, calls cur/top: 0/700000139166298, flag: (0) -
    int error: 0, call error: 0, sess error: 0, txn error 0
    (post info) last post received: 108 0 4
    last post received-location: kslpsr
    last process to post me: 70000014d36c398 1 6
    last post sent: 0 0 24
    last post sent-location: ksasnd
    last process posted by me: 70000014d36c398 1 6
    (latch info) wait_event=0 bits=0
    Process Group: DEFAULT, pseudo proc: 70000014d6aec00
    O/S info: user: oracle, term: UNKNOWN, ospid: 267254
    OSD pid info: Unix process pid: 267254, image: oracleEXPRESS@navis
    Short stack dump:
    ksdxfstk+002c<-ksdxcb+04e4<-sspuser+0074<-00004CB0<-nttrd+0120<-nsprecv+0750<-ns
    rdr+0114<-nsdo+1714<-nsbrecv+0040<-nioqrc+04a8<-opikndf2+0688<-opitsk+088c<-opii
    no+0990<-opiodr+0adc<-opidrv+0474<-sou2o+0090<-opimai_real+01bc<-main+0098<-__st
    art+0090
    Dump of memory from 0x070000014D2CC3B0 to 0x070000014D2CC5B8
    70000014D2CC3B0 00000004 00000000 07000001 39DA8D48 [............9..H]
    70000014D2CC3C0 00000010 0003139D 07000001 39166298 [............9.b.]
    70000014D2CC3D0 00000003 0003139D 07000001 4C73D508 [............Ls..]
    70000014D2CC3E0 0000000B 0003139D 07000001 4DC4A7E0 [............M...]
    70000014D2CC3F0 00000004 00031291 00000000 00000000 [................]
    70000014D2CC400 00000000 00000000 00000000 00000000 [................]
    Repeat 26 times
    70000014D2CC5B0 00000000 00000000 [........]
    Thanks,
    Bill

Maybe you are looking for

  • Opening a new Project, getting blank screen

    When I start a new project, give it a name etc. I get the menu bar at the top and a black and blank screen (no Timeline or anything else).  I have resorted to opening past projects and cleaning them out to begin another.  What am I doing wrong?  I am

  • Error during check of component BP_EEW view ContactRelEL in WCF_CC T.code

    In CRM 7.0 EhP1, Perform Check showed error in UI Configuration that: "Context Node Attribute does not exist: STRUCT.ZZFIELD in Object type: BP_ACCOUNT, Subobject type: ZZI5TEEWCONTACT Role Config Key: <DEFAULT>, Component Usage: <DEFAULT>". Please h

  • CNTL_SYSTEM_ERROR in webservices from r/3 system

    Can anyone help .... I am trying to consume a WebService generated in the R/3 system. I am working on WebDynPro Adobe forms. Calling this WebService on click of the button on this form. The WebService calls an RFC internally which inserts data into t

  • Convergence 2 patch 1 login_copyright

    I have an open case in regards to Convergence 2 patch 1 customizations not working for me right now. While i'm waiting for that to be looked at, i'm wondering if the login_copyright message can be removed on the Convergence 2 login screen. With Conve

  • Settup DNS in Windows Azure

    Has anyone setup DNS in windows Azure? I am thinking abut moving over to the Azure and i am not seeing anything about settup DNS. CAn some direct me to any documentation