﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Bert Scalzo's Blog</title>
    <description>&lt;table&gt;
        &lt;tr&gt;
            &lt;td valign="top"&gt;&lt;img height="183" alt="" width="139" src="/Portals/0/Blog/blog-bert-scalzo.png" /&gt;&lt;/td&gt;
            &lt;td valign="top"&gt;Bert Scalzo is a product architect for Quest Software,&amp;#160;a member of the Toad team and an &lt;a href="http://www.oracle.com/technology/community/oracle_ace/index.html"&gt;Oracle ACE&lt;/a&gt;. He has worked with Oracle databases for over two decades; his key areas of interest are data modeling, database benchmarking, tuning and optimization, "Star Schema" data warehouses and Linux. Bert is the author of several books and has written articles for many online outlets and publications,&amp;#160;and has presented at numerous Oracle conferences and user groups.
            &lt;p&gt;Bert's blog provides useful Toad “how to” and “tips and tricks” covering topics on database admin and benchmarking.&lt;/p&gt;
            &lt;p&gt;&lt;font color="#003366" size="3"&gt;&lt;strong&gt;Recent postings:&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
&lt;/table&gt;</description>
    <link>http://www.toadworld.com/BLOGS/tabid/67/BlogId/14/Default.aspx</link>
    <language>en-US</language>
    <managingEditor>Bert Scalzo</managingEditor>
    <webMaster>webmaster@toadworld.com</webMaster>
    <pubDate>Wed, 17 Mar 2010 21:16:21 GMT</pubDate>
    <lastBuildDate>Wed, 17 Mar 2010 21:16:21 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>Blog RSS Generator Version 3.2.0.15477</generator>
    <item>
      <title>Toad Sometimes Slow on Oracle 10g?</title>
      <description>&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Tahoma"&gt;Often people will write or call to relate that Toad&lt;sup&gt;®&lt;/sup&gt; seems sluggish when working against Oracle 10g databases – and that creating new connections in particular seems to take an unreasonably long time. They are often especially frustrated since this problem did not occur with Oracle versions prior to 10g. So what is Toad doing that’s wrong (i.e. a bug)?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Tahoma"&gt;The short answer is that this is an Oracle 10g &lt;acronym&gt;&lt;span style="FONT-FAMILY: Tahoma"&gt;DBA&lt;/span&gt;&lt;/acronym&gt; best practices issue - and &lt;em&gt;&lt;strong style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-STYLE: normal; FONT-FAMILY: Tahoma; mso-bidi-font-style: italic"&gt;not a Toad problem&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt; per se. Toad just happens to expose the symptoms since it makes such frequent access to data dictionary views and tables. The underlying problem generally effects all database applications to a varying degree – it’s just exposed most prominently via Toad.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Tahoma"&gt;Oracle versions prior to 10g offered two query optimizers: cost and rule – with rule based being the default and fallback, plus also quite importantly internally used for most access to the data dictionary. While 10g and beyond still offer both optimizers, all access to the data dictionary is via the cost based optimizer, hence the data dictionary needs statistics gathered in order to function efficiently.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Tahoma"&gt;The common misconception (and source of the problem) is that people think Oracle 10g does this “auto-magically” as a background task (i.e. GATHER_STATS_JOB). However, the database does not – well not reliably anyway. As a result 90+ percent of the time Toad users experience sluggish performance with 10g, that is the root cause. Most times it takes a &lt;em style="mso-bidi-font-style: normal"&gt;“heated debate”&lt;/em&gt; between the Toad users, their DBAs, and Quest to convince them to try the quick and very simple fix – which takes just two minutes to perform and then successfully test.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Tahoma"&gt;Here’s the Oracle 10g documentation which most times finally gets them to try our fix:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h4 style="MARGIN-LEFT: 0.5in"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Tahoma"&gt;Oracle® Database Performance Tuning Guide&lt;br /&gt;
10&lt;em&gt;g&lt;/em&gt; Release 2 (10.2)&lt;/span&gt;&lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 9pt; FONT-FAMILY: Tahoma"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="MARGIN-LEFT: 0.5in"&gt;&lt;span class="secnum"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Tahoma"&gt;Chapter: 14 Managing Optimizer Statistics&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Tahoma"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="MARGIN-LEFT: 0.5in"&gt;&lt;span class="secnum"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Tahoma"&gt;14.2.3.1&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Tahoma"&gt; When to Use Manual Statistics&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;p style="MARGIN-LEFT: 0.5in"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Tahoma"&gt;Automatic statistics gathering should be sufficient for most database objects which are being modified at a moderate speed. However, there are cases where automatic statistics gathering may not be adequate…&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Tahoma"&gt;Another area in which statistics need to be manually gathered are the system statistics. &lt;strong style="mso-bidi-font-weight: normal"&gt;These statistics are &lt;u&gt;not automatically gathered&lt;/u&gt;&lt;/strong&gt;. See "System Statistics" for more information.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Tahoma"&gt;Statistics on fixed objects, such as the dynamic performance tables, need to be manually collected using GATHER_FIXED_OBJECTS_STATS procedure.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Tahoma"&gt;So here’s the recommended fix (performed via a DBA privileged account):&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul type="disc"&gt;
    &lt;li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Tahoma"&gt;exec dbms_stats.gather_dictionary_stats;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt; &lt;/li&gt;
    &lt;li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Tahoma"&gt;exec dbms_stats.gather_fixed_objects_stats;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Tahoma"&gt;These two commands should probably be run about once per week for best results. Of the two commands, the first is far more critical as it handles the “ALL/DBA/USER_*” views and V$ tables – which are accessed constantly from within Toad. The second command is for the X$ tables, which are primarily referenced only by some DBA Module features.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Tahoma"&gt;Please consider getting your DBA to make these calls either a scheduled PL/&lt;acronym&gt;&lt;span style="FONT-FAMILY: Tahoma"&gt;SQL&lt;/span&gt;&lt;/acronym&gt; job or possibly implementing them via &lt;em style="mso-bidi-font-style: normal"&gt;“on instance start-up”&lt;/em&gt; database level trigger. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Tahoma"&gt;Now to give you an example of how much difference this process can make – we've clocked screens in Toad (regardless of Toad version) that run quickly on pre-10g, but take very long on a default install of 10g (sometimes as long as 45 minutes). Once the proper data dictionary statistics are collected, Toad performance equals or exceeds the pre-10g timings.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;</description>
      <link>http://www.toadworld.com/BLOGS/tabid/67/EntryID/135/Default.aspx</link>
      <author>Bert Scalzo</author>
      <comments>http://www.toadworld.com/BLOGS/tabid/67/EntryID/135/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.toadworld.com/Default.aspx?tabid=67&amp;EntryID=135</guid>
      <pubDate>Tue, 02 Oct 2007 17:44:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.toadworld.com/DesktopModules/Blog/Trackback.aspx?id=135</trackback:ping>
    </item>
  </channel>
</rss>