Home > Uncategorized > Diagnostic events with debugger and crash..

Diagnostic events with debugger and crash..

Got this idea surfing Tanel’s post on Oracle’s dignostic events .He explained some unkown syntax for setting oracle diagnostic events.Full article can be found at:

http://blog.tanelpoder.com/2009/03/03/the-full-power-of-oracles-diagnostic-events-part-1-syntax-for-ksd-debug-event-handling/

It’s a very good post.In addition to this syntax there are  two  more options  for action keyword that I have used in the past.

Let me start with syntax that’s everyone familiar with:

  alter session set events '10046 trace name context forever, level 12';

action keyword or  trace in this case is most used.

Next one in line would be word debugger/debug

Debugger –  invokes system debugger

examples:

SQL> alter session set events ‘immediate debugger ‘;

Session altered.

 

OR   SQL> alter session set events ‘immediate debug';

Session altered.

SQL> alter session set events ‘parse_sql_statement debugger';

Session altered.

SQL> alter session set events ‘10117 debugger';

Session altered.

 

You can use debuger to call  script or command:

vi debug.sh

/bin/echo Hello World! $*

SQL> alter system set”_oradbg_pathname”=’/oracle/admin/test/scripts/debug.sh’;

System altered.

SQL> alter system set events ‘logon debugger’;

System altered.

SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – 64bit Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining options
-sh-3.1$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.3.0 – Production on Mon Mar

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.

Hello World! 13813

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – 64bit Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining options

 

Other word but more fun  is word CRASH .It will crash oracle process for testing , so be carefull.

Do not crash wrong session.

examples:

SQL> alter session set events ‘deadlock crash';

Session altered.

 Crash someone session:

SQL>  oradebug setospid 19779
Oracle pid: 36, Unix process pid: 19779, image:
SQL> oradebug event immediate crash
ORA-00072: process “Unix process pid: 19779, image:  is not active

Crash your own session:

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
Process ID: 13799
Session ID: 107 Serial number: 7376

Crash on event:

SQL> alter session set events ‘<event_name>  crash';

Session altered.

SQL> alter session set events ‘parse_sql_statement crash';

Session altered.

SQL> alter session set events ‘0x23E crash';

Session altered.

 

Happy Crashing :)

About these ads
Categories: Uncategorized
  1. Vlado
    March 9, 2009 at 11:43 pm

    So, what is the purpose of using the debugger action keyword?

  2. March 10, 2009 at 3:28 am

    Here is example:

    You can invoke OS debuger on event or script in this case:

    vi debug.sh

    /bin/echo Hello World! $*

    SQL> alter system set”_oradbg_pathname”=’/oracle/admin/test/scripts/debug.sh';

    System altered.

    SQL> alter system set events ‘logon debugger';

    System altered.

    SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – 64bit Production
    With the Partitioning, Oracle Label Security, OLAP and Data Mining options
    -sh-3.1$ sqlplus / as sysdba

    SQL*Plus: Release 10.2.0.3.0 – Production on Mon Mar 9 23:23:52 2009

    Copyright (c) 1982, 2006, Oracle. All Rights Reserved.

    Hello World! 13813

    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – 64bit Production
    With the Partitioning, Oracle Label Security, OLAP and Data Mining options

    SQL>

  3. March 11, 2009 at 9:06 pm

    Miladin,

    Have you ever work at Oracle Corporation or touch Oracle by some other partner company.

    I really wonder where/how you get/find all these internal things

    I really like all of your stuff. Thank you for sharing hidden side of Oracle.

  4. March 12, 2009 at 1:27 am

    Not at all.I wish I have access :)

    Just hard work.Lot of research and reading ( bugs, other related sites, documenation ).

  5. March 31, 2009 at 7:00 pm

    Hi Miladin

    The debugger stuff doesnt seem to work anymore in 11gR1 though

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 48 other followers

%d bloggers like this: