{"id":593,"date":"2009-12-22T13:39:30","date_gmt":"2009-12-22T18:39:30","guid":{"rendered":"http:\/\/appcrawler.com\/wordpress\/?p=593"},"modified":"2011-07-06T10:18:57","modified_gmt":"2011-07-06T15:18:57","slug":"shell-scripting-stats-from-a-10046-trace","status":"publish","type":"post","link":"http:\/\/appcrawler.com\/wordpress\/2009\/12\/22\/shell-scripting-stats-from-a-10046-trace\/","title":{"rendered":"Shell scripting stats from a 10046 trace"},"content":{"rendered":"<p>This morning, I enabled a 10046 trace at level 12 for a slow session.  I did not scope the trace interval (ala Cary Milsap), so I didn&#8217;t even have the query text in the trace file (although I knew what it was).  The resulting trace file was huge at 200MB.  I didn&#8217;t want to lose the information in it, so I came up with what is below.<\/p>\n<p>We first get a count of all waits in the trace&#8230;<\/p>\n<pre lang=\"text\" line=\"1\">\r\n11:16:13 oracle@oh1xpwcdb01 \/u02\/admin\/wcprod\/udump >grep WAIT wcprod1_ora_2327.trc | cut -f2 -d\\' | sort | uniq -c | sort -n\r\n      1 gc current block 3-way\r\n      1 gc current grant busy\r\n      4 gc cr block 3-way\r\n      4 gc cr block busy\r\n      4 gc current block 2-way\r\n      8 gc remaster\r\n      9 gcs drm freeze in enter server mode\r\n     29 latch: cache buffers chains\r\n     38 gc cr block congested\r\n     72 latch: cache buffers lru chain\r\n     80 gc cr grant 2-way\r\n    123 latch free\r\n    126 db file parallel read\r\n    171 latch: gcs resource hash\r\n    367 latch: object queue header operation\r\n    531 gc current grant 2-way\r\n   2004 latch: KCL gc element parent latch\r\n  47434 db file scattered read\r\n  66236 gc cr multi block request\r\n 180037 gc cr disk read\r\n 197592 db file sequential read\r\n1580988 gc cr block 2-way\r\n<\/pre>\n<p>&#8230;and then get the total number of seconds waited&#8230;<\/p>\n<pre lang=\"text\" line=\"1\">\r\n11:17:24 oracle@oh1xpwcdb01 \/u02\/admin\/wcprod\/udump >grep \"ela=\" wcprod1_ora_2327.trc | cut -f3 -d\\' | awk '{SUM+=$2} END{print SUM\/1000000}'\r\n3783.22\r\n<\/pre>\n<p>&#8230;and for Oracle support, we were interested in a huge amount of undo reads (I&#8217;ll save that for another post).  As such, I extracted the time spent in seconds on reads against the undo datafiles for each of the events listed below.<\/p>\n<pre lang=\"text\" line=\"1\">\r\n11:20:41 oracle@oh1xpwcdb01 \/u02\/admin\/wcprod\/udump >grep \"db file sequential read\" wcprod1_ora_2327.trc | grep \"file#=2[19,29,30]\" | awk '{SUM+=$8} END{print SUM\/1000000}'     \r\n1724.6\r\n11:21:14 oracle@oh1xpwcdb01 \/u02\/admin\/wcprod\/udump >grep \"gc cr block 2-way\" wcprod1_ora_2327.trc | grep \"p1=2[19,29,30]\" | awk '{SUM+=$8} END{print SUM\/1000000}'\r\n1089.77\r\n11:21:30 oracle@oh1xpwcdb01 \/u02\/admin\/wcprod\/udump >\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This morning, I enabled a 10046 trace at level 12 for a slow session. I did not scope the trace interval (ala Cary Milsap), so I didn&#8217;t even have the query text in the trace file (although I knew what&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/appcrawler.com\/wordpress\/2009\/12\/22\/shell-scripting-stats-from-a-10046-trace\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[19,22],"tags":[],"_links":{"self":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/593"}],"collection":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/comments?post=593"}],"version-history":[{"count":13,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/593\/revisions"}],"predecessor-version":[{"id":981,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/593\/revisions\/981"}],"wp:attachment":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/media?parent=593"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/categories?post=593"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/tags?post=593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}