<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Two useful Oracle commands to gather table and schema statistics.</title>
	<atom:link href="http://www.dbuggr.com/smallwei/oracle-commands-gather-table-schema-statistics/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dbuggr.com/smallwei/oracle-commands-gather-table-schema-statistics/</link>
	<description>Share Knowledge &#38; Be Rewarded</description>
	<lastBuildDate>Fri, 03 Feb 2012 23:13:48 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: smallwei</title>
		<link>http://www.dbuggr.com/smallwei/oracle-commands-gather-table-schema-statistics/comment-page-1/#comment-47</link>
		<dc:creator>smallwei</dc:creator>
		<pubDate>Sun, 18 Oct 2009 22:36:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.dbuggr.com/smallwei/oracle-commands-gather-table-schema-statistics/#comment-47</guid>
		<description>1. To gather statistics on a table:

sqlplus into the database as sys or system and run the following dbms package. Make sure you replace &quot;SCHEMA_NAME&quot; and &quot;TABLE_NAME&quot;.

&gt;
begin

dbms_stats.gather_table_stats( 
ownname=&gt; &#039;SCHEMA_NAME&#039;, 
tabname=&gt; &#039;TABLE_NAME&#039; , 
estimate_percent=&gt; DBMS_STATS.AUTO_SAMPLE_SIZE, 
cascade=&gt; DBMS_STATS.AUTO_CASCADE, 
degree=&gt; null, 
no_invalidate=&gt; DBMS_STATS.AUTO_INVALIDATE, 
granularity=&gt; &#039;AUTO&#039;, 
method_opt=&gt; &#039;FOR ALL COLUMNS SIZE AUTO&#039;);

end;
/

==============================================

2. A quick command to gather statistics on a schema:

sqlplus into the database as sys or system and simply run the following command:

&gt;
exec dbms_stats.gather_schema_stats(&#039;SCHEMA_NAME&#039;);</description>
		<content:encoded><![CDATA[<p>1. To gather statistics on a table:</p>
<p>sqlplus into the database as sys or system and run the following dbms package. Make sure you replace &quot;SCHEMA_NAME&quot; and &quot;TABLE_NAME&quot;.</p>
<p>&gt;<br />
begin</p>
<p>dbms_stats.gather_table_stats(<br />
ownname=&gt; &#39;SCHEMA_NAME&#39;,<br />
tabname=&gt; &#39;TABLE_NAME&#39; ,<br />
estimate_percent=&gt; DBMS_STATS.AUTO_SAMPLE_SIZE,<br />
cascade=&gt; DBMS_STATS.AUTO_CASCADE,<br />
degree=&gt; null,<br />
no_invalidate=&gt; DBMS_STATS.AUTO_INVALIDATE,<br />
granularity=&gt; &#39;AUTO&#39;,<br />
method_opt=&gt; &#39;FOR ALL COLUMNS SIZE AUTO&#39;);</p>
<p>end;<br />
/</p>
<p>==============================================</p>
<p>2. A quick command to gather statistics on a schema:</p>
<p>sqlplus into the database as sys or system and simply run the following command:</p>
<p>&gt;<br />
exec dbms_stats.gather_schema_stats(&#39;SCHEMA_NAME&#39;);</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
