Home > dba, sql > commit suicide;

commit suicide;

March 16th, 2009

Tanel Poder directed me to Miladin Modrakovic blog, I will definitely add this to my prefered feed.

You have to try this :


SQL> alter session set events 'immediate crash';
alter session set events 'immediate crash'
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel

A very decent method for killing yourself :twisted:

Bookmark and Share

  1. March 16th, 2009 at 13:05 | #1

    This trick can actually be useful in a case where you want to kill a stuck process, but don’t have OS access (there are unfortunately many shops where DBAs have no access to servers at all).

    You just send the crash event to Oracle using oradebug and assuming that the stuck target processes signal handling isn’t blocked it will crash itself:

    http://blog.tanelpoder.com/2008/06/19/killing-an-oracle-process-from-inside-oracle/

  2. March 16th, 2009 at 15:20 | #2

    or to test how to catch ora-3113 in a package ;)

  3. radino
    March 16th, 2009 at 15:59 | #3

    Nice :)

  4. March 16th, 2009 at 18:38 | #4

    I like it.

    Oracle …set events ‘immediate crash’, that look like “Hard Core”!

    ;)

  5. March 27th, 2009 at 14:41 | #5

    That is nice!

    You can use also event 10237.

    Session 1
    - - - - - - -
    SQL> begin
    2 while 2>1 loop
    3 null;
    4 end loop;
    5 end;
    6 /

    Session 2 (as user SYS or as user who has privilege to execute the package DBMS_SYSTEM.SET_EV)
    ———-
    SQL> exec dbms_system.set_ev(sid,serial#,10237,4,”);
    PL/SQL procedure successfully completed.

    Session 1
    ————-

    ERROR at line 1:
    ORA-01013: user requested cancel of current operation

    The session is not killed, user is still connected -
    SQL> select * from v$version;

    BANNER
    ——————————————————————————–
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit

  6. March 27th, 2009 at 15:22 | #6

    Hey, that’s a piece of gold Grimm!

    Thanks for this!

  7. March 30th, 2009 at 22:34 | #7

    No problem, you are welcome :).

    Quite good site, by the way.

  1. April 22nd, 2009 at 13:25 | #1