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

Similar Messages

  • ASM install not RAC aware

    SPARC:
    installed 11g clusterware using crs user, oinstall and dba group,
    then install 11g ASM using oracle user, but it does not show RAC option.
    ASM install not RAC aware if not use same user?
    Thanks.

    I'm not sure if you're talking about creating an ASM instance? The ASM software install is the same as the Database install. Oracle recommends running ASM from a separate Home which would require a separate Oracle database install.

  • 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

  • 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.

  • Kill session in RAC

    Hello, I have a RAC environment, and I need to kill a session, I user "alter kill session <SID> , <SERIAL>", but the session still appear in the database, so I tried to kill througn the OS (Unix), but the spid don´t match with the PID of SO.
    Any suggestion?
    clarification: I am connected in the same node, at database (11g R1) and the server.
    Thanks.

    I have been checked all nodes, and the spid of the session don´t appear in none.

  • Is it possible to NOT have 'Restore Previous Session' option come up automatically every time you start Firefox?

    A large envelope pops up mid-screen every time I start Firefox, asking if I want to restore previous session. I don't want all users after me to have this option, but don't want to keep an empty history either. Can I deselect this option somewhere? Looked around, but found nothing.

    Unfortunately changing the options found under "Completely disable session restore" does not make any difference to this problem.

  • 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

  • Keep getting 'Well that's Embarassing" message starting previous session, I do not want to start previous session, I always want new session. Need an option for this.

    Keep getting "Well that's Embarrassing" message starting previous session. I do not want to start previous session. I always want a new session. Need an option to always start a new session.

    Both of the above cited options help ONLY if "sites to be restored" ''are listed''.
    They used to be(when I first switched to Firefox); now they are not(even with the "Oops! This is embarassing..." message from FF where the "Restore Session" option is shown but with nothing IN it, y'see?).
    I've been going through the FAQs &c in the Mozilla Support sites/linx. Lots of interesting things but not quite that for which I search.
    Open to suggestions, I remain, ~=DVexedVixen

  • Kill session in rac on other node

    I need sql that kills all sessions at all nodes
    version ORACLE 10gR2
    what to do?

    You could use the same approach as for enabling restricted session.
    declare
    job binary_integer;
    inst_id number := '&inst_id';
    sid number := '&sid';
    serial number := '&serial';
    begin
    dbms_job.submit (
    job=>job,
    what=> 'begin execute immediate ''alter system kill session ''''' || sid || ',' || serial || '''''; end;',
    instance=>inst_id
    commit;
    end;
    or you can drive it from gv$session by some criteria, e.g.
    for s in (select inst_id, sid, serial# from gv$session whre username = '&bad_user')
    loop
    dbms_job.submit (
    job=>job,
    what=> 'begin execute immediate ''alter system kill session ''''' || i.sid || ',' || i.serial# || '''''; end;',
    instance=>i.inst_id
    end loop;
    ...

  • 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.

  • 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

  • Ora-01940 in the old versione there was the possibility to kill session

    I have tried to drp a user that remain connect.
    I receive the error : ORA-01940.
    I USE DB 10G
    in release 9 the was the possibility (with enterprise manager) to kill all the session of the user.
    In DB 10 where is this function ??
    I have try to foun in the menu but i have not found it ( i cannot shutdown the database because there is a lot of user that are connect)
    Than'ks

    Don't know of OEM, but if you want to kill all user's sessions, then that's very easy from Sql*Plus (as DBA or SYSDBA)
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> get killsess
      1  set pages 0
      2  set feed off
      3  set veri off
      4  accept USR prompt 'Enter Username : '
      5  spool kill_sessions.sql
      6  select 'set feed on' from dual;
      7  select 'alter system kill session '||chr(39)||sid||','||serial#||chr(39)||';'
      8  from v$session
      9  where username = upper('&USR')
    10  /
    11* spool off
    SQL> @killsess
    Enter Username : scott
    set feed on
    alter system kill session '244,1087';
    alter system kill session '253,768';
    SQL> @kill_sessions
    System altered.
    System altered.
    SQL>

  • ALTER SYSTEM KILL SESSION

    Hello Everybody,
    1) Is there any difference between “ALTER SYSTEM KILL SESSION & “kill -9”? Which one is the preferred method?
    2) When we do alter system kill 'sid, serial#'. Are we killing the user process or the server process?
    thanks in advance

    Welcome to the forum!
    Whenever you post provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION)
    >
    Hello Everybody,
    1) Is there any difference between “ALTER SYSTEM KILL SESSION & “kill -9”? Which one is the preferred method?
    2) When we do alter system kill 'sid, serial#'. Are we killing the user process or the server process?
    >
    You should only use the 'kill' from the OS as a last resort.
    There are TWO Oracle options: KILL session and DISCONNECT session. Only rarely, in my experience will DISCONNECT SESSION not get the job done.
    See ALTER SYSTEM in the SQL Language doc
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_2013.htm
    >
    end_session_clauses
    The end_session_clauses give you several ways to end the current session.
    DISCONNECT SESSION Clause
    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). To use this clause, your instance must have the database open. You must identify the session with both of the following values from the V$SESSION view:
    •For integer1, specify the value of the SID column.
    •For integer2, specify the value of the SERIAL# column.
    If system parameters are appropriately configured, then application failover will take effect.
    •The POST_TRANSACTION setting allows ongoing transactions to complete before the session is disconnected. If the session has no ongoing transactions, then this clause has the same effect described for as KILL SESSION.
    •The IMMEDIATE setting disconnects the session and recovers the entire session state immediately, without waiting for ongoing transactions to complete.
    ◦If you also specify POST_TRANSACTION and the session has ongoing transactions, then the IMMEDIATE keyword is ignored.
    ◦If you do not specify POST_TRANSACTION, or you specify POST_TRANSACTION but the session has no ongoing transactions, then this clause has the same effect as described for KILL SESSION IMMEDIATE.
    See Also:
    "Disconnecting a Session: Example"
    KILL SESSION Clause
    The KILL SESSION clause lets you mark a session as terminated, roll back ongoing transactions, release all session locks, and partially recover session resources. To use this clause, your instance must have the database open. Your session and the session to be terminated must be on the same instance unless you specify integer3.You must identify the session with the following values from the V$SESSION view:
    •For integer1, specify the value of the SID column.
    •For integer2, specify the value of the SERIAL# column.
    •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.
    If the session is performing some activity that must be completed, such as waiting for a reply from a remote database or rolling back a transaction, then Oracle Database waits for this activity to complete, marks the session as terminated, and then returns control to you. If the waiting lasts a minute, then Oracle Database marks the session to be terminated and returns control to you with a message that the session is marked to be terminated. The PMON background process then marks the session as terminated when the activity is complete.
    Whether or not the session has an ongoing transaction, Oracle Database does not recover the entire session state until the session user issues a request to the session and receives a message that the session has been terminated.
    See Also:
    "Terminating a Session: Example"
    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 에 대하여(ORA-30)

    제품 : ORACLE SERVER
    작성날짜 : 1997-07-30
    ALTER SYSTEM KILL SESSION 에 대하여
    --- Problem
    사용자는 다음과 같은 상황에서 session 을 kill 하려는 시도를 하게 된다.
    1. os 에는 process 가 존재하지 않지만, v$session 에는 active 로 존재하고
    있을 경우
    2. shadow process 는 살아 있는데, client machine 을 rebooting 한 경우
    3. session 이 걸고 있던 lock 을 release 해야 할 경우
    4. OS 나 Oracle 의 자원을 지나치게 많이 사용하여 성능을 저하시키는
    process
    그런데, alter system kill session ('sid, serial#'); 후에 다음과 같은
    에러가 발생할 경우가 있다.
    ora-00030, 00000, "user session ID does not exist"
    // *Cause:  The user session id no longer exists, probably because the
    // session was logged out.
    // *Action: Use a valid session ID.
    --- 원인과 대책
    kill session을 할 수 없는 이유는 PMON이 이미 이 session을 delete하고 있는
    중이기 때문이다. 즉, PMON 이 dead session 을 clean-up 하고 있는 중에는
    serial number의 값이 증가한다.
    문제는 PMON이 process를 kill하는 시간인데, transaction의 크기에 따라,
    PMON의 rollback 시간이 결정된다. 먼저 PMON은 dead process를 찾아내어,
    이 process가 사용한 resource 를 release하는 시도를 한다.
    PMON은 계속 이 작업을 시도하다가 마침내, free buffer의 부족으로 더 이상
    resource를 free-up 하지 못하게 된다.
    이 때, 이 process를 delete하고 있다는 message를 trace file에 출력하는데,
    이것은 process를 delete하는 데 필요한 resource(data cache 내의 free buffer)
    의 부족으로 위의 작업이 지연되고 있다는 의미이다.
    PMON이 process 를 clean-up 할 때 걸리는 시간은, 5분에서 24 시간까지 소요
    될 수 있다. 문제는 이 process가 hold 하고 있는 lock으로 인해 특정 작업이
    수행되지 못하는 데 있다. MTS 를 사용할 때는 configuration MTS setting,
    sqlnet.expire_time 사용)에 따라 다르지만, clean-up 작업을 하는데 72 시간이
    소요된 경우도 있다.
    아직까지는 PMON이 작업을 마칠 때까지 기다리는 방법 또는 db를 restartup하는
    방법 밖에는 없다.
    --- PMON 의 작업
    PMON은 network failure 나 기타의 원인으로 생긴 old process connection을
    clean-up 하는 역할을 한다. 그런데, PMON 은 clean-up 해야 하는 connection
    중에 정해진 개수 만큼의 transaction 을 rollback 할 수 있는데, 이 값은
    initSID.ora 의 cleanup_rollback_entries(default = 20) 에 의해 결정된다.
    예를 들어, 1000 개의 uncommitted update가 있다면, 일정한 시간마다
    cleanup_rollback_entries 의 개수 만큼의 record 만 rollback 할 수 있으므로
    이 작업 동안에 lock 은 그대로 유지된다.
    PMON 은 위의 작업 이외에 DB maintenance 역할이 있으므로, 위의 rollback 이
    비교적 빠르게 처리되지 못할 수도 있다. 이러한 rollback을 빠르게 처리하기
    위하여 cleanup_rollback_entries 를 늘릴 수도 있다. 그러나, 그 만큼 일정
    시간 동안 PMON 의 작업이 많아지게 되므로, 다른 사용자들의 작업 요청이
    느려지게 되는 trade-off 가 있으므로, 신중히 고려한 후에 수정하는 것이
    바람직하다.
    alter system kill session 에 의해서도 위와 같이 rollback 이 이루어지는데,
    이 session 이 완전히 clean-up 되기 전까지 v$session, v$process에 남아 있게
    된다.
    --- ALTER SYSTEM KILL SESSION 을 하기 전에 ...
    kill session 을 원할 경우는 다음의 순서대로 작업하는 것이 좋다.
    1. kill the user process first
    2. wait for 3 - 4 minutes
    3. query v$session
    4. if any information find in v$session, query v$lock
    like
    select count(*) from v$lock where SID ='sid';
    위의 count(*) 가 0 이 아니라면, 아직 PMON 이 rollback을 끝내지 못한 경우
    이므로 다시 얼마 후에 v$lock 을 조회하여 lock 의 개수가 감소하였는지
    반복적으로 확인한다.
    만약, 이 값이 전혀 변하지 않았다면, ALTER SYSTEM KILL SESSION 을 수행하고
    v$session, v$lock을 query 하여 변화가 있는지 확인하여 변화가 있다면,
    좀 더 기다린다.
    그래도, v$lock 의 count(*) 가 0 이 되지 않을 경우, 마지막으로 수행할 수
    있는 유일한 방법은 instance 를 restartup 하는 것이다.

    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.

  • Stored Procedure killed the root blocker in rac 10g

    Hi every one,
    I need the procedure that killed root blocker in RAC environmental 10g,
    I found the stored procedure for 11g which simple but 10g required some expertise
    because I want to just exec [procedure] it will kill root blocker either locally and remote node
    thanks a lot
    Edited by: user11688837 on Jan 30, 2013 10:08 AM

    I Checked your link as for regarding 11g RAC its find. But for the regarding 10g it will never work on
    remote node you have to used only and only dbms_job.sumbit to kill remote node.
    your kind information please rectify the commend that it will work on local node not on remote node in 10g
    'ALTER SYSTEM KILL SESSION '||a.sid||','||a.serial#||''' IMMEDIATE;' as "10g Command to kill session",
    thankyou
    Edited by: user11688837 on Jan 30, 2013 10:06 AM
    Edited by: user11688837 on Jan 30, 2013 10:26 PM

Maybe you are looking for