{"id":1699,"date":"2013-03-17T12:00:00","date_gmt":"2013-03-17T12:00:00","guid":{"rendered":"http:\/\/orcldoug.com\/blog\/?p=1699"},"modified":"2013-03-17T12:00:00","modified_gmt":"2013-03-17T12:00:00","slug":"10053-trace-files","status":"publish","type":"post","link":"http:\/\/orcldoug.com\/blog\/2013\/03\/17\/10053-trace-files\/","title":{"rendered":"10053 Trace Files"},"content":{"rendered":"<p>Sometimes I&#8217;m really not sure whether a blog post is a good idea or not. This is one of those times.<\/p>\n<p>I remember a while ago that Neil Chandler wrote a blog post about why you probably don&#8217;t need <a href=\"http:\/\/chandlerdba.wordpress.com\/2011\/11\/22\/the-10046-trace-largely-useless-isnt-it\/\">10046 trace files<\/a> that I didn&#8217;t completely agree with and I kept thinking I must comment on it or write a post from a different perspective. Neil&#8217;s a mate, a London Oracle Beers regular and I understood where he was coming from in that post. He makes some excellent points, so I recommend you read it. But I don&#8217;t think it&#8217;s so hard to get a trace enabled these days as people think. You don&#8217;t necessarily need to change a line of code with the availability of the DBMS_MONITOR package and (although I accept this is unusual) the client I&#8217;ve worked for most recently makes trace file access very easy for developers. We also have ASH, AWR and SQL Monitoring though and I tend to agree with Neil that the times when 10046 trace files are truly required to solve problems are limited. Now I read this back, it sounds like I agree with him, but I know that I use 10046 trace files more regularly than the post suggests. I would say 10046 trace files are incredibly useful sometimes. In fact, when they are useful they are the only correct tool for the job.<\/p>\n<p>But the real reason for referencing Neil&#8217;s post is this statement.<\/p>\n<p>&#8220;<em>I have never used a 10053 trace on a Production system. I have simply<br \/>\nnever needed to know the decisions taken by the optimizer in that much<br \/>\ndetail.<\/em>&#8220;<\/p>\n<p>I&#8217;ve had this discussion with most well-known experts in the Oracle community at some point or other and there&#8217;s general agreement that there&#8217;s no need to bother with those pesky and ridiculously geeky 10053 trace files most of the time. Most SQL performance problems simply aren&#8217;t that complicated. I&#8217;ve probably agreed whenever the argument has come up but the fact is that I increasingly find myself using them and it worries me a little that &#8216;most of the time you don&#8217;t need them &#8211; concentrate on the basics&#8217; is heard as &#8211; &#8216;don&#8217;t ever bother looking at them &#8211; they won&#8217;t help&#8217; and I&#8217;ve been tempted to redress the balance for a while.<\/p>\n<p>But something stopped me. 10053 trace files <em>are<\/em> exceptionally long and contain a lot of information that I wouldn&#8217;t begin to pretend I understand and so if you can&#8217;t cover a subject properly and it is quite a technical subject then, not only are you in danger of doing people a disservice but you are also opening yourself up to all sorts of challenges, corrections and debates. But, hey, that&#8217;s what a community and what blogging is all about &#8211; people learning from each other. I&#8217;m also not a big fan of any technical writing which is about how clever the writer is above it actually being useful! The more I know, the more I find myself avoiding the wilfully geeky stuff.<\/p>\n<p>I still wasn&#8217;t sure but at least one person at my current client has been badgering me about this for ages so I&#8217;ve decided, what the hell, I&#8217;m going to write a few blog posts about the things I find useful about 10053 trace files and hopefully give some very high level hints about how you might use them too.<\/p>\n<p>If it&#8217;s not technical enough for some people then tough and if I go astray, there are plenty of people out there who probably know the subject much better who can keep me straight &#128521; (Just off the top of my head, I can think of <a href=\"https:\/\/blogs.oracle.com\/optimizer\/\">Maria Colgan<\/a>, <a href=\"http:\/\/jonathanlewis.wordpress.com\/\">Jonathan Lewis<\/a>, <a href=\"http:\/\/www.centrexcc.com\/\">Wolfgang Breitling<\/a>, <a href=\"http:\/\/www.antognini.ch\/\">Christian Antognini<\/a> &#8230;. well, it could be a long list).<\/p>\n<p>Enough of the intro, but let me finish by saying what I think is the most important reason to use 10053 trace files. There are many posts about inaccurate row source cardinalities leading to bad plans (<a href=\"http:\/\/structureddata.org\/2007\/11\/21\/troubleshooting-bad-execution-plans\/\">This<\/a> is one of my favourites). But I believe that it&#8217;s actually only the experts who can compare E-ROWS and A-ROWS and make educated guesses about why the cardinalities are wrong. (To give you an example, many is the time that Jonathan Lewis has said to me &#8211; &#8216;Oh, that looks like a classic Optimizer 5% guess&#8217; &#8211; or words to that effect, anyway.) But most of us can&#8217;t just &#8216;see&#8217; those things when we look at a plan. At best, a 10053 trace file offers the possibility of <em>knowing why <\/em>the CBO picked the wrong plan.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes I&#8217;m really not sure whether a blog post is a good idea or not. This is one of those times. I remember a while ago that Neil Chandler wrote a blog post about why you probably don&#8217;t need 10046 trace files that I didn&#8217;t completely agree with and I kept thinking I must comment&hellip; <a class=\"more-link\" href=\"http:\/\/orcldoug.com\/blog\/2013\/03\/17\/10053-trace-files\/\">Continue reading <span class=\"screen-reader-text\">10053 Trace Files<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1699","post","type-post","status-publish","format-standard","hentry","category-uncategorized","entry"],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":1701,"url":"http:\/\/orcldoug.com\/blog\/2013\/03\/18\/10053-trace-files-getting-started\/","url_meta":{"origin":1699,"position":0},"title":"10053 Trace Files &#8211; Getting Started","date":"March 18, 2013","format":false,"excerpt":"Before getting into the contents of a 10053 trace file and looking at any useful stuff, you need to know what the files are for and how and where they are created. Essentially, setting event 10053 causes the Cost Based Optimizer to write information to a trace file describing the\u2026","rel":"","context":"With 5 comments","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":976,"url":"http:\/\/orcldoug.com\/blog\/2005\/05\/29\/px-slave-trace-files\/","url_meta":{"origin":1699,"position":1},"title":"PX Slave Trace Files","date":"May 29, 2005","format":false,"excerpt":"It's sad that it takes a Bank Holiday weekend for me to get round to doing some more research on parallel execution. Anyway, I was on the verge of modifying the following line from the PX paper ...The trace files for the slave processes may be created in background_dump_dest, rather\u2026","rel":"","context":"Similar post","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":967,"url":"http:\/\/orcldoug.com\/blog\/2005\/07\/25\/a-small-follow-up\/","url_meta":{"origin":1699,"position":2},"title":"A small follow-up","date":"July 25, 2005","format":false,"excerpt":"From a previous blog entry :-\"... I noticed that the slave trace files are appearing in user_dump_dest. This is with 9.2.0.1.0 on Windows XP Home. I'm using 9.2 because I want to see the discrete SQL statements that the slaves are processing. So, just an interesting anomaly from what I've\u2026","rel":"","context":"Similar post","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1031,"url":"http:\/\/orcldoug.com\/blog\/2006\/07\/21\/monitoring-index-usage-ii-event-10132\/","url_meta":{"origin":1699,"position":3},"title":"Monitoring Index Usage II &#8211; Event 10132","date":"July 21, 2006","format":false,"excerpt":"That's a shame.I was hoping that setting the event at the instance level might generate one trace file in the background_dump_dest but, like event 10046, it generates one trace file per session in user_dump_dest. I should have expected that, but I suppose my optimism blinded me.It doesn't make event 10132\u2026","rel":"","context":"Similar post","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1044,"url":"http:\/\/orcldoug.com\/blog\/2006\/08\/04\/tracing-session-activity-over-a-remote-database-link\/","url_meta":{"origin":1699,"position":4},"title":"Tracing session activity over a remote database link","date":"August 4, 2006","format":false,"excerpt":"Yesterday someone asked me how to trace a session that selects from a view in a remote database via a link. If they activated the trace on the local instance, they wouldn't see the bulk of the work which was happening on the remote instance - just a bunch of\u2026","rel":"","context":"With 2 comments","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1112,"url":"http:\/\/orcldoug.com\/blog\/2009\/10\/29\/10g-consolidated-trace-files-and-px\/","url_meta":{"origin":1699,"position":5},"title":"10g Consolidated Trace Files and PX","date":"October 29, 2009","format":false,"excerpt":"At the end of my Tracing Parallel Execution presentation at the Scottish OUG conference, Michael M\u00f8ller of Miracle asked whether the consolidated trace files produced by the DBMS_MONITOR package and trcsess utility are in strict time order. i.e. Will I see the actions of the query coordinator, then the actions\u2026","rel":"","context":"With 7 comments","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/posts\/1699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/comments?post=1699"}],"version-history":[{"count":0,"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/posts\/1699\/revisions"}],"wp:attachment":[{"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/media?parent=1699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/categories?post=1699"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/tags?post=1699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}