title: Oracle: Analyze table vs Gather_Table_Stats vs Gather_Schema_Stats
body: <p>Currently in my DB, my predecessor who was working on DB has created a job which on every weekend gathers a list of all tables in the DB and individually for every table executes below two commands in that order:</p>
  
  <pre><code>ANALYZE TABLE xxTable_Namexx ESTIMATE STATISTICS FOR ALL INDEXED COLUMNS SIZE 75 SAMPLE 100 PERCENT;
  
  EXEC dbms_stats.gather_table_stats(xxSchemaxx,xxTable_Namexx,cascade=&gt;TRUE);
  </code></pre>
  
  <p><strong>Recently someone suggested to me that:</strong></p>
  
  <p>1.) ANALYZE table is an old method of gathering stats and the optimizer doesn't use it anymore? is it true that the stats from this command is useless throughout the DB or is it being used somewhere?</p>
  
  <p>2.) Instead of doing all this, it is enough to daily run:</p>
  
  <pre><code>dbms_stats.gather_schema_stats(xxSchemaxx,cascade=&gt;true);
  </code></pre>
  
  <p>What is the size/sample % if nothing is specified ??</p>
  
  <p>3.) What is the general practice/frequency for gather stats in a database. (Data is being updated,inserted,deleted on a daily basis). I still prefer doing it every week-end.</p>
  
  <p>Thanks in advance.</p>