« Oracle Open World Call for Papers | Main | 11.1.0.7 CRS bundle1 released »

High Level Tracing For Monitoring And Debug With Event 10046

Whenever there is an error condition that do not provide enough information to immediately diagnose the root cause and find a solution, tracing the session that is generating the problem is the best first option to get more information.

In many cases I did find on the raw trace the additional information required to get to the root cause of a problem.

This method is good also to generate high level SQL traces to be used for SQL tuning.

This is a short reference for running oradebug with event 10046 that enable SQL statement tracing including binds and waits.

To trace same session:

oradebug setmypid ;

To trace other session first you need to get it's spid:

select a.username,b.spid
from v$session a, v$process b
where a.username like '%&user%'
and a.paddr=b.addr ;

Then from your session, connected as sys, attach to the other session:

oradebug setospid &ospid ;

Then check the tracefile name:

oradebug tracefile_name ;

At this moment you can start tracing, there are many different events that can be used for different purposes, event 10046 is very useful for debugging, level 12 provide information about what are the waits the session is waiting for and also the values of the bind variables :

oradebug event 10046 trace name context forever, level 12 ;

Check the trace as it run:

! tail

To interrupt the trace you can either exit the session or execute this command:

oradebug event 10046 trace name context off ;

More information about oradebug and its many options can be find on this page "Utiliwiki"

TrackBack

TrackBack URL for this entry:
http://blogs.oracle.com/mte1521/mt-tb.cgi/11456

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on April 25, 2009 12:02 AM.

The previous post in this blog was Oracle Open World Call for Papers.

The next post in this blog is 11.1.0.7 CRS bundle1 released.

Many more can be found on the main index page or by looking through the archives.

Top Tags

Powered by
Movable Type and Oracle