<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7992074158128225343</id><updated>2011-11-03T12:53:09.517-07:00</updated><category term='ulimit ASM file descriptor'/><title type='text'>Dave Herring's DBA Blog</title><subtitle type='html'>Welcome to my blog!  The content covers most topics related to DBA activity, primarily in an Oracle and Linux environment.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://daveherringsdbablog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7992074158128225343/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://daveherringsdbablog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Dave Herring</name><uri>http://www.blogger.com/profile/04843915655642313796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://2.bp.blogspot.com/_nIBX5V34b9I/SpqHS6w2pJI/AAAAAAAAADQ/LAPS45TFQvc/S220/Dave+at+Brit%27s+Grad.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7992074158128225343.post-2467320582038810514</id><published>2011-11-03T12:53:00.000-07:00</published><updated>2011-11-03T12:53:09.549-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ulimit ASM file descriptor'/><title type='text'>"ulimit", ASM, and Thinking Things Through</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt; &lt;w:WordDocument&gt;  &lt;w:View&gt;Normal&lt;/w:View&gt;  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;  &lt;w:TrackMoves/&gt;  &lt;w:TrackFormatting/&gt;  &lt;w:DoNotShowPropertyChanges/&gt;  &lt;w:PunctuationKerning/&gt;  &lt;w:ValidateAgainstSchemas/&gt;  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;  &lt;w:DoNotPromoteQF/&gt;  &lt;w:LidThemeOther&gt;EN-US&lt;/w:LidThemeOther&gt;  &lt;w:LidThemeAsian&gt;X-NONE&lt;/w:LidThemeAsian&gt;  &lt;w:LidThemeComplexScript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;  &lt;w:Compatibility&gt;   &lt;w:BreakWrappedTables/&gt;   &lt;w:SnapToGridInCell/&gt;   &lt;w:WrapTextWithPunct/&gt;   &lt;w:UseAsianBreakRules/&gt;   &lt;w:DontGrowAutofit/&gt;   &lt;w:SplitPgBreakAndParaMark/&gt;   &lt;w:DontVertAlignCellWithSp/&gt;   &lt;w:DontBreakConstrainedForcedTables/&gt;   &lt;w:DontVertAlignInTxbx/&gt;   &lt;w:Word11KerningPairs/&gt;   &lt;w:CachedColBalance/&gt;  &lt;/w:Compatibility&gt;  &lt;m:mathPr&gt;   &lt;m:mathFont m:val="Cambria Math"/&gt;   &lt;m:brkBin m:val="before"/&gt;   &lt;m:brkBinSub m:val="&amp;#45;-"/&gt;   &lt;m:smallFrac m:val="off"/&gt;   &lt;m:dispDef/&gt;   &lt;m:lMargin m:val="0"/&gt;   &lt;m:rMargin m:val="0"/&gt;   &lt;m:defJc m:val="centerGroup"/&gt;   &lt;m:wrapIndent m:val="1440"/&gt;   &lt;m:intLim m:val="subSup"/&gt;   &lt;m:naryLim m:val="undOvr"/&gt;  &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt;&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt; &lt;w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"  DefSemiHidden="true" DefQFormat="false" DefPriority="99"  LatentStyleCount="267"&gt;  &lt;w:LsdException Locked="false" Priority="0" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Normal"/&gt;  &lt;w:LsdException Locked="false" Priority="9" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="heading 1"/&gt;  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/&gt;  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/&gt;  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/&gt;  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/&gt;  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/&gt;  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/&gt;  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/&gt;  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/&gt;  &lt;w:LsdException Locked="false" Priority="39" Name="toc 1"/&gt;  &lt;w:LsdException Locked="false" Priority="39" Name="toc 2"/&gt;  &lt;w:LsdException Locked="false" Priority="39" Name="toc 3"/&gt;  &lt;w:LsdException Locked="false" Priority="39" Name="toc 4"/&gt;  &lt;w:LsdException Locked="false" Priority="39" Name="toc 5"/&gt;  &lt;w:LsdException Locked="false" Priority="39" Name="toc 6"/&gt;  &lt;w:LsdException Locked="false" Priority="39" Name="toc 7"/&gt;  &lt;w:LsdException Locked="false" Priority="39" Name="toc 8"/&gt;  &lt;w:LsdException Locked="false" Priority="39" Name="toc 9"/&gt;  &lt;w:LsdException Locked="false" Priority="0" Name="header"/&gt;  &lt;w:LsdException Locked="false" Priority="0" Name="footer"/&gt;  &lt;w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/&gt;  &lt;w:LsdException Locked="false" Priority="10" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Title"/&gt;  &lt;w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/&gt;  &lt;w:LsdException Locked="false" Priority="0" Name="Body Text"/&gt;  &lt;w:LsdException Locked="false" Priority="11" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/&gt;  &lt;w:LsdException Locked="false" Priority="22" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Strong"/&gt;  &lt;w:LsdException Locked="false" Priority="20" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/&gt;  &lt;w:LsdException Locked="false" Priority="59" SemiHidden="false"   UnhideWhenUsed="false" Name="Table Grid"/&gt;  &lt;w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/&gt;  &lt;w:LsdException Locked="false" Priority="1" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/&gt;  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Shading"/&gt;  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"   UnhideWhenUsed="false" Name="Light List"/&gt;  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Grid"/&gt;  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 1"/&gt;  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 2"/&gt;  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 1"/&gt;  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 2"/&gt;  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 1"/&gt;  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 2"/&gt;  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 3"/&gt;  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"   UnhideWhenUsed="false" Name="Dark List"/&gt;  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Shading"/&gt;  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful List"/&gt;  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Grid"/&gt;  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Shading Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"   UnhideWhenUsed="false" Name="Light List Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Grid Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/&gt;  &lt;w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/&gt;  &lt;w:LsdException Locked="false" Priority="34" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/&gt;  &lt;w:LsdException Locked="false" Priority="29" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Quote"/&gt;  &lt;w:LsdException Locked="false" Priority="30" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/&gt;  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"   UnhideWhenUsed="false" Name="Dark List Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful List Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Shading Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"   UnhideWhenUsed="false" Name="Light List Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Grid Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"   UnhideWhenUsed="false" Name="Dark List Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful List Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Shading Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"   UnhideWhenUsed="false" Name="Light List Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Grid Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"   UnhideWhenUsed="false" Name="Dark List Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful List Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Shading Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"   UnhideWhenUsed="false" Name="Light List Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Grid Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"   UnhideWhenUsed="false" Name="Dark List Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful List Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Shading Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"   UnhideWhenUsed="false" Name="Light List Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Grid Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"   UnhideWhenUsed="false" Name="Dark List Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful List Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Shading Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"   UnhideWhenUsed="false" Name="Light List Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Grid Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"   UnhideWhenUsed="false" Name="Dark List Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful List Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="19" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/&gt;  &lt;w:LsdException Locked="false" Priority="21" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/&gt;  &lt;w:LsdException Locked="false" Priority="31" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/&gt;  &lt;w:LsdException Locked="false" Priority="32" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/&gt;  &lt;w:LsdException Locked="false" Priority="33" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Book Title"/&gt;  &lt;w:LsdException Locked="false" Priority="37" Name="Bibliography"/&gt;  &lt;w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/&gt; &lt;/w:LatentStyles&gt;&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;&lt;style&gt; /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman","serif";}&lt;/style&gt;&lt;![endif]--&gt;&lt;br /&gt;&lt;div class="MsoBodyText"&gt;The other day while reviewing an instance's alert log Ifound an interesting message: &lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;WARNING:Oracle instance running on a system with lowopen file descriptor&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;limit.Tune your system to increase this limit to avoid&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;severeperformance degradation.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;A quick search of MOS pointed me to bug 5862719.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;It turns out on our RAC system (10.2.0.2) onRHEL 4, the /etc/init.d/init.crsd file has the command "ulimit -nunlimited" in it, which fails and drops the file descriptor limit to itsdefault, which in our case is 1024.&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;% ps -ef | grep smon_dchdb&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;oracle&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;20720&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;0 Oct31 ?&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;00:00:16 ora_smon_dchdb1&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;% grep "open files" /proc/20720/limits&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;Max open files&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1024&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1024&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;files&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;The system recently crashed (which was why I was checkingthe alert log) and so all auto-started Oracle processes inherited their ulimitsfrom the init processes.&lt;/div&gt;&lt;div class="MsoBodyText"&gt;My point of this isn't to re-document an Oracle bug butemphasize the importance of taking a step back periodically and thinking thingsthrough.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;Is an FD limit of 1024potentially hurting our system, performance-wise?&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;If so, can I duplicate this elsewhere toprove the impact, justifying an emergency fix?&lt;/div&gt;&lt;div class="MsoBodyText"&gt;On Linux it's pretty easy to check on open file counts forprocesses running under the same account.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;As "oracle" I issued the following:&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;#------------------------------------------------------------------------------------|&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;# Check all "oracle" processes associatedwith database "dchdb" and ASM, grab the PID&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;# and current command, then count how many files areopened and display the results.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;#------------------------------------------------------------------------------------|&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;ps -f -u oracle | grep -E '(dchdb1|ASM)' | awk'{print $2" "$8}' | \&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;while readIN_PID IN_CMD&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;do&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;echo"Files opened for PID $IN_PID $IN_CMD: `ls -1 /proc/${IN_PID}/fd 2&amp;gt;/dev/null| wc -l`"&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;done | sort-nr -k7,7 | head -6&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in; text-indent: .5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;#-- output --#&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;Files opened for PID 21810 ora_rbal_dchdb1: 28&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;Files opened for PID 21790 ora_asmb_dchdb1: 28&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;Files opened for PID 22080 ora_arc1_dchdb1: 27&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;Files opened for PID 22174 ora_qmnc_dchdb1: 26&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;Files opened for PID 22078 ora_arc0_dchdb1: 26&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;"&gt;Files opened for PID 20859 ora_lck0_dchdb1: 24&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;No process has more than 28 files open, so a limit of 1024seems pretty safe.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;Yet the database hasa few hundred datafiles, so why isn't the number higher?&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;This is where ASM comes in to play.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;ASM bypasses the file system so database"files" aren't managed by the OS and FD's, so for the most part FDlimits have a different context when dealing with ASM.&lt;/div&gt;&lt;div class="MsoBodyText"&gt;Result?&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;While I believeit's not always wise to leave code as is even though 1 or more commands/partsare failing each time, in this case spending a bit of time to think thingsthrough allowed this change to be scheduled on a lower priority.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7992074158128225343-2467320582038810514?l=daveherringsdbablog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daveherringsdbablog.blogspot.com/feeds/2467320582038810514/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://daveherringsdbablog.blogspot.com/2011/11/ulimit-asm-and-thinking-things-through.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7992074158128225343/posts/default/2467320582038810514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7992074158128225343/posts/default/2467320582038810514'/><link rel='alternate' type='text/html' href='http://daveherringsdbablog.blogspot.com/2011/11/ulimit-asm-and-thinking-things-through.html' title='&quot;ulimit&quot;, ASM, and Thinking Things Through'/><author><name>Dave Herring</name><uri>http://www.blogger.com/profile/04843915655642313796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://2.bp.blogspot.com/_nIBX5V34b9I/SpqHS6w2pJI/AAAAAAAAADQ/LAPS45TFQvc/S220/Dave+at+Brit%27s+Grad.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7992074158128225343.post-5367123108317091745</id><published>2011-10-21T09:37:00.000-07:00</published><updated>2011-10-21T09:37:04.698-07:00</updated><title type='text'>Generating Extra Rows and the Right Cardinality</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt; &lt;w:WordDocument&gt;  &lt;w:View&gt;Normal&lt;/w:View&gt;  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;  &lt;w:TrackMoves/&gt;  &lt;w:TrackFormatting/&gt;  &lt;w:DoNotShowPropertyChanges/&gt;  &lt;w:PunctuationKerning/&gt;  &lt;w:ValidateAgainstSchemas/&gt;  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;  &lt;w:DoNotPromoteQF/&gt;  &lt;w:LidThemeOther&gt;EN-US&lt;/w:LidThemeOther&gt;  &lt;w:LidThemeAsian&gt;X-NONE&lt;/w:LidThemeAsian&gt;  &lt;w:LidThemeComplexScript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;  &lt;w:Compatibility&gt;   &lt;w:BreakWrappedTables/&gt;   &lt;w:SnapToGridInCell/&gt;   &lt;w:WrapTextWithPunct/&gt;   &lt;w:UseAsianBreakRules/&gt;   &lt;w:DontGrowAutofit/&gt;   &lt;w:SplitPgBreakAndParaMark/&gt;   &lt;w:DontVertAlignCellWithSp/&gt;   &lt;w:DontBreakConstrainedForcedTables/&gt;   &lt;w:DontVertAlignInTxbx/&gt;   &lt;w:Word11KerningPairs/&gt;   &lt;w:CachedColBalance/&gt;  &lt;/w:Compatibility&gt;  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;m:mathPr&gt;   &lt;m:mathFont m:val="Cambria Math"/&gt;   &lt;m:brkBin m:val="before"/&gt;   &lt;m:brkBinSub m:val="&amp;#45;-"/&gt;   &lt;m:smallFrac m:val="off"/&gt;   &lt;m:dispDef/&gt;   &lt;m:lMargin m:val="0"/&gt;   &lt;m:rMargin m:val="0"/&gt;   &lt;m:defJc m:val="centerGroup"/&gt;   &lt;m:wrapIndent m:val="1440"/&gt;   &lt;m:intLim m:val="subSup"/&gt;   &lt;m:naryLim m:val="undOvr"/&gt;  &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt;&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt; &lt;w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"  DefSemiHidden="true" DefQFormat="false" DefPriority="99"  LatentStyleCount="267"&gt;  &lt;w:LsdException Locked="false" Priority="0" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Normal"/&gt;  &lt;w:LsdException Locked="false" Priority="0" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="heading 1"/&gt;  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/&gt;  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/&gt;  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/&gt;  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/&gt;  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/&gt;  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/&gt;  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/&gt;  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/&gt;  &lt;w:LsdException Locked="false" Priority="39" Name="toc 1"/&gt;  &lt;w:LsdException Locked="false" Priority="39" Name="toc 2"/&gt;  &lt;w:LsdException Locked="false" Priority="39" Name="toc 3"/&gt;  &lt;w:LsdException Locked="false" Priority="39" Name="toc 4"/&gt;  &lt;w:LsdException Locked="false" Priority="39" Name="toc 5"/&gt;  &lt;w:LsdException Locked="false" Priority="39" Name="toc 6"/&gt;  &lt;w:LsdException Locked="false" Priority="39" Name="toc 7"/&gt;  &lt;w:LsdException Locked="false" Priority="39" Name="toc 8"/&gt;  &lt;w:LsdException Locked="false" Priority="39" Name="toc 9"/&gt;  &lt;w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/&gt;  &lt;w:LsdException Locked="false" Priority="10" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Title"/&gt;  &lt;w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/&gt;  &lt;w:LsdException Locked="false" Priority="11" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/&gt;  &lt;w:LsdException Locked="false" Priority="0" Name="Hyperlink"/&gt;  &lt;w:LsdException Locked="false" Priority="22" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Strong"/&gt;  &lt;w:LsdException Locked="false" Priority="20" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/&gt;  &lt;w:LsdException Locked="false" Priority="59" SemiHidden="false"   UnhideWhenUsed="false" Name="Table Grid"/&gt;  &lt;w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/&gt;  &lt;w:LsdException Locked="false" Priority="1" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/&gt;  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Shading"/&gt;  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"   UnhideWhenUsed="false" Name="Light List"/&gt;  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Grid"/&gt;  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 1"/&gt;  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 2"/&gt;  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 1"/&gt;  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 2"/&gt;  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 1"/&gt;  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 2"/&gt;  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 3"/&gt;  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"   UnhideWhenUsed="false" Name="Dark List"/&gt;  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Shading"/&gt;  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful List"/&gt;  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Grid"/&gt;  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Shading Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"   UnhideWhenUsed="false" Name="Light List Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Grid Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/&gt;  &lt;w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/&gt;  &lt;w:LsdException Locked="false" Priority="34" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/&gt;  &lt;w:LsdException Locked="false" Priority="29" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Quote"/&gt;  &lt;w:LsdException Locked="false" Priority="30" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/&gt;  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"   UnhideWhenUsed="false" Name="Dark List Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful List Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/&gt;  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Shading Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"   UnhideWhenUsed="false" Name="Light List Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Grid Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"   UnhideWhenUsed="false" Name="Dark List Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful List Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/&gt;  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Shading Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"   UnhideWhenUsed="false" Name="Light List Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Grid Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"   UnhideWhenUsed="false" Name="Dark List Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful List Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/&gt;  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Shading Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"   UnhideWhenUsed="false" Name="Light List Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Grid Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"   UnhideWhenUsed="false" Name="Dark List Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful List Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/&gt;  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Shading Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"   UnhideWhenUsed="false" Name="Light List Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Grid Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"   UnhideWhenUsed="false" Name="Dark List Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful List Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/&gt;  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Shading Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"   UnhideWhenUsed="false" Name="Light List Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Grid Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"   UnhideWhenUsed="false" Name="Dark List Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful List Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/&gt;  &lt;w:LsdException Locked="false" Priority="19" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/&gt;  &lt;w:LsdException Locked="false" Priority="21" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/&gt;  &lt;w:LsdException Locked="false" Priority="31" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/&gt;  &lt;w:LsdException Locked="false" Priority="32" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/&gt;  &lt;w:LsdException Locked="false" Priority="33" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Book Title"/&gt;  &lt;w:LsdException Locked="false" Priority="37" Name="Bibliography"/&gt;  &lt;w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/&gt; &lt;/w:LatentStyles&gt;&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;&lt;style&gt; /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman","serif";}&lt;/style&gt;&lt;![endif]--&gt;&lt;br /&gt;&lt;div class="MsoNormal"&gt;Periodically I find code executed on databases I supportthat is used to generate x number of extra rows, normally to produce a set ofliteral values as a table.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;For example,recently I found the following embedded as an inline view in a rather large query:&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt;"&gt;(SELECT LAST_DAY(ADD_MONTHS(:in_date, -1))work_date, -1 rws_back&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;FROM dual UNION&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;SELECTLAST_DAY(ADD_MONTHS(:in_date, -2)), -2&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;FROM dual UNION&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;SELECTLAST_DAY(ADD_MONTHS(:in_date, -3)), -3&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;FROMdual UNION&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;...&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;SELECTLAST_DAY(ADD_MONTHS(:in_date, -13)), -13&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;FROM dual) in_dt_view&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;The idea was to generate a 13-row table, with each rowholding a date counting backwards 1 month from the previous row.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;Those 26 lines of SQL could have easily beenwritten as:&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt;"&gt;(SELECT /*+ CARDINALITY(d 13) */ LAST_DAY(ADD_MONTHS(sysdate,(level*-1))) work_date&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;, (level*-1) rws_back&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;FROMdual d&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt;"&gt;CONNECT BY level &amp;lt;= 13) in_dt_view&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Using "CONNECT BY level &amp;lt;=" is a handy way ofgenerating x number of rows for any number of purposes, not only in situationslike the above one but also for generating data when conducting tests.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;This change isn't meant to tune the query (itdoes take a smidge less Shared Pool space) but make it easier to write (imagineif they needed 48 months back in time).&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span&gt;Using "CONNECT BY level &amp;lt;=" isn't something new as there are many examples of this technique on the internet.&amp;nbsp; But for whatever reason it doesn't seem to be used that often in production code, instead mostly in code for generating data and/or presentations.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;But why the CARDINALITY hint?&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;Without it the optimizer thinks only 1 rowwill be returned as DUAL has only 1 row and the optimizer doesn't try todetermine the row count generated by "CONNECT BY …".&amp;nbsp; Tom Kyte has a great discussion about this hint at &lt;a href="http://tinyurl.com/4x2s7zk"&gt;http://tinyurl.com/4x2s7zk&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7992074158128225343-5367123108317091745?l=daveherringsdbablog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daveherringsdbablog.blogspot.com/feeds/5367123108317091745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://daveherringsdbablog.blogspot.com/2011/10/generating-extra-rows-and-right.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7992074158128225343/posts/default/5367123108317091745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7992074158128225343/posts/default/5367123108317091745'/><link rel='alternate' type='text/html' href='http://daveherringsdbablog.blogspot.com/2011/10/generating-extra-rows-and-right.html' title='Generating Extra Rows and the Right Cardinality'/><author><name>Dave Herring</name><uri>http://www.blogger.com/profile/04843915655642313796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://2.bp.blogspot.com/_nIBX5V34b9I/SpqHS6w2pJI/AAAAAAAAADQ/LAPS45TFQvc/S220/Dave+at+Brit%27s+Grad.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7992074158128225343.post-8795320734293830002</id><published>2011-04-18T15:31:00.000-07:00</published><updated>2011-04-18T15:31:48.849-07:00</updated><title type='text'>Connection Total Mismatch between Listener and Database</title><content type='html'>&lt;br /&gt;&lt;div class="MsoBodyText"&gt;Normally I don't spend a lot of time reviewing connectiondetails in my client's listener logs, but I came across a situation recentlywhere failover and connection distribution were being questioned, so I figuredit'd be best to review listener log data just to be safe.&amp;nbsp; What I ended up finding was that connectioncounts as recorded in the listener logs was nearly twice that of what"logons cumulative" statistic was showing, which in my mind wasn'tright.&lt;/div&gt;&lt;div class="MsoBodyText"&gt;To perform any type of listener log analysis, I firstneeded some sort of tool, as the system involved is a 4-node OLTP RAC with100,000's of connections happening per day.&amp;nbsp;Fortunately Arup Nanda did most of this work for me, based on his DBAzinearticle on 9/16/08 entitled "Mining Information from the ListenerLog".&amp;nbsp; I used his notes to create anExternal Table for pointing to a given listener log and an Oracle function forproperly parsing out details within lines of the listener log.&amp;nbsp; (See the end of this article for SQL queriesinvolved to help analyze the data.)&lt;/div&gt;&lt;div class="MsoBodyText"&gt;As for the hardware and database involved, the followinguses simplified names of targets to help illustrate the problem:&lt;/div&gt;&lt;div class="BulletedList1"&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;4-node RAC running RHEL 4.8 and Oracle 10.2.0.2.&lt;/li&gt;&lt;li&gt;Nodes are named RAC1, RAC2, RAC3, and RAC4 withone 1 Instance of the database on each, named inst1, inst2, inst3, and inst4&lt;/li&gt;&lt;li&gt;2 Oracle Services are defined to use Inst1 andInst2 as a strictly OLTP set of balanced Instances (service "inst1and2")and use Inst3 and Inst4 as a strictly Batch set of balanced Instances (service"batch1and2").&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;Back to the problem, I found that Service"inst1and2" was getting 1,000's of connections per hour againstInstances Inst3 and Inst4, which from my understanding couldn't happen.&amp;nbsp; I used "srvctl" as one way tovalidate this Service's definition, just to be sure:&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;% srvctl config service -d$db_unique_name -a&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;inst1and2 PREF: inst1 inst2AVAIL:&amp;nbsp; TAF: NONE&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;batch1and2 PREF: inst3 inst4AVAIL:&amp;nbsp; TAF: NONE&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;As a last check, I asked the Application team to send methe exact connection string they were using.&amp;nbsp;Sure enough, this pointed out the problem:&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;(DESCRIPTION = (ADDRESS =(PROTOCOL = TCP)(HOST = RACVIP3)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST= RACVIP4)(PORT = 1521)) (LOAD_BALANCE = yes)(FAILOVER = ON) (CONNECT_DATA =(SERVER = DEDICATED) (SERVICE_NAME = inst1and2)(FAILOVER_MODE = (TYPE = SELECT)(METHOD = BASIC))))&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;Testing this from my PC using "sqlplususer/pass@'&lt;connect above="" listed="" string=""&gt;' ", I reproduced theproblem.&amp;nbsp; I found that RAC3 / 4'slistener log recorded a connection:&lt;/connect&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;18-APR-2011 09:52:03 *(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=inst1and2)(FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC))(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\bin\sqlplus.exe)(HOST=myserver123)(USER=ME)))* (ADDRESS=(PROTOCOL=tcp)(HOST=...)(PORT=1234)) * establish * inst1and2 * 0&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;… and also RAC1 / 2's listener log recorded a connection:&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;18-APR-2011 09:52:03 *(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=inst1and2)(FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC))(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\bin\sqlplus.exe)(HOST=myserver123)(USER=ME))(INSTANCE_NAME=inst1))* (ADDRESS=(PROTOCOL=tcp)(HOST=...)(PORT=2345)) * establish * inst1and2 * 0&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;Notice the string "…INSTANCE_NAME…" in thelistener log entry for RAC1 / 2.&amp;nbsp;According to MOS document 263599.1, when this is present it represents aredirected connection, which is true in the test case above.&amp;nbsp; Simple enough, except that this stringDOESN'T occur in any of listener log entries in question.&amp;nbsp; Further down in the same MOS document,there's a short blurb about thin jdbc connections and that if these connectionsare redirected, there won't be any mention of this in the listener log, as inthe string INSTANCE_NAME won't be present.&lt;/div&gt;&lt;div class="MsoBodyText"&gt;This matches my case, as all application servers involvedare connecting via thin jdbc.&amp;nbsp; MOSdocument 263599.1 also points out that "lsnrctl services" can alsopoint out connect redirects.&amp;nbsp; CheckingRAC4 I see the following:&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Service "inst1and2"has 2 instance(s).&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;Instance "inst1", status READY, has 1 handler(s) for thisservice...&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Handler(s):&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "DEDICATED" established:658909refused:0 state:ready&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REMOTE SERVER&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(ADDRESS=(PROTOCOL=TCP)(HOST=RAC1)(PORT=1521))&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;Instance "inst2", status READY, has 1 handler(s) for thisservice...&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Handler(s):&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "DEDICATED" established:737610refused:0 state:ready&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REMOTE SERVER&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(ADDRESS=(PROTOCOL=TCP)(HOST=RAC2)(PORT=1521))&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;For Service "inst1and2" on RAC4, 659,909connections have been redirected to "inst1" and 737,610 connectionshave been redirected to "inst2", all since the listener was lastrestarted.&lt;/div&gt;&lt;div class="MsoBodyText"&gt;Although all of this helps account for any connectioncount discrepancies between the listener log and database statistic"logons cumulative", I'm left with having to check "lsnrctlservices" and connect strings from application servers to help tie it alltogether.&amp;nbsp; It'd sure be a lot easier, atleast to me, for Oracle to have included a message like "redirect"within the listener log entry to point out what happened.&lt;/div&gt;&lt;h1&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;SQL Code&lt;/span&gt;&lt;/h1&gt;&lt;div class="MsoBodyText"&gt;The following is an example of a query I used to analyzelistener log data via an external table.&amp;nbsp;I'm including this as I found a few cases where the data didn't line upas expected and I had to use a bit that knowledge to handle most of thosecases.&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;SELECT min_log_date,max_log_date,&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CASE WHENparse_listener_log_line_fnc(connect_string, 'HOST') IS NOT NULL AND&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;parse_listener_log_line_fnc(connect_string, 'HOST') NOT IN ('__jdbc__')&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;THENparse_listener_log_line_fnc(connect_string, 'HOST')&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;ELSEREGEXP_REPLACE(REGEXP_REPLACE(protocol_info,&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'(^.*HOST=)([0-9]+.[0-9]+.[0-9]+.[0-9]+).*\$','\2'),&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'(^.*HOST=)(lnx|racvip){1}([0-9]+.us.dnb.com).*\$','\2\3')&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END source_machine&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,NVL(parse_listener_log_line_fnc(connect_string, 'PROGRAM'),&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parse_listener_log_line_fnc(connect_string,'HOST'))&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , CASE WHEN connect_string IN ('ping','service_update', 'status') THEN connect_string&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHEN protocol_info IN ('services','status') THEN protocol_info&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;ELSE action &lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END operation&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , NVL(service_name, protocol_info)service, return_code, COUNT(*)&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;FROM listener_log_tb&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , (SELECT MIN(log_date) min_log_date,MAX(log_date) max_log_date&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM listener_log_tb)&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;GROUP BY min_log_date, max_log_date&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;,CASE WHEN parse_listener_log_line_fnc(connect_string, 'HOST') IS NOT NULL AND&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;parse_listener_log_line_fnc(connect_string,'HOST') NOT IN ('__jdbc__')&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;THENparse_listener_log_line_fnc(connect_string, 'HOST')&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ELSEREGEXP_REPLACE(REGEXP_REPLACE(protocol_info,&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'(^.*HOST=)([0-9]+.[0-9]+.[0-9]+.[0-9]+).*\$','\2'),&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'(^.*HOST=)(lnx|racvip){1}([0-9]+.us.dnb.com).*\$','\2\3')&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;,NVL(parse_listener_log_line_fnc(connect_string, 'PROGRAM'),&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;parse_listener_log_line_fnc(connect_string,'HOST'))&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;,CASE WHEN connect_string IN ('ping', 'service_update', 'status') THENconnect_string&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;WHENprotocol_info IN ('services', 'status') THEN protocol_info&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ELSE action &lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;,NVL(service_name, protocol_info), return_code;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7992074158128225343-8795320734293830002?l=daveherringsdbablog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daveherringsdbablog.blogspot.com/feeds/8795320734293830002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://daveherringsdbablog.blogspot.com/2011/04/connection-total-mismatch-between.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7992074158128225343/posts/default/8795320734293830002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7992074158128225343/posts/default/8795320734293830002'/><link rel='alternate' type='text/html' href='http://daveherringsdbablog.blogspot.com/2011/04/connection-total-mismatch-between.html' title='Connection Total Mismatch between Listener and Database'/><author><name>Dave Herring</name><uri>http://www.blogger.com/profile/04843915655642313796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://2.bp.blogspot.com/_nIBX5V34b9I/SpqHS6w2pJI/AAAAAAAAADQ/LAPS45TFQvc/S220/Dave+at+Brit%27s+Grad.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7992074158128225343.post-2988645005105179040</id><published>2010-10-03T13:33:00.000-07:00</published><updated>2010-10-03T13:33:22.590-07:00</updated><title type='text'>Red Hat 4.x to 5.x fuser "Enhancement"</title><content type='html'>&lt;br /&gt;&lt;div class="MsoNormal"&gt;I came across an interesting situation related to an upgradeof Red Hat.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;Due to planned upgrades ofOracle 10g to 11g, we are first performing upgrades of RH from 4.x to 5.x.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;Normally an OS upgrade would involve sanity checks that nothing breaks, butyou'd expect your basic Unix commands to behave the same.&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Yet after running a few DBA maintenance scripts I found aproblem with one script that was using "fuser".&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;Our script checks a list of files to see ifany are currently open and if so, it processes them differently.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;The problem was that under RH 5.x (5.3,specifically), where "fuser" piped to "cut":&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="text-indent: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt;"&gt;for active_file in `fuser $dir/$sub/* 2&amp;gt;&amp;amp;1 |cut -d\: -f1`&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;In the snipet of code above under RH 5.3, it appeared thatboth files and the PID from "fuser" were getting returned, as if"cut" didn't work at all.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;After closer investigation it turned out that "fuser" was theguilty party.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;I ran a simple test on adatabase server with Oracle running, knowing that "libclntsh*" wouldbe open.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Using the command:&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt;"&gt;fuser $ORACLE_HOME/lib/libclntsh* | cut -d\: -f1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;… under RH 4 you'll get:&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt;"&gt;/ora01/app/oracle/product/10.2.0/db_1/lib/libclntsh.so&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt;"&gt;/ora01/app/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;… while under RH 5 you'll get:&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt;"&gt;/ora01/app/oracle/product/10.2.0/db_1/lib/libclntsh.so:m&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt;"&gt;/ora01/app/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1:m&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt;"&gt;&amp;nbsp; 7309&amp;nbsp; 7309&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;I did a crazy thing and checked the "man" pagesfor "fuser" to see if I was missing something and sure enough, I was:a change in RH 5!&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;See the following linelisted right before the &lt;b style="mso-bidi-font-weight: normal;"&gt;OPTIONS&lt;/b&gt;section:&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;b style="mso-bidi-font-weight: normal;"&gt;fuser&lt;/b&gt; outputs only the PIDs tostdout, everything else is sent to stderr.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;That explains the difference in behavior between releases.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;Fortunately the workaround is easy: redirectstderr to stdout.&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Fortunately I caught this, but I wonder what other changesare lurking out there?&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7992074158128225343-2988645005105179040?l=daveherringsdbablog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daveherringsdbablog.blogspot.com/feeds/2988645005105179040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://daveherringsdbablog.blogspot.com/2010/10/red-hat-4x-to-5x-fuser-enhancement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7992074158128225343/posts/default/2988645005105179040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7992074158128225343/posts/default/2988645005105179040'/><link rel='alternate' type='text/html' href='http://daveherringsdbablog.blogspot.com/2010/10/red-hat-4x-to-5x-fuser-enhancement.html' title='Red Hat 4.x to 5.x fuser &quot;Enhancement&quot;'/><author><name>Dave Herring</name><uri>http://www.blogger.com/profile/04843915655642313796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://2.bp.blogspot.com/_nIBX5V34b9I/SpqHS6w2pJI/AAAAAAAAADQ/LAPS45TFQvc/S220/Dave+at+Brit%27s+Grad.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7992074158128225343.post-5972522039466922010</id><published>2010-03-21T17:58:00.000-07:00</published><updated>2010-03-21T17:58:57.561-07:00</updated><title type='text'>SQL*Plus &amp; Command History with Cygwin + rlwrap</title><content type='html'>&lt;br /&gt;&lt;div class="MsoBodyText"&gt;Although nearly all apps today are use some sort ofpoint-click, windowing front end, there are plenty of us who still use thecommand-line when available.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;It's notthat we're set in our ways, it's that for many repetative tasks, the command-lineprovides us with enough shortcuts that we're just way more efficient with a fewkey strokes.&lt;/div&gt;&lt;div class="MsoBodyText"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;This brings me to Oracle's SQL*Plus, or more specifically,running "sqlplus" from the command-line.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;"sqlplus" has long provided theability to edit the previous command in it's buffer, either pulling it up intoan editor or using a few commands to change it in place (such as "&lt;u&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;C&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;HANGE/&lt;old&gt;/&lt;new&gt;&lt;/new&gt;&lt;/old&gt;&lt;/span&gt;&lt;/span&gt;").&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;But obviously this is limited.&lt;/div&gt;&lt;div class="MsoBodyText"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;In comes "rlwrap".&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;This application is also nothing new, but didyou know it's available from within Cygwin?&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;This issue came up during Tanel Poder's recent Training Day at HotsosSymposium 2010.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;He gave some greatexamples of "rlwrap"'s power using it from Linux, then laid thegauntlet down by saying it &lt;i style="mso-bidi-font-style: normal;"&gt;should&lt;/i&gt;work under Cygwin, but he hasn't tried it and we should let him know if we canget it working.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;That was enough for me!&lt;/div&gt;&lt;div class="MsoBodyText"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;I've used Cygwin for some time as a way to start an XWinserver, in support of other apps that require it (such as Oracle's installer).&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;I reviewed the my installation source (&lt;a href="http://x.cygwin.com/"&gt;x.cygwin.com&lt;/a&gt;)and ran the installation again to see if "rlwrap" is available.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;Sure enough, if you change the &lt;u&gt;V&lt;/u&gt;iew tobe by Category, then you'll file "rlwrap" under Utils:&lt;/div&gt;&lt;div class="MsoBodyText"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_nIBX5V34b9I/S6a9pg-xwwI/AAAAAAAAAIE/nfuVCXvCoOs/s1600-h/cygwin_install.GIF" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="387" src="http://4.bp.blogspot.com/_nIBX5V34b9I/S6a9pg-xwwI/AAAAAAAAAIE/nfuVCXvCoOs/s640/cygwin_install.GIF" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;In the screenshot above you can see "rlwrap" isalready installed, but this was taken from my current install, so you get theidea.&lt;/div&gt;&lt;div class="MsoBodyText"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;The installation process dumps "rlwrap" under c:\cygwin\binby default.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;Now comes the power of thetool!&lt;/div&gt;&lt;div class="MsoBodyText"&gt;From your PC, open a Cygwin XWin server to work off of, thenan xterm from this XWin server session.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;From the xterm session you can fire off your "rlwrap"commands.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;You can run themfrom the XWin server session, but I prefer to instead use that as a centralsession, firing off separate xterm sessions per connection I plan on making.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;In my $HOME directory I created a setupscript which defines a series of aliases, one per color-coded xterm screen:&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;alias black="xterm -fn '-adobe-courier-*-r-*-*-12-*-*-*-*-*-10' -ls -geometry 140x35+50+20 -bg black-fg gainsboro &amp;amp;"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;alias brown="xterm&amp;nbsp; -fn '-adobe-courier-*-r-*-*-12-*-*-*-*-*-10'-ls -geometry 140x35+50+20 -bg brown -fg gainsboro &amp;amp;"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;alias blue="xterm&amp;nbsp; -fn'-adobe-courier-*-r-*-*-12-*-*-*-*-*-10' -ls -geometry 140x35+50+20 -bgdarkblue -fg gainsboro &amp;amp;"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;alias darkred="xterm&amp;nbsp; -fn '-adobe-courier-*-r-*-*-12-*-*-*-*-*-10' -ls -geometry 140x35+50+20 -bg darkred -fg gainsboro &amp;amp;"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;alias green="xterm&amp;nbsp; -fn'-adobe-courier-*-r-*-*-12-*-*-*-*-*-10' -ls -geometry 140x35+50+20 -bggreen4 -fg gainsboro &amp;amp;"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;alias purple="xterm&amp;nbsp; -fn '-adobe-courier-*-r-*-*-12-*-*-*-*-*-10' -ls -geometry 140x35+50+20 -bg purple4 -fg gainsboro &amp;amp;"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;alias teal="xterm&amp;nbsp; -fn'-adobe-courier-*-r-*-*-12-*-*-*-*-*-10' -ls -geometry 140x35+50+20 -bgdarkcyan -fg gainsboro &amp;amp;"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;alias white="xterm -fn'-adobe-courier-*-r-*-*-12-*-*-*-*-*-10' -ls -geometry 140x35+50+20 -bg white-fg black &amp;amp;"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;This way typing "blue", for example, quicklygives me a new blue background, white foreground xterm.&lt;/div&gt;&lt;div class="MsoBodyText"&gt;Back to "rlwrap" power.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;A simple example of the command is asfollows:&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;rlwrap -r sqlplus dherri@ORCL1&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;Within this sqlplus session I now have full command-linehistory using the arrow keys.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;Plus withthe "-r" argument, "rlwrap" will "remember", soto speak, all text that passes on the screen.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;What this means is through the TAB key you can now quickly access outputfrom previous queries.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;For example, supposeyou wanted to query an AWR view but couldn't remember the name.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;So you enter:&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;SELECT view_name &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;FROM dba_views &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;WHERE view_name LIKE 'DBA_HIST%' &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;ORDER BY 1;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;Now the output list of view names is in rlwrap's buffer,which means the view names are available for command completion.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;If you enter:&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;SELECT * FROM DBA_HIST_SQL&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;… and hit TAB twice, you'll get the following displayed:&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;DBA_HIST_SQLBIND&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBA_HIST_SQLTEXT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBA_HIST_SQL_PLAN&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBA_HIST_SQL_WORKAREA_HSTGRM&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;DBA_HIST_SQLSTAT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBA_HIST_SQL_BIND_METADATA&amp;nbsp;&amp;nbsp;&amp;nbsp; DBA_HIST_SQL_SUMMARY&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode" style="margin-left: .5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;This is just a small sampling of what "rlwrap"can provide in terms of added efficiency within sqlplus command-line or fornearly any app for that matter (RMAN quickly comes to mind).&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;The main point I'm raising here is Windowsusers need not be excluded from the benefits of command-line completion using "rlwrap".&lt;/div&gt;&lt;div class="MsoBodyText"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;For more detail on "rlwrap" and excellentexamples of applying its use, see Tanel Poder's blog @&amp;nbsp;&lt;a href="http://blog.tanelpoder.com/"&gt;blog.tanelpoder.com&lt;/a&gt;&amp;nbsp;or his new tech site @&amp;nbsp;&lt;a href="http://tech.e2sn.com/"&gt;tech.e2sn.com&lt;/a&gt;.&lt;/div&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7992074158128225343-5972522039466922010?l=daveherringsdbablog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daveherringsdbablog.blogspot.com/feeds/5972522039466922010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://daveherringsdbablog.blogspot.com/2010/03/sqlplus-command-history-with-cygwin.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7992074158128225343/posts/default/5972522039466922010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7992074158128225343/posts/default/5972522039466922010'/><link rel='alternate' type='text/html' href='http://daveherringsdbablog.blogspot.com/2010/03/sqlplus-command-history-with-cygwin.html' title='SQL*Plus &amp; Command History with Cygwin + rlwrap'/><author><name>Dave Herring</name><uri>http://www.blogger.com/profile/04843915655642313796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://2.bp.blogspot.com/_nIBX5V34b9I/SpqHS6w2pJI/AAAAAAAAADQ/LAPS45TFQvc/S220/Dave+at+Brit%27s+Grad.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_nIBX5V34b9I/S6a9pg-xwwI/AAAAAAAAAIE/nfuVCXvCoOs/s72-c/cygwin_install.GIF' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7992074158128225343.post-4793790331896479982</id><published>2009-08-28T15:41:00.000-07:00</published><updated>2009-09-03T13:39:09.510-07:00</updated><title type='text'>Parallelism "Secretly" Disabled by User Function</title><content type='html'>&lt;div class="MsoBodyText"&gt;Ever work on a problem where initial observation and past experience says "1 + 1 = 2" yet it keeps coming out "3"?  I recently ran into a situation like this, where all past experience told me that the query should run with parallelism and even the xplan showed it would, yet during the execution of the query I could tell it was running serially.&lt;/div&gt;&lt;div class="MsoBodyText"&gt;A simplified version of the original query is listed below, involving 3 tables that all had a parallel degree of 8:&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="ComputerCode"&gt;&lt;span style="font-family: 'courier new'; font-size: x-small;"&gt;SELECT std_function_pkg.domain_group_fnc(dn.domain, dn.domain_suffix)&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode"&gt;&lt;span style="font-family: 'courier new'; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; , MAX(CASE WHEN event_type = 'C' THEN e.event_date ELSE NULL END) latest_type&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode"&gt;&lt;span style="font-family: 'courier new'; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;FROM dn_tb dn LEFT OUTER JOIN vlm_sum_tb vlm&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode"&gt;&lt;span style="font-family: 'courier new'; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ON (dn.member_id = vlm.member_id)&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode"&gt;&lt;span style="font-family: 'courier new'; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LEFT OUTER JOIN&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode"&gt;&lt;span style="font-family: 'courier new'; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; event_tb PARTITION (v8) e&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode"&gt;&lt;span style="font-family: 'courier new'; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ON ( &amp;nbsp; &amp;nbsp;dn.member_id = e.member_id&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode"&gt;&lt;span style="font-family: 'courier new'; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AND e.vendor_id = 13569&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode"&gt;&lt;span style="font-family: 'courier new'; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AND e.event_type IN ('O','C'))&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode"&gt;&lt;span style="font-family: 'courier new'; font-size: x-small;"&gt;&amp;nbsp;GROUP BY std_function_pkg.domain_group_fnc(dn.domain, dn.domain_suffix);&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode"&gt;&lt;span style="font-family: 'courier new'; font-size: x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;This query yields an xplan as follows:&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="ComputerCode"&gt;&lt;span style="font-family: 'courier new'; font-size: x-small;"&gt;&lt;br /&gt;&lt;pre&gt;--------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;| Id|Operation                     | Name           | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |  TQ  |IN-OUT| PQ Distrib&lt;br /&gt;--------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;|  0|SELECT STATEMENT              |                | 14960 |   613K| 83941   (5)| 00:16:48 |       |       |      |      |&lt;br /&gt;|  1| PX COORDINATOR FORCED SERIAL |                |       |       |            |          |       |       |      |      |&lt;br /&gt;|  2|  PX SEND QC (RANDOM)         | :TQ10003       | 14960 |   613K| 83941   (5)| 00:16:48 |       |       |Q1,03 | P-&amp;gt;S |QC (RAND)&lt;br /&gt;|  3|   SORT GROUP BY              |                | 14960 |   613K| 83941   (5)| 00:16:48 |       |       |Q1,03 | PCWP |&lt;br /&gt;|  4|    PX RECEIVE                |                | 14960 |   613K| 83941   (5)| 00:16:48 |       |       |Q1,03 | PCWP |&lt;br /&gt;|  5|     PX SEND HASH             | :TQ10002       | 14960 |   613K| 83941   (5)| 00:16:48 |       |       |Q1,02 | P-&amp;gt;P | HASH&lt;br /&gt;|  6|      SORT GROUP BY           |                | 14960 |   613K| 83941   (5)| 00:16:48 |       |       |Q1,02 | PCWP |&lt;br /&gt;|  7|       NESTED LOOPS OUTER     |                |  4568K|   182M| 83713   (4)| 00:16:45 |       |       |Q1,02 | PCWP |&lt;br /&gt;|* 8|        HASH JOIN RIGHT OUTER |                |   253K|  6444K|    54   (6)| 00:00:01 |       |       |Q1,02 | PCWP |&lt;br /&gt;|  9|         PX RECEIVE           |                |   286K|  1676K|     7   (0)| 00:00:01 |       |       |Q1,02 | PCWP |&lt;br /&gt;| 10|          PX SEND HASH        | :TQ10000       |   286K|  1676K|     7   (0)| 00:00:01 |       |       |Q1,00 | P-&amp;gt;P | HASH&lt;br /&gt;| 11|           PX BLOCK ITERATOR  |                |   286K|  1676K|     7   (0)| 00:00:01 |     1 |    16 |Q1,00 | PCWC |&lt;br /&gt;| 12|            TABLE ACCESS FULL | VLM_SUM_TB     |   286K|  1676K|     7   (0)| 00:00:01 |     1 |    16 |Q1,00 | PCWP |&lt;br /&gt;| 13|         PX RECEIVE           |                |   253K|  4957K|    46   (5)| 00:00:01 |       |       |Q1,02 | PCWP |&lt;br /&gt;| 14|          PX SEND HASH        | :TQ10001       |   253K|  4957K|    46   (5)| 00:00:01 |       |       |Q1,01 | P-&amp;gt;P | HASH&lt;br /&gt;| 15|           PX BLOCK ITERATOR  |                |   253K|  4957K|    46   (5)| 00:00:01 |     1 |    16 |Q1,01 | PCWC |&lt;br /&gt;| 16|            TABLE ACCESS FULL | DN_TB          |   253K|  4957K|    46   (5)| 00:00:01 |     1 |    16 |Q1,01 | PCWP |&lt;br /&gt;| 17|        PARTITION RANGE SINGLE|                |    18 |   288 |            |          |     8 |     8 |Q1,02 | PCWP |&lt;br /&gt;| 18|         PARTITION LIST INLIST|                |    18 |   288 |            |          |KEY(I) |KEY(I) |Q1,02 | PCWP |&lt;br /&gt;| 19|          VIEW                |                |    18 |   288 |            |          |       |       |Q1,02 | PCWP |&lt;br /&gt;|*20|           TABLE ACCESS FULL  | EVENT_TB       |    18 |   324 | 51903   (7)| 00:10:23 |KEY(I) |KEY(I) |Q1,02 | PCWP |&lt;br /&gt;--------------------------------------------------------------------------------------------------------------------------------------&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="ComputerCode"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;As you can see from the xplan, the query should use parallelism.  Yet when monitoring the system while the query was running, I saw that V$PX_SESSION returned 0 rows (meaning no PX slaves were active) and that the only session involved in the query was generating "db file scattered read" waits, which is a non-parallel read wait.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;I ended up taking the trial and error approach, finding a basic version of the query that ran properly with parallelism, then added back items from the column list and GROUP BY section until parallelism was removed.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;It turns out that the call to the user function DOMAIN_GROUP_FNC was the culprit.  From there I found out, by isolating the function from the package, that the function itself wasn't the problem but definitions for the function WITHIN the package was the problem.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;Within the package STD_FUNCTION_PKG, the function declaration was followed by the directive: &lt;span style="font-family: 'courier new'; font-size: x-small;"&gt;pragma restrict_references(domain_group_fnc, WNPS);&lt;/span&gt;  I don't know the original intent of the programmers who added this, but for a parallel query, this won't work since the documentation clearly states that all four constraints (RNDS, RNPS, WNDS, WNPS)  must be specified when using a parallel query.  Plus, the clause PARALLEL_ENABLE needs to be added when the function is contained within a package (for that function to allow the query to run with parallelism).&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;In the end, it points out that wait events are not only key for resolving performance issues, but an excellent method for determining what the query is really doing.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7992074158128225343-4793790331896479982?l=daveherringsdbablog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daveherringsdbablog.blogspot.com/feeds/4793790331896479982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://daveherringsdbablog.blogspot.com/2009/08/parallelism-secretly-disabled-by-user.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7992074158128225343/posts/default/4793790331896479982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7992074158128225343/posts/default/4793790331896479982'/><link rel='alternate' type='text/html' href='http://daveherringsdbablog.blogspot.com/2009/08/parallelism-secretly-disabled-by-user.html' title='Parallelism &quot;Secretly&quot; Disabled by User Function'/><author><name>Dave Herring</name><uri>http://www.blogger.com/profile/04843915655642313796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://2.bp.blogspot.com/_nIBX5V34b9I/SpqHS6w2pJI/AAAAAAAAADQ/LAPS45TFQvc/S220/Dave+at+Brit%27s+Grad.jpg'/></author><thr:total>1</thr:total></entry></feed>
