<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Events on Café Com Cloud</title><link>https://blog.cafecomcloud.com.br/tags/events/</link><description>Recent content in Events on Café Com Cloud</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Mon, 27 Feb 2017 12:00:06 -0300</lastBuildDate><atom:link href="https://blog.cafecomcloud.com.br/tags/events/index.xml" rel="self" type="application/rss+xml"/><item><title>Using oradebug - 10053 and 10046 events</title><link>https://blog.cafecomcloud.com.br/2017/02/27/using-oradebug-10053-and-10046-events/</link><pubDate>Mon, 27 Feb 2017 12:00:06 -0300</pubDate><guid>https://blog.cafecomcloud.com.br/2017/02/27/using-oradebug-10053-and-10046-events/</guid><description>&lt;p&gt;Hello There! Hope this article finds you well. Today we will talk about oradebug, this little wonder in oracle, and how to set the 10046 and 10053 events to troubleshoot performance.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;First of all, what is oradebug?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Oradebug is a sqlplus tool, intended to oracle support personel only - however, it can be very handy in a bunch of situations. You can use it to set specific troubleshooting events, use to diagnose on which interface your RAC is using for the interconnect messages, use to execute a hanganalyze ( the command, not me, okay? =] ), system state dumps, errorstack dumps and the list goes on.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How do I use it?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;First of all, you need to attach oradebug to a specific session/process.&lt;/p&gt;
&lt;p&gt;Using the ospid:&lt;/p&gt;
&lt;p&gt;Get the os pid for the process, usually with and ps command, or getting the thread in windows environment. With the ospid (in this example 1177)&lt;/p&gt;
&lt;p&gt;oradebug setospid 1177;&lt;/p&gt;
&lt;p&gt;If you try to attach oradebug to an inactive process, you will receive:&lt;/p&gt;
&lt;p&gt;SQL&amp;gt; oradebug setospid 13050; ORA-00072: process &amp;ldquo;13050&amp;rdquo; is not active&lt;/p&gt;
&lt;p&gt;If everything went smoothly, you will receive:&lt;/p&gt;
&lt;p&gt;SQL&amp;gt; oradebug setospid 16792; Oracle pid: 150, Unix process pid: 16792, image: oracle@BLASERVER12&lt;/p&gt;
&lt;p&gt;Using the SID to attach oradebug:&lt;/p&gt;
&lt;p&gt;First of all you need to find out the orapid for the session, running the sql below:&lt;/p&gt;
&lt;p&gt;select p.pid orapid from v$process p, v$session s where s.sid = &amp;amp;SID and p.addr = s.paddr /&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;p&gt;SQL&amp;gt; select p.pid orapid from v$process p, v$session s where s.sid = &amp;amp;SID and p.addr = s.paddr / 2 3 4 5 6 Enter value for sid: 651 old 4: where s.sid = &amp;amp;SID new 4: where s.sid = 651&lt;/p&gt;
&lt;p&gt;ORAPID &amp;mdash;&amp;mdash;&amp;mdash;- 152&lt;/p&gt;
&lt;p&gt;SQL&amp;gt; oradebug setorapid 152; Oracle pid: 152, Unix process pid: 5392, image: oracle@BLASERVER12 (TNS V1-V3)&lt;/p&gt;
&lt;p&gt;You are ready to go!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Setting the 10046 event&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;oradebug event 10046 trace name context forever, level 12;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Setting the 10053 event&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;oradebug event 10053 trace name context forever, level 1;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why this is important?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can use the 10046 to get sql specific informations, such as object, parsing, elapsed time, wait events, bind variables. It is an alternativa for dbms_monitor and dbms_system, another way to generate a sessions trace, and it could be &amp;ldquo;tkprofed&amp;rdquo; as well.&lt;/p&gt;
&lt;p&gt;If you wanna to understand the optimizer&amp;rsquo;s decicions, there is no better way that using a 10053 trace. You will understand the cost estimates, access paths, query block names, peeked binds, optimizer parameters used during the parse.&lt;/p&gt;
&lt;p&gt;In another post I&amp;rsquo;ll give detail about the levels, and why we type &amp;ldquo;name context forever&amp;rdquo;. This is a how to post only =]&lt;/p&gt;
&lt;p&gt;See you around!&lt;/p&gt;</description></item></channel></rss>