<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Doug's Oracle Blog (Entries tagged as ASH)</title>
    <link>http://oracledoug.com/serendipity/</link>
    <description></description>
    <dc:language>en</dc:language>
    <admin:errorReportsTo rdf:resource="mailto:doug@oracledoug.com" />
    <generator>Serendipity 1.5.2 - http://www.s9y.org/</generator>
    <managingEditor>Doug Burns</managingEditor>
<webMaster>Doug Burns</webMaster>
<pubDate>Mon, 04 Oct 2010 12:25:31 GMT</pubDate>

    <image>
        <url>http://oracledoug.com/serendipity/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Doug's Oracle Blog - </title>
        <link>http://oracledoug.com/serendipity/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Network Events in ASH</title>
    <link>http://oracledoug.com/serendipity/index.php?/archives/1614-Network-Events-in-ASH.html</link>
    
    <comments>http://oracledoug.com/serendipity/index.php?/archives/1614-Network-Events-in-ASH.html#comments</comments>
    <wfw:comment>http://oracledoug.com/serendipity/wfwcomment.php?cid=1614</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://oracledoug.com/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=1614</wfw:commentRss>
    

    <author>dougburns@yahoo.com (Doug Burns)</author>
    <content:encoded>
    &lt;em&gt;Note - using ASH and the Top Activity screen require the use of the Diagnostics Pack License.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;This post was prompted by yet another performance problem identified using 
pretty pictures and Active Session History data. Although, as you&#039;ll see, some 
pretty old-fashioned tools played their part too!&lt;br /&gt;&lt;br /&gt;ASH entries only exist for certain SQL*Net events. As usual, I think the 
design is very successful as long as you have a basic understanding of how ASH 
works.&lt;br /&gt;&lt;br /&gt;The events all fall into one of three wait classes - Application, Network 
and Idle. &lt;br /&gt;&lt;br /&gt; 
&lt;pre&gt;SQL&amp;gt; select wait_class, name from v$event_name where name like &#039;SQL*Net%&#039; order by 1, 2;

WAIT_CLASS&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; NAME
-------------------- ----------------------------------------
Application&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQL*Net break/reset to client
Application&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQL*Net break/reset to dblink
Idle&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQL*Net message from client
Idle&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQL*Net vector message from client
Idle&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQL*Net vector message from dblink
Network&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQL*Net message from dblink
Network&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQL*Net message to client
Network&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQL*Net message to dblink
Network&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQL*Net more data from client
Network&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQL*Net more data from dblink
Network&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQL*Net more data to client
Network&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQL*Net more data to dblink
Network&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQL*Net vector data from client
Network&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQL*Net vector data from dblink
Network&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQL*Net vector data to client
Network&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SQL*Net vector data to dblink

16 rows selected.
&lt;/pre&gt;&lt;br /&gt;Hopefully that immediately dismisses the suggestion I&#039;ve heard a few times that ASH/Top Activity ignores SQL*Net events. However, there &lt;em&gt;are&lt;/em&gt; some events that are classed as Idle here that will not be captured in ASH data and will therefore not appear in the Top Activity screen. (In fact, even if you were to set the _ash_sample_all parameter you would not see these events in the Top Activity screen, even though ASH would contain entries for them. There is an additional filter applied to the data before it&#039;s displayed. In any case, I would *not* recommend setting _ash_sample_all except for fun.)&lt;br /&gt;&lt;br /&gt;The most contentious of these is probably 
SQL*Net message from client. This event indicates that the Oracle server is 
waiting for the client to&amp;#160; do something. If the client is a user session, Oracle 
is waiting for the user to do something - perhaps someone has a sql*plus session open that they&#039;re doing nothing with or they are filling in an application screen with data? From an Oracle perspective that session 
is Idle and there isn&#039;t much we can do to tune it, including the waits would heavily skew the data we&#039;re using for our analysis and, because events in the Idle 
class are specifically excluded from both ASH data and the OEM performance 
pages,&amp;#160; such activity won&#039;t appear. That seems sensible to me.&lt;br /&gt;&lt;br /&gt;However, if the client is actually an application server, 
those supposedly idle events can tell us something about end-to-end system 
performance. &lt;a href=&quot;http://oracledoug.com/serendipity/index.php?/archives/893-Another-10046-Success.html&quot;&gt;This blog post&lt;/a&gt; describes one real life situation where that event 
helped me identify the performance problem.&lt;br /&gt;&lt;br /&gt;Back to the problem at hand. Sadly, in the midst of a a very chaotic work situation, I didn&#039;t manage to grab any of the graphs in question but we had a persistent problem with our critical batch processes spending time waiting on &#039;SQL*Net more data from client&#039;, which showed up very clearly as network class waits. &lt;br /&gt;&lt;br /&gt;Now there are a number of reasons why this might be happening. Just a couple off the top of my head&lt;br /&gt;&lt;br /&gt;1) There is a performance problem with the application server so Oracle is expecting more data to arrive more quickly than the app server can deliver it.&lt;br /&gt;&lt;br /&gt;2) A network problem is affecting the delivery speed.&lt;br /&gt;&lt;br /&gt;Although the issue here turned out to be number 2, I suppose the true underlying issue is that this application is insanely &#039;chatty&#039; and uses very frequent round trips to deliver data. Maybe the application design could be improved first?&lt;br /&gt;&lt;br /&gt;Ultimately we enabled Extended Tracing on the relevant sessions and confirmed that, yes, the sessions were spending most of their time waiting for the next batch of data and also how long these waits were. In practise, I&#039;m not sure how much value the trace files added in this particular case. In fact, I think this is an excellent example of the underlying beauty of the sampling approach. As an event became *slower* it appeared *more often* in the samples and we had plenty of examples of how long some of the waits were. (But only some - probably the longest ones.)&lt;br /&gt;&lt;br /&gt;How did we solve this mysterious problem? With two very useful tools&lt;br /&gt;&lt;br /&gt;- ping/tracert. I simply went on to the app server, pinged the db server and confirmed that the response time (from my memory) was in the range of 70-80 milliseconds - far higher than I would expect. One of the Java developers then ran a trace route to the server which highlighted that network performance was great until we hit the db server. It turned out that one of the network interface cards had auto-negotiated down to 100M/s and this was the root cause - easily fixed. Sometimes old-fashioned and simple tools are all that you need, once you know where you should focus your attention (and ASH is great at focussing attention in the right place).&lt;br /&gt;&lt;br /&gt;- The next tool is one of the reasons I wanted to write this post. What made me try ping? Whilst I would have got there eventually, I thought I would try my performance optimisation secret weapon! One just for the database wizards! Something I&#039;ve been keeping an eye on is Oracle Support&#039;s attempt to give people a methodical approach to solving performance issues via the Oracle Performance Diagnostic Guide on My Oracle Support - Note ID 390374.1. There are several guides on that landing page but here is the link to the &lt;a href=&quot;https://support.oracle.com/CSP/main/article?cmd=show&amp;amp;type=ATT&amp;amp;id=390374.1:OPDG_SD_pdf&quot;&gt;Slow Performance PDF&lt;/a&gt;. (You&#039;ll need an account to be able to access this.) This is an example of the kind of advice there. (Note that this is for SQL*Net message from client, but you would tend to get most events together anyway and there&#039;s similar advice for more data from client.)&lt;br /&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;
&lt;blockquote&gt;&lt;em&gt;&amp;quot;Cause Identified: Slow network limiting the response time between client and database.&lt;/em&gt;&lt;br /&gt;&lt;em&gt;The network is saturated and this is limiting the ability of the client and database to communicate with each other.&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Cause Justification&lt;/em&gt;&lt;br /&gt;&lt;em&gt;TKProf:&lt;/em&gt;&lt;br /&gt;&lt;em&gt;1. SQL*Net message from client waits are a large part of the overall time (see the overall summary&lt;/em&gt;&lt;br /&gt;&lt;em&gt;section)&lt;/em&gt;&lt;br /&gt;&lt;em&gt;2. Array operations are used. This is seen when there are more than 5 rows per execution on average (divide total rows by total execution calls for both recursive and non-recursive calls)&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;3. The average time for a ping is about equal to twice the average time for a SQL*Net message from client wait and this time is more than a few milliseconds. This indicates that most of the client time is spent in the network.&lt;/strong&gt;&amp;quot;&lt;/em&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;I&#039;ve been loathe to mention this document until now because it looks like a work in progress (albeit not updated since the start of 2009), isn&#039;t perfect, has gaps and I can imagine a number of my peers taking issue with some of the content. But for something to aid learning if you&#039;re not naturally great at solving performance problems, I can think of much worse starting places. &lt;br /&gt;&lt;br /&gt;In the end, what could have been a really tricky performance problem (and might have taken a while to notice) was apparent with a brief glance at OEM and we could then follow up by applying the right analysis tools to the problem.&lt;br /&gt;&lt;br /&gt;To finish off, when I searched Google for any examples of &#039;SQL*Net more data from client&#039;, one of the first results that cropped up was &lt;a href=&quot;http://www.oreillynet.com/pub/a/network/excerpt/optimizing_oracle_chap12/&quot;&gt;a chapter from one of my favourite books&lt;/a&gt; - &#039;Optimising Oracle Performance&#039; by Cary Millsap and Jeff Holt. Well worth a read ....&lt;br /&gt; 
    </content:encoded>

    <pubDate>Sun, 03 Oct 2010 13:51:17 +0100</pubDate>
    <guid isPermaLink="false">http://oracledoug.com/serendipity/index.php?/archives/1614-guid.html</guid>
    <category>ash</category>
<category>awr</category>
<category>grid control</category>
<category>time matters</category>

</item>
<item>
    <title>Alternative Pictures Demo</title>
    <link>http://oracledoug.com/serendipity/index.php?/archives/1613-Alternative-Pictures-Demo.html</link>
    
    <comments>http://oracledoug.com/serendipity/index.php?/archives/1613-Alternative-Pictures-Demo.html#comments</comments>
    <wfw:comment>http://oracledoug.com/serendipity/wfwcomment.php?cid=1613</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://oracledoug.com/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=1613</wfw:commentRss>
    

    <author>dougburns@yahoo.com (Doug Burns)</author>
    <content:encoded>
    &lt;em&gt;Note - features in this post require the Diagnostics Pack license&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Not long after I&#039;d finished &lt;a href=&quot;http://oracledoug.com/serendipity/index.php?/archives/1612-That-Pictures-demo-in-full.html&quot;&gt;the last post&lt;/a&gt;, I realised I could reinforce the points I was making with a quick post showing another one of the example tests supplied with Swingbench - the Calling Circle (CC) application. Like the Sales Order Entry application, CC is a mixed read/write test consisting of small transactions. As always, there&#039;s more information at &lt;a href=&quot;http://dominicgiles.com/swingbench.html&quot;&gt;Dominic&#039;s website&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;One of the main differences to the SOE test is that the CC test consumes data so you need to generate a new set of data before each test using the supplied ccwizard utility. I won&#039;t show you the entire workflow here but enough to give you a flavour of the process. The utility is the same one used to create the necessary CC schema in the first place but the option I&#039;m looking for here is &amp;quot;Generate Data for Benchmark Run&amp;quot;.&lt;br /&gt;&lt;br /&gt;&lt;!-- s9ymdb:314 --&gt;&lt;img height=&quot;403&quot; width=&quot;594&quot; class=&quot;serendipity_image_center&quot; src=&quot;http://oracledoug.com/serendipity/uploads/190910_1.png&quot; alt=&quot;&quot;  /&gt;&lt;br /&gt;&lt;br /&gt;I&#039;d already decided that my CC schema is populated with data for 1 million customers when I created it so I just need to specify the number of transactions the next test will be for. I happen to know that on my particular configuration, a 1000 transaction test will take around 5 minutes to run.&lt;br /&gt;&lt;br /&gt;&lt;!-- s9ymdb:315 --&gt;&lt;img height=&quot;402&quot; width=&quot;595&quot; src=&quot;http://oracledoug.com/serendipity/uploads/190910_2.png&quot; class=&quot;serendipity_image_center&quot; alt=&quot;&quot;  /&gt;&lt;br /&gt;&lt;br /&gt;I ran the test twice. I&#039;ve highlighted the first run here in the Top Activity page.&lt;br /&gt;&lt;br /&gt;&lt;!-- s9ymdb:316 --&gt;&lt;img height=&quot;350&quot; width=&quot;640&quot; src=&quot;http://oracledoug.com/serendipity/uploads/190910_3.png&quot; class=&quot;serendipity_image_center&quot; alt=&quot;&quot;  /&gt;&lt;br /&gt;&lt;br /&gt;It should be clear that CC suffers significant log file sync waits on my particular test platform, just like the SOE test. Therefore I&#039;ll regenerate the test data set, enable asynchronous commits and re-run the test. Here I&#039;ve highlighted the second test run.&lt;br /&gt;&lt;br /&gt;&lt;!-- s9ymdb:317 --&gt;&lt;img height=&quot;350&quot; width=&quot;640&quot; src=&quot;http://oracledoug.com/serendipity/uploads/190910_4.png&quot; class=&quot;serendipity_image_center&quot; alt=&quot;&quot;  /&gt;&lt;br /&gt;&lt;br /&gt;As well as seeing a similar change in the activity profile according to the ASH samples (the log file sync activity has disappeared as has the LGWR System I/O), there&#039;s a significant difference to the SOE test. Because this test run is based on a specific workload volume, as defined by the size of the test data, rather than a fixed time period, the second test run completed more quickly than the first run. The activity only fills the 5 minute activity bar partially, rather than the first test which filled the whole bar.&lt;br /&gt;&lt;br /&gt;If you test a specific and limited workload volume it is much clearer from the Top Activity page which test is processing transactions more quickly, based on the Time axis. That&#039;s why I didn&#039;t pick this example the first time - it&#039;s too obvious what&#039;s going on!&lt;br /&gt; 
    </content:encoded>

    <pubDate>Sun, 19 Sep 2010 20:39:34 +0100</pubDate>
    <guid isPermaLink="false">http://oracledoug.com/serendipity/index.php?/archives/1613-guid.html</guid>
    <category>ash</category>
<category>awr</category>
<category>grid control</category>
<category>swingbench</category>
<category>time matters</category>

</item>
<item>
    <title>That Pictures demo in full</title>
    <link>http://oracledoug.com/serendipity/index.php?/archives/1612-That-Pictures-demo-in-full.html</link>
    
    <comments>http://oracledoug.com/serendipity/index.php?/archives/1612-That-Pictures-demo-in-full.html#comments</comments>
    <wfw:comment>http://oracledoug.com/serendipity/wfwcomment.php?cid=1612</wfw:comment>

    <slash:comments>6</slash:comments>
    <wfw:commentRss>http://oracledoug.com/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=1612</wfw:commentRss>
    

    <author>dougburns@yahoo.com (Doug Burns)</author>
    <content:encoded>
    &lt;em&gt;Note - features in this post require the Diagnostics Pack license&lt;br /&gt;&lt;br /&gt;&lt;/em&gt;With so many potential technical posts in my pile, it was initially difficult to decide where to start again but I figured I should avoid the stats series until I&#039;m back into the swing of things &lt;img src=&quot;http://oracledoug.com/serendipity/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; Instead I decided to fulfill a commitment I made to myself (and others, whether they knew about it or not) almost three months ago.&lt;br /&gt;&lt;br /&gt;When I gave &lt;a href=&quot;http://oracledoug.com/serendipity/index.php?/archives/1607-A-Good-Weekend.html&quot;&gt;the evening demo session in the Amis offices&lt;/a&gt; I think the 2 hours went pretty well but, as usual with the OEM presentations, I got a little carried away and didn&#039;t conclude the demo properly. (This is also the demo I *would* have done at Hotsos last year if the damn thing had worked first time &lt;img src=&quot;http://oracledoug.com/serendipity/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;) It was a shame because as well as showing the neat and useful side of OEM Performance Pages, it also illustrates one of the common pitfalls in interpreting what the graphs are showing you.&lt;br /&gt;&lt;br /&gt;I began by running a 4 concurrent user Sales Order Entry (SOE) test using &lt;a href=&quot;http://dominicgiles.com/swingbench.html&quot;&gt;Dominic Giles&#039; Swingbench utility&lt;/a&gt;. I won&#039;t got into the details of the SOE test because I don&#039;t think it&#039;s particularly relevant here but you can always download and/or read about Swingbench for yourself at Dominics website.&lt;br /&gt;&lt;br /&gt;I ran the test for a fixed period of 5 minutes using no think-time delay.&lt;br /&gt;&lt;br /&gt;&lt;!-- s9ymdb:303 --&gt;&lt;!-- s9ymdb:307 --&gt;&lt;img height=&quot;425&quot; width=&quot;250&quot; class=&quot;serendipity_image_center&quot; src=&quot;http://oracledoug.com/serendipity/uploads/pic_demo8.png&quot; alt=&quot;&quot;  /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Using the capability to look at ASH data in the recent past, the OEM Top Activity page looks like this.&lt;br /&gt;&lt;br /&gt;&lt;!-- s9ymdb:308 --&gt;&lt;img height=&quot;640&quot; width=&quot;640&quot; class=&quot;serendipity_image_center&quot; src=&quot;http://oracledoug.com/serendipity/uploads/pic_demo9.png&quot; alt=&quot;&quot;  /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;- There was a fairly consistent average of 4-5 active sessions over the 5 minutes period and, looking at the Top Sessions panel in the bottom right of the screen, these were four SOE sessions of similar activity levels and the LGWR process. &lt;br /&gt;&lt;br /&gt;- The majority of time was spent on User I/O, System I/O and Commit Wait Class activity, with a little CPU.&lt;br /&gt;&lt;br /&gt;- Three PL/SQL blocks were responsible for most of the Commit activity.&lt;br /&gt;&lt;br /&gt;- The LGWR process was responsible for most of the System I/O activity.&lt;br /&gt;&lt;br /&gt;I&#039;ll leave it there for now and won&#039;t drill down into any more detail. &lt;br /&gt;&lt;br /&gt;In terms of optimising the performance of this test, what might I consider doing? &lt;br /&gt;&lt;br /&gt;The most important aspect is to optimise the application to reduce the resource consumption to the minimum required to achieve our objectives. There&#039;s a whole bunch of User I/O activity that could perhaps be eliminated? But I&#039;m going to ask you to accept the big assumption here that this application has been optimised and that I&#039;m just using a Swingbench test as an illustration of the type of system-wide problem you could see. In that case, my eye is drawn to the Commit activity.&lt;br /&gt;&lt;br /&gt;When I&#039;m teaching this stuff, I&#039;m usually deliberately simplistic (at least at the end of the process) and highlight that what I&#039;m interested in &#039;tuning&#039; is whatever most sessions are waiting on according to the ASH samples this screen uses. I used to explain how I&#039;d look for the biggest areas of colour, drill down into those and identify what&#039;s going on. Sadly, I later heard that someone (I think it was JB at Oracle*) had already come up with a nifty acronym for this - COBS. Click on the Big Stuff! One day I will come up with a nifty acronym for something too, but you shouldn&#039;t hold your breath waiting.&lt;br /&gt;&lt;br /&gt;So, if I click on the big stuff here, I can see that the Commit Class waits are log file sync. &lt;br /&gt;&lt;br /&gt;&lt;!-- s9ymdb:309 --&gt;&lt;img height=&quot;640&quot; width=&quot;640&quot; class=&quot;serendipity_image_center&quot; src=&quot;http://oracledoug.com/serendipity/uploads/pic_demo10.png&quot; alt=&quot;&quot;  /&gt;&lt;br /&gt;&lt;br /&gt;How might I reduce the time that sessions are waiting for log file sync? Here are a few reasons why the test sessions might be waiting on log file sync more often or for longer than I&#039;d like. &lt;br /&gt;&lt;br /&gt;- Application design - committing too frequently&lt;br /&gt;- CPU starvation&lt;br /&gt;- Slow I/O to online redo log files&lt;br /&gt;&lt;br /&gt;Whether waits are predominantly the result of CPU overload or slow I/O can be determined by looking at the underlying log file parallel write wait times on the LGWR process but that&#039;s a bigger subject for another time.&lt;br /&gt;&lt;br /&gt;You can look into all of these in more depth - and should - but as this is designed to be a fun demo of the pretty pictures (it used to be &#039;the USB stick demo&#039;), I&#039;ll simply try to eliminate that activity and re-run the same test. Here&#039;s how Top Activity looks now.&lt;br /&gt;&lt;br /&gt;&lt;!-- s9ymdb:310 --&gt;&lt;img height=&quot;640&quot; width=&quot;640&quot; src=&quot;http://oracledoug.com/serendipity/uploads/pic_demo11.png&quot; class=&quot;serendipity_image_center&quot; alt=&quot;&quot;  /&gt;&lt;br /&gt;&lt;br /&gt;Oh. Maybe that wasn&#039;t what you expected? OK, the LGWR activity has disappeared, but it seems the system is almost as busy as it was before but that the main bottleneck is now User I/O activity. That&#039;s often the way, though - you eliminate one bottleneck in a system and it just shows up somewhere else. It must be good to get rid of log file sync waits though, right? User I/O seems like more productive work and I&#039;ve managed to make the LGWR activity disappear completely. &lt;br /&gt;&lt;br /&gt;But then if you were to look at this graph in terms of &lt;a href=&quot;http://www.oracle.com/technetwork/database/features/manageability/diag-techniques-presentation-ow07-128491.pdf&quot;&gt;Average Active Sessions or DB Time&lt;/a&gt; or (as it&#039;s more likely to be expressed) how big that spike looks, the two tests would look similarly busy from a system-wide perspective. They were but the real question is - busy doing *what*? There&#039;s some important information missing here and Swingbench is able to provide it. &lt;br /&gt;&lt;br /&gt;&lt;!-- s9ymdb:311 --&gt;&lt;img height=&quot;273&quot; width=&quot;413&quot; class=&quot;serendipity_image_center&quot; src=&quot;http://oracledoug.com/serendipity/uploads/pic_demo12.png&quot; alt=&quot;&quot;  /&gt;&lt;br /&gt;&lt;br /&gt;TotalCompletedTransactions 22,868&lt;br /&gt;&lt;br /&gt;Mmmm, so I wonder what that value was for the first run?&lt;br /&gt;&lt;br /&gt;&lt;!-- s9ymdb:312 --&gt;&lt;img height=&quot;274&quot; width=&quot;410&quot; class=&quot;serendipity_image_center&quot; src=&quot;http://oracledoug.com/serendipity/uploads/pic_demo13.png&quot; alt=&quot;&quot;  /&gt;&lt;br /&gt;&lt;br /&gt;TotalCompletedTransactions 12,232&lt;br /&gt;&lt;br /&gt;Woo-hoo! *That&#039;s* what I call tuning a benchmark - processing almost twice the number of transactions in the same 5 minute period.&lt;br /&gt;&lt;br /&gt;So it turns out that the sessions in the database *were* just as busy during the second run (not too surprising seeing as the test has no user think time so keeps hammering the database with as many requests as it can handle) but that they were busy doing the more productive work of reading and processing data rather than just waiting for COMMITs to complete.&lt;br /&gt;&lt;br /&gt;I raised this issue of DB Time not showing activity details with Graham Wood* at Oracle in relation to a previous blog post. I think he made the point to me that that&#039;s why the OEM Performance Home Page is *not* the Top Activity page. If I take a look at that home page, it shows me the same information as the Swingbench results output did, albeit not as clearly&lt;br /&gt;&lt;br /&gt;&lt;!-- s9ymdb:313 --&gt;&lt;img height=&quot;300&quot; width=&quot;640&quot; class=&quot;serendipity_image_center&quot; src=&quot;http://oracledoug.com/serendipity/uploads/pic_demo14.png&quot; alt=&quot;&quot;  /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Looking at the Throughput graph, I can see that the second test processesd around double the number of Transactions per second for the same test running on the same system.&lt;br /&gt;&lt;br /&gt;To wrap up (and be a little defensive) ...&lt;br /&gt;&lt;br /&gt;- Yes, I could have traced one or more sessions and generated a complete and detailed response time profile that should have lead me to the same conclusion.&lt;br /&gt;&lt;br /&gt;- Yes, as this is a controlled test environment and I&#039;m the only &#039;user&#039;, AWR/Statspack would have been an even more powerful analysis tool in the right hands.&lt;br /&gt;&lt;br /&gt;- The Top Activity page is not the most appropriate tool for this job but it is handy for illustrating concepts. &lt;br /&gt;&lt;br /&gt;- Lest I seem a slavish pictures fan, I&#039;m showing how people might misuse or misundersand ASH/Top Activity. In this case, the Home Performance Page is a much better tool because we&#039;re looking at system-wide data and not drilling into session or SQL details.&lt;br /&gt;&lt;br /&gt;Oh, and what is my Top Secret Magic Silver Bullet Tuning Tip for OLTP-type applications? (only to be used by Advanced Oracle Performance Wizards)&lt;br /&gt;&lt;br /&gt; 
&lt;pre&gt;alter system set commit_write=&#039;BATCH, NOWAIT&#039;;&lt;/pre&gt;&lt;br /&gt;Done! In fact, why not just use this on all of your systems, just in case people are waiting on log file sync?&lt;br /&gt;&lt;br /&gt;(Leaves space below for angry responses and my withering humorous retorts)&lt;br /&gt;&lt;br /&gt;* This is not name-dropping, this is giving due credit to the people who really know what they&#039;re talking about&lt;br /&gt; 
    </content:encoded>

    <pubDate>Sun, 12 Sep 2010 22:16:13 +0100</pubDate>
    <guid isPermaLink="false">http://oracledoug.com/serendipity/index.php?/archives/1612-guid.html</guid>
    <category>ash</category>
<category>awr</category>
<category>grid control</category>
<category>swingbench</category>
<category>time matters</category>

</item>
<item>
    <title>Diagnosing Locking Problems using ASH/LogMiner – The End</title>
    <link>http://oracledoug.com/serendipity/index.php?/archives/1495-Diagnosing-Locking-Problems-using-ASHLogMiner-The-End.html</link>
    
    <comments>http://oracledoug.com/serendipity/index.php?/archives/1495-Diagnosing-Locking-Problems-using-ASHLogMiner-The-End.html#comments</comments>
    <wfw:comment>http://oracledoug.com/serendipity/wfwcomment.php?cid=1495</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://oracledoug.com/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=1495</wfw:commentRss>
    

    <author>dougburns@yahoo.com (Doug Burns)</author>
    <content:encoded>
    &lt;p&gt;Except&amp;#160;it&#039;s not the&amp;#160;end, of course. What I mean is&amp;#160;that I usually agree with&amp;#160;what Miladin Modrakovic said in &lt;a href=&quot;http://oraclue.com/2009/04/20/detecting-deadlock-source/#comment-176&quot;&gt;one of his comments&lt;/a&gt; on his first &lt;a href=&quot;http://oraclue.com/2009/04/20/detecting-deadlock-source/&quot;&gt;deadlock blog post&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&amp;quot;&lt;em&gt;There is always way around.&lt;/em&gt;&amp;quot;&lt;br /&gt;&lt;br /&gt;As I keep saying, there are many different ways of diagnosing locking problems. Which one works best&amp;#160;depends on the situation you&#039;re faced with but I don&#039;t think there&#039;s an &#039;end&#039; here, a single solution that works well in all circumstances.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Currently occurring&amp;#160;problems&lt;/em&gt; are easy. There&#039;s locking information in V$SESSION, V$TRANSACTION, V$LOCK etc and you can &lt;em&gt;probably&lt;/em&gt; track down the SQL statement that&#039;s caused the problem.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Those in the past&lt;/em&gt; are more difficult but, even in difficult cases, you&#039;ll often be able to get close enough to work out what&#039;s going on, particularly if you combine data from multiple sources - redo entries, ASH samples and AWR showing you what SQL was running when and so on. It becomes more difficult with a SELECT FOR UPDATE and no subsequent UPDATE, though, because the various tools available (e.g. Logminer) don&#039;t always return what you&#039;d expect when the data doesn&#039;t actually change.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;If you can recreate the problem or it&#039;s an ongoing problem that you expect to reoccur&lt;/em&gt;, then you can enable various traces and&amp;#160;have lots of information that will help you solve most real world problems.&lt;br /&gt;&lt;br /&gt;But the specific challenge here was to see which SQL statement was responsible for a locking problem, after the fact, when you weren&#039;t expecting the problem in the first place.&lt;br /&gt;&lt;br /&gt;I thought I&#039;d give &lt;a href=&quot;http://oraclue.com/2009/04/23/detecting-deadlock-source-part-2/&quot;&gt;Miladin&#039;s most recent post&lt;/a&gt;&amp;#160;a try because it&amp;#160;contains another interesting strategy - Flashback queries. Deadlock problems are different, not least because you have the resulting trace file. So his example isn&#039;t designed to address what I&#039;ve been looking at here, but I thought I should give it a try, as suggested by Vlado &lt;a href=&quot;http://oracledoug.com/serendipity/index.php?/archives/1491-Diagnosing-Locking-Problems-using-ASHLogMiner-Part-8.html#c6997&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The example he uses is a deadlock situation caused by updates, but I&#039;ll apply it to the specific example I&#039;ve been using here. Three SELECT FOR UPDATE statements - which one was the blocker? This time I&#039;ve created TEST_TAB2 with fewer rows, but the rest of the test is the same.&lt;/p&gt;
&lt;pre&gt;SQL&amp;gt; create table test_tab2 
	as select object_id pk_id, object_name from all_objects where object_id &amp;lt; 400;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Table created.&lt;/p&gt;&lt;p&gt;SQL&amp;gt; select * from test_tab2;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PK_ID OBJECT_NAME
---------- ------------------------------
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 258 DUAL
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 259 DUAL
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 311 SYSTEM_PRIVILEGE_MAP
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 313 SYSTEM_PRIVILEGE_MAP
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 314 TABLE_PRIVILEGE_MAP
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 316 TABLE_PRIVILEGE_MAP
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 317 STMT_AUDIT_OPTION_MAP
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 319 STMT_AUDIT_OPTION_MAP&lt;/p&gt;&lt;p&gt;8 rows selected.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;SQL&amp;gt; @doug1
SQL&amp;gt; column xidusn format 999
SQL&amp;gt; column xidslot format 999
SQL&amp;gt; column xidsqn format 999999
SQL&amp;gt; select pk_id, object_name from test_tab2 order by pk_id desc for update;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PK_ID OBJECT_NAME
---------- ------------------------------
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 319 STMT_AUDIT_OPTION_MAP
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 317 STMT_AUDIT_OPTION_MAP
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 316 TABLE_PRIVILEGE_MAP
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 314 TABLE_PRIVILEGE_MAP
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 313 SYSTEM_PRIVILEGE_MAP
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 311 SYSTEM_PRIVILEGE_MAP
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 259 DUAL
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 258 DUAL&lt;/p&gt;&lt;p&gt;8 rows selected.&lt;/p&gt;&lt;p&gt;SQL&amp;gt; select start_time, xid, xidusn, xidslot,
&amp;#160; 2&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xidsqn, start_scn, to_char(start_scn, &#039;XXXXXXXXXX&#039;)
&amp;#160; 3&amp;#160; from v$transaction
&amp;#160; 4&amp;#160; order by start_time;&lt;/p&gt;&lt;p&gt;START_TIME&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; XID&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; XIDUSN XIDSLOT&amp;#160; XIDSQN&amp;#160; START_SCN TO_CHAR(STA
-------------------- ---------------- ------ ------- ------- ---------- -----------
05/01/09 11:53:36&amp;#160;&amp;#160;&amp;#160; 0003001F000087AA&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 31&amp;#160;&amp;#160; 34730&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&lt;/p&gt;&lt;p&gt;SQL&amp;gt; rollback;&lt;/p&gt;&lt;p&gt;Rollback complete.&lt;/p&gt;&lt;p&gt;SQL&amp;gt; select pk_id from test_tab2 where object_name=&#039;SYSTEM_PRIVILEGE_MAP&#039; for update;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PK_ID
----------
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 311
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 313&lt;/p&gt;&lt;p&gt;SQL&amp;gt; select start_time, xid, xidusn, xidslot,
&amp;#160; 2&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xidsqn, start_scn, to_char(start_scn, &#039;XXXXXXXXXX&#039;)
&amp;#160; 3&amp;#160; from v$transaction
&amp;#160; 4&amp;#160; order by start_time;&lt;/p&gt;&lt;p&gt;START_TIME&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; XID&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; XIDUSN XIDSLOT&amp;#160; XIDSQN&amp;#160; START_SCN TO_CHAR(STA
-------------------- ---------------- ------ ------- ------- ---------- -----------
05/01/09 11:53:37&amp;#160;&amp;#160;&amp;#160; 0006000500008EEE&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 6&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 5&amp;#160;&amp;#160; 36590&amp;#160;&amp;#160; 85744191&amp;#160;&amp;#160;&amp;#160;&amp;#160; 51C5A3F&lt;/p&gt;&lt;p&gt;SQL&amp;gt; rollback;&lt;/p&gt;&lt;p&gt;Rollback complete.&lt;/p&gt;&lt;p&gt;SQL&amp;gt; select pk_id from test_tab2 where pk_id=313 for update;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PK_ID
----------
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 313&lt;/p&gt;&lt;p&gt;SQL&amp;gt; select start_time, xid, xidusn, xidslot,
&amp;#160; 2&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xidsqn, start_scn, to_char(start_scn, &#039;XXXXXXXXXX&#039;)
&amp;#160; 3&amp;#160; from v$transaction
&amp;#160; 4&amp;#160; order by start_time;&lt;/p&gt;&lt;p&gt;START_TIME&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; XID&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; XIDUSN XIDSLOT&amp;#160; XIDSQN&amp;#160; START_SCN TO_CHAR(STA
-------------------- ---------------- ------ ------- ------- ---------- -----------
05/01/09 11:53:37&amp;#160;&amp;#160;&amp;#160; 0002001900008F2E&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 25&amp;#160;&amp;#160; 36654&amp;#160;&amp;#160; 85744194&amp;#160;&amp;#160;&amp;#160;&amp;#160; 51C5A42&lt;/p&gt;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;So Session 1 has one row locked and will block Session 2.&lt;/p&gt;
&lt;pre&gt;SQL&amp;gt; @doug2
SQL&amp;gt; column xidusn format 999
SQL&amp;gt; column xidslot format 999
SQL&amp;gt; column xidsqn format 999999
SQL&amp;gt;
SQL&amp;gt; select pk_id from test_tab2 where pk_id=313 for update;&lt;/pre&gt;&lt;br /&gt;I rollback Session 1&lt;br /&gt;&lt;br /&gt;
&lt;pre&gt;SQL&amp;gt; rollback;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Rollback complete.&lt;/p&gt;&lt;/pre&gt;&lt;br /&gt;and Session 2 acquires the lock, then rolls back.&lt;br /&gt;&lt;br /&gt;
&lt;pre&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PK_ID
----------
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 313&lt;p&gt;&lt;/p&gt;&lt;p&gt;SQL&amp;gt;
SQL&amp;gt; select start_time, xid, xidusn, xidslot,
&amp;#160; 2&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xidsqn, start_scn, to_char(start_scn, &#039;XXXXXXXXXX&#039;)
&amp;#160; 3&amp;#160; from v$transaction
&amp;#160; 4&amp;#160; order by start_time;&lt;/p&gt;&lt;p&gt;START_TIME&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; XID&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; XIDUSN XIDSLOT&amp;#160; XIDSQN&amp;#160; START_SCN TO_CHAR(STA
-------------------- ---------------- ------ ------- ------- ---------- -----------
05/01/09 11:53:39&amp;#160;&amp;#160;&amp;#160; 00040018000067E3&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 24&amp;#160;&amp;#160; 26595&amp;#160;&amp;#160; 85744197&amp;#160;&amp;#160;&amp;#160;&amp;#160; 51C5A45&lt;/p&gt;&lt;p&gt;SQL&amp;gt;
SQL&amp;gt; rollback;&lt;/p&gt;&lt;p&gt;Rollback complete.&lt;/p&gt;&lt;/pre&gt;&lt;br /&gt;This is what comes back from Flashback queries.&lt;br /&gt;&lt;br /&gt;
&lt;pre&gt;SQL&amp;gt; @miladin
SQL&amp;gt; set echo on
SQL&amp;gt;
SQL&amp;gt; SELECT&amp;#160;&amp;#160;&amp;#160;&amp;#160; VERSIONS_XID
&amp;#160; 2&amp;#160; ,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; VERSIONS_STARTTIME
&amp;#160; 3&amp;#160; ,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; VERSIONS_ENDTIME
&amp;#160; 4&amp;#160; ,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; VERSIONS_STARTSCN
&amp;#160; 5&amp;#160; ,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; VERSIONS_ENDSCN
&amp;#160; 6&amp;#160; ,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; VERSIONS_OPERATION
&amp;#160; 7&amp;#160; ,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; pk_id, object_name
&amp;#160; 8&amp;#160; FROM&amp;#160;&amp;#160; testuser.test_tab2 VERSIONS BETWEEN TIMESTAMP MINVALUE AND MAXVALUE
&amp;#160; 9&amp;#160; ORDER&amp;#160; BY VERSIONS_STARTTIME;&lt;p&gt;&lt;/p&gt;&lt;p&gt;VERSIONS_XID
----------------
VERSIONS_STARTTIME
---------------------------------------------------------------------------
VERSIONS_ENDTIME
---------------------------------------------------------------------------
VERSIONS_STARTSCN VERSIONS_ENDSCN V&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PK_ID OBJECT_NAME
----------------- --------------- - ---------- ------------------------------&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 258 DUAL&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 259 DUAL&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 311 SYSTEM_PRIVILEGE_MAP&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 319 STMT_AUDIT_OPTION_MAP&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 314 TABLE_PRIVILEGE_MAP&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 316 TABLE_PRIVILEGE_MAP&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 317 STMT_AUDIT_OPTION_MAP&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 313 SYSTEM_PRIVILEGE_MAP&lt;/p&gt;&lt;p&gt;
8 rows selected.&lt;/p&gt;&lt;p&gt;SQL&amp;gt;
SQL&amp;gt; SELECT * FROM testuser.test_tab2
&amp;#160; 2&amp;#160; AS OF TIMESTAMP (SYSTIMESTAMP - INTERVAL &#039;1&#039; MINUTE);&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PK_ID OBJECT_NAME
---------- ------------------------------
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 258 DUAL
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 259 DUAL
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 311 SYSTEM_PRIVILEGE_MAP
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 313 SYSTEM_PRIVILEGE_MAP
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 314 TABLE_PRIVILEGE_MAP
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 316 TABLE_PRIVILEGE_MAP
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 317 STMT_AUDIT_OPTION_MAP
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 319 STMT_AUDIT_OPTION_MAP&lt;/p&gt;&lt;p&gt;8 rows selected.&lt;/p&gt;&lt;p&gt;SQL&amp;gt;
SQL&amp;gt; -- Narrow to specific column
SQL&amp;gt;
SQL&amp;gt; SELECT versions_xid XID, versions_startscn START_SCN, versions_endscn END_SCN, 
	versions_operation OPERATION, object_name
&amp;#160; 2&amp;#160; FROM testuser.test_tab2
&amp;#160; 3&amp;#160; VERSIONS BETWEEN SCN MINVALUE AND MAXVALUE
&amp;#160; 4&amp;#160; WHERE pk_id=313;&lt;/p&gt;&lt;p&gt;XID&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; START_SCN&amp;#160;&amp;#160;&amp;#160; END_SCN O OBJECT_NAME
---------------- ---------- ---------- - ------------------------------
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SYSTEM_PRIVILEGE_MAP&lt;/p&gt;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;Not much in other words. To check what I&#039;m doing, I COMMITed the final update from Session 1 (as opposed to rolling it back) and got what I&#039;d hope to see, because there&#039;s actually a different committed version of the data.&lt;/p&gt;
&lt;pre&gt;SQL&amp;gt; @miladin
SQL&amp;gt; set echo on
SQL&amp;gt;
SQL&amp;gt; SELECT&amp;#160;&amp;#160;&amp;#160;&amp;#160; VERSIONS_XID
&amp;#160; 2&amp;#160; ,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; VERSIONS_STARTTIME
&amp;#160; 3&amp;#160; ,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; VERSIONS_ENDTIME
&amp;#160; 4&amp;#160; ,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; VERSIONS_STARTSCN
&amp;#160; 5&amp;#160; ,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; VERSIONS_ENDSCN
&amp;#160; 6&amp;#160; ,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; VERSIONS_OPERATION
&amp;#160; 7&amp;#160; ,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; pk_id, object_name
&amp;#160; 8&amp;#160; FROM&amp;#160;&amp;#160; testuser.test_tab2 VERSIONS BETWEEN TIMESTAMP MINVALUE AND MAXVALUE
&amp;#160; 9&amp;#160; ORDER&amp;#160; BY VERSIONS_STARTTIME;&lt;p&gt;&lt;/p&gt;&lt;p&gt;VERSIONS_XID
----------------
VERSIONS_STARTTIME
---------------------------------------------------------------------------
VERSIONS_ENDTIME
---------------------------------------------------------------------------
VERSIONS_STARTSCN VERSIONS_ENDSCN V&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PK_ID OBJECT_NAME
----------------- --------------- - ---------- ------------------------------
0002000A00008F4B
01-MAY-09 12.04.39&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 85744966&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; U&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 313 XID 3&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 259 DUAL&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 311 SYSTEM_PRIVILEGE_MAP&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 319 STMT_AUDIT_OPTION_MAP&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 314 TABLE_PRIVILEGE_MAP&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 316 TABLE_PRIVILEGE_MAP&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 317 STMT_AUDIT_OPTION_MAP&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 258 DUAL&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;01-MAY-09 12.04.39
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 85744966&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 313 SYSTEM_PRIVILEGE_MAP&lt;/p&gt;&lt;p&gt;
9 rows selected.&lt;/p&gt;&lt;p&gt;SQL&amp;gt;
SQL&amp;gt; SELECT * FROM testuser.test_tab2
&amp;#160; 2&amp;#160; AS OF TIMESTAMP (SYSTIMESTAMP - INTERVAL &#039;1&#039; MINUTE);&lt;/p&gt;&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PK_ID OBJECT_NAME
---------- ------------------------------
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 258 DUAL
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 259 DUAL
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 311 SYSTEM_PRIVILEGE_MAP
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 313 SYSTEM_PRIVILEGE_MAP
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 314 TABLE_PRIVILEGE_MAP
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 316 TABLE_PRIVILEGE_MAP
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 317 STMT_AUDIT_OPTION_MAP
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 319 STMT_AUDIT_OPTION_MAP&lt;/p&gt;&lt;p&gt;8 rows selected.&lt;/p&gt;&lt;p&gt;SQL&amp;gt;
SQL&amp;gt; -- Narrow to specific column
SQL&amp;gt;
SQL&amp;gt; SELECT versions_xid XID, versions_startscn START_SCN, versions_endscn END_SCN, 
	versions_operation OPERATION, object_name
&amp;#160; 2&amp;#160; FROM testuser.test_tab2
&amp;#160; 3&amp;#160; VERSIONS BETWEEN SCN MINVALUE AND MAXVALUE
&amp;#160; 4&amp;#160; WHERE pk_id=313;&lt;/p&gt;&lt;p&gt;XID&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; START_SCN&amp;#160;&amp;#160;&amp;#160; END_SCN O OBJECT_NAME
---------------- ---------- ---------- - ------------------------------
0002000A00008F4B&amp;#160;&amp;#160; 85744966&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; U XID 3
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 85744966&amp;#160;&amp;#160; SYSTEM_PRIVILEGE_MAP&lt;/p&gt;&lt;/pre&gt;&lt;br /&gt;So the problem is that although there&#039;s some locking information for the SELECT FOR UPDATEs (see previous blog posts) they&#039;re difficult to diagnose because there were no changes to the data.&lt;br /&gt;&lt;br /&gt;Ultimately, I like the way Graham Wood put it in an email, so I asked him if I could quote it here.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&amp;quot;I may well have said that it was impossible to get from the V$ tables. The reason that it is impossible is that row locks exist only in the disk blocks, in the form of the ITL. This was a key part of the whole row level locking scheme as it meant that we did not have to maintain and configure a structure to contain lock information that could, at worse need one entry for every row in the database. The ITL cannot be extended to include a SQLID, or at least not without requiring a data migration to the new block structure.&lt;/em&gt;&lt;em&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You may well say that tracing will give you the blocking SQL. Well if you happen to be tracing the blocking session from the start of the blocking txn, then it is true that the trace file contains the blocking statement. However there may be many hundreds or thousands of statements in the trace file and there is no method that can tell you which one, even though you might be able to reduce the &#039;possibles&#039; list by analysis of object access by the various statements.&lt;/em&gt;&lt;em&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;As for the use of the XID. The XID is useful because it gives a finite limit to which operation may have caused the lock i.e the lock must have been caused by a statement that was in the same txn that the blocking session is in at the time that the&amp;#160; waiter is blocked.&amp;quot;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;There&#039;s a gap in the data block and redo data describing the transaction - no SQLID. By using various strategies you might be able to make an educated guess as to the source of the problem, but there&#039;s no way to &lt;em&gt;guarantee&lt;/em&gt; that you have the correct statement. But with so many different possibilities to get you close to a diagnosis, I&#039;m not sure having the SQLID in there would be very useful&amp;#160;- certainly not worth&amp;#160;amending the ITL&amp;#160;structure.&lt;br /&gt;&lt;br /&gt;This series of posts is already way out of control, I&#039;ve got other things I want to post about&amp;#160;and I&#039;m sort of bored&amp;#160;by myself &lt;img src=&quot;http://oracledoug.com/serendipity/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; so, no matter what other approaches crop up, the most I&#039;ll be doing is linking to them! 
    </content:encoded>

    <pubDate>Fri, 01 May 2009 12:30:00 +0100</pubDate>
    <guid isPermaLink="false">http://oracledoug.com/serendipity/index.php?/archives/1495-guid.html</guid>
    <category>ASH</category>
<category>Locking</category>

</item>
<item>
    <title>Diagnosing Locking Problems using ASH/LogMiner – Part 9</title>
    <link>http://oracledoug.com/serendipity/index.php?/archives/1492-Diagnosing-Locking-Problems-using-ASHLogMiner-Part-9.html</link>
    
    <comments>http://oracledoug.com/serendipity/index.php?/archives/1492-Diagnosing-Locking-Problems-using-ASHLogMiner-Part-9.html#comments</comments>
    <wfw:comment>http://oracledoug.com/serendipity/wfwcomment.php?cid=1492</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://oracledoug.com/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=1492</wfw:commentRss>
    

    <author>dougburns@yahoo.com (Doug Burns)</author>
    <content:encoded>
    &lt;p&gt;This time, instead of dumping the contents of the log file for a specific Data Block Address (DBA), as in the last part, I’m going to dump it for a specific operation type – Lock Rows (SELECT FOR UPDATE in this case) – which is part of the Row Operations layer (11) and is the LKR operation (4). This will allow me to eliminate less interesting activity and will include information for blocks other than the specific block that contains the PK_ID=313 row. &lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;pre&gt;SQL&amp;gt; alter system dump logfile &#039;&amp;amp;&amp;amp;my_member&#039;
&amp;#160; 2&amp;#160; layer 11 opcode 4;
old&amp;#160;&amp;#160; 1: alter system dump logfile &#039;&amp;amp;&amp;amp;my_member&#039;
new&amp;#160;&amp;#160; 1: alter system dump logfile &#039;/data/oradata/PPL/redo03.log&#039;&lt;p&gt;&lt;/p&gt;&lt;p&gt;System altered.&lt;/p&gt;&lt;/pre&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;Next, a quick reminder of the transaction history from the previous tests, that this log file covers.&lt;/p&gt;
&lt;p&gt;Transaction ID&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Session 1 Activity&amp;#160; Transaction ID&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Session 2 Activity&lt;/p&gt;
&lt;p&gt;0003001100008615&amp;#160; Whole Table Locked&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Locks Released&lt;br /&gt;0002000100008DAA&amp;#160; Two Rows Locked&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Locks Released&lt;br /&gt;000900110000891B&amp;#160; PK_ID=313 Locked&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Waiting to lock PK_ID=313&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Lock Released&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 00080005000081D3&amp;#160;&amp;#160;&amp;#160; PK_ID=313 Locked&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;
&lt;p&gt;Looking at the header (line numbers added by vi), I can see that the dump is restricted to Opcode 11.4.&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;pre&gt;&amp;#160;&amp;#160;&amp;#160; 19&amp;#160; DUMP OF REDO FROM FILE &#039;/data/oradata/PPL/redo03.log&#039;
&amp;#160;&amp;#160;&amp;#160; 20&amp;#160;&amp;#160; Opcode 11.4 only
&amp;#160;&amp;#160;&amp;#160; 21&amp;#160;&amp;#160; RBAs: 0x000000.00000000.0000 thru 0xffffffff.ffffffff.ffff
&amp;#160;&amp;#160;&amp;#160; 22&amp;#160;&amp;#160; SCNs: scn: 0x0000.00000000 thru scn: 0xffff.ffffffff
&amp;#160;&amp;#160;&amp;#160; 23&amp;#160;&amp;#160; Times: creation thru eternity&lt;/pre&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;Next I search for ‘xid: ‘ to find the first transaction ID, which brings up the first redo record, all 2214 lines of it! Relax, I’m not going to list it all here, just focus on the first CHANGE record.&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;pre&gt;&amp;#160;&amp;#160;&amp;#160; 50&amp;#160; REDO RECORD - Thread:1 RBA: 0x002304.00000002.0010 LEN: 0x45b0 VLD: 0x0d
&amp;#160;&amp;#160;&amp;#160; 51&amp;#160; SCN: 0x0000.050dc3e9 SUBSCN:&amp;#160; 1 04/23/2009 09:40:19
&amp;#160;&amp;#160;&amp;#160; 52&amp;#160; CHANGE #1 TYP:0 CLS: 1 AFN:3 DBA:0x00c06125 OBJ:144543 SCN:0x0000.050dc005 SEQ:185 OP:11.4
&amp;#160;&amp;#160;&amp;#160; 53&amp;#160; KTB Redo
&amp;#160;&amp;#160;&amp;#160; 54&amp;#160; op: 0x01&amp;#160; ver: 0x01
&amp;#160;&amp;#160;&amp;#160; 55&amp;#160; op: F&amp;#160; xid:&amp;#160; 0x0003.011.00008615&amp;#160;&amp;#160;&amp;#160; uba: 0x00803aaa.0f30.01
&amp;#160;&amp;#160;&amp;#160; 56&amp;#160; KDO Op code: LKR row dependencies Disabled
&amp;#160;&amp;#160;&amp;#160; 57&amp;#160;&amp;#160;&amp;#160; xtype: XA flags: 0x00000000&amp;#160; bdba: 0x00c06125&amp;#160; hdba: 0x00c06103
&amp;#160;&amp;#160;&amp;#160; 58&amp;#160; itli: 2&amp;#160; ispac: 0&amp;#160; maxfr: 4858
&amp;#160;&amp;#160;&amp;#160; 59&amp;#160; tabn: 0 slot: 183 to: 2&lt;/pre&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;I can see this is a change to a Data Block (Class 1), the Trancation ID is 0x0003.011.00008615 which matches the XID 0003001100008615 from V$TRANSACTION and that it’s a row lock operation. Next up is a 5.2 operation that starts off the new transaction)&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;pre&gt;&amp;#160;&amp;#160;&amp;#160; 60&amp;#160; CHANGE #2 TYP:0 CLS:21 AFN:2 DBA:0x00800029 OBJ:4294967295 SCN:0x0000.050dc3c0 SEQ:&amp;#160; 1 OP:5.2
&amp;#160;&amp;#160;&amp;#160; 61&amp;#160; ktudh redo: slt: 0x0011 sqn: 0x00008615 flg: 0x000a siz: 108 fbi: 0
&amp;#160;&amp;#160;&amp;#160; 62&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; uba: 0x00803aaa.0f30.01&amp;#160;&amp;#160;&amp;#160; pxid:&amp;#160; 0x0000.000.00000000&lt;/pre&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;After that you’ll see tons more 11.4 entries as the various locks are acquired. Next I’ll search for the transaction ID for the second transaction (that locked two rows) by searching for ‘xid:&amp;#160; 0x0002’ (two spaces in that string).&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;pre&gt;192358&amp;#160; REDO RECORD - Thread:1 RBA: 0x002304.00000ce8.0010 LEN: 0x0238 VLD: 0x0d
192359&amp;#160; SCN: 0x0000.050dc41f SUBSCN:&amp;#160; 1 04/23/2009 09:40:20
192360&amp;#160; CHANGE #1 TYP:0 CLS: 1 AFN:3 DBA:0x00c06104 OBJ:144543 SCN:0x0000.050dc411 SEQ:102 OP:11.4
192361&amp;#160; KTB Redo
192362&amp;#160; op: 0x01&amp;#160; ver: 0x01
192363&amp;#160; op: F&amp;#160; xid:&amp;#160; 0x0002.001.00008daa&amp;#160;&amp;#160;&amp;#160; uba: 0x00808827.124c.31
192364&amp;#160; KDO Op code: LKR row dependencies Disabled
192365&amp;#160;&amp;#160;&amp;#160; xtype: XA flags: 0x00000000&amp;#160; bdba: 0x00c06104&amp;#160; hdba: 0x00c06103
192366&amp;#160; itli: 3&amp;#160; ispac: 0&amp;#160; maxfr: 4858
192367&amp;#160; tabn: 0 slot: 2 to: 3&lt;/pre&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;Looking at the line numbers, you can probably see why I didn’t want to show you all of the REDO RECORDs for the first transaction! Checking the transaction ID, that’s the one we’re looking for. While I’m at it, I might as well track down the last two transactions by searching for their xid: &lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;pre&gt;192447&amp;#160; REDO RECORD - Thread:1 RBA: 0x002304.00000cea.0010 LEN: 0x0180 VLD: 0x0d
192448&amp;#160; SCN: 0x0000.050dc423 SUBSCN:&amp;#160; 1 04/23/2009 09:40:25
192449&amp;#160; CHANGE #1 TYP:0 CLS: 1 AFN:3 DBA:0x00c06104 OBJ:144543 SCN:0x0000.050dc41f SEQ:&amp;#160; 4 OP:11.4
192450&amp;#160; KTB Redo
192451&amp;#160; op: 0x01&amp;#160; ver: 0x01
192452&amp;#160; op: F&amp;#160; xid:&amp;#160; 0x0009.011.0000891b&amp;#160;&amp;#160;&amp;#160; uba: 0x0081e118.14ee.05
192453&amp;#160; KDO Op code: LKR row dependencies Disabled
192454&amp;#160;&amp;#160;&amp;#160; xtype: XA flags: 0x00000000&amp;#160; bdba: 0x00c06104&amp;#160; hdba: 0x00c06103
192455&amp;#160; itli: 3&amp;#160; ispac: 0&amp;#160; maxfr: 4858
192456&amp;#160; tabn: 0 slot: 3 to: 3&lt;p&gt;&lt;/p&gt;&lt;p&gt;192496&amp;#160; REDO RECORD - Thread:1 RBA: 0x002304.00000cec.0010 LEN: 0x0180 VLD: 0x0d
192497&amp;#160; SCN: 0x0000.050dc428 SUBSCN:&amp;#160; 1 04/23/2009 09:40:34
192498&amp;#160; CHANGE #1 TYP:0 CLS: 1 AFN:3 DBA:0x00c06104 OBJ:144543 SCN:0x0000.050dc426 SEQ:&amp;#160; 1 OP:11.4
192499&amp;#160; KTB Redo
192500&amp;#160; op: 0x01&amp;#160; ver: 0x01
192501&amp;#160; op: F&amp;#160; xid:&amp;#160; 0x0008.005.000081d3&amp;#160;&amp;#160;&amp;#160; uba: 0x0081eda9.1058.20
192502&amp;#160; KDO Op code: LKR row dependencies Disabled
192503&amp;#160;&amp;#160;&amp;#160; xtype: XA flags: 0x00000000&amp;#160; bdba: 0x00c06104&amp;#160; hdba: 0x00c06103
192504&amp;#160; itli: 3&amp;#160; ispac: 0&amp;#160; maxfr: 4858
192505&amp;#160; tabn: 0 slot: 3 to: 3&lt;/p&gt;&lt;/pre&gt;&lt;br /&gt;Yep, they both look right (which is more than can be said for Log Miner’s output!). The fact is that you could probably work out which transaction had locked the rows and the type of work it was doing, but still no nearer finding the offending SQL statement, really.&lt;br /&gt;&lt;br /&gt;In the next and absolutely definitely last part, I&#039;ll have a brief overview of some other suggestions such as &lt;a href=&quot;http://oraclue.com/2009/04/23/detecting-deadlock-source-part-2/&quot;&gt;Miladin Modrakivic&#039;s&lt;/a&gt;. 
    </content:encoded>

    <pubDate>Thu, 30 Apr 2009 14:35:00 +0100</pubDate>
    <guid isPermaLink="false">http://oracledoug.com/serendipity/index.php?/archives/1492-guid.html</guid>
    <category>ASH</category>
<category>Locking</category>

</item>

</channel>
</rss>