• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 762
  • Last Modified:

Oracle analyze table

Hey guys how can I find when had Oracle analyze table last time. And if it is not analyzed than how can I analyze a table. Thanks for your help in advance
0
hussainkhan22
Asked:
hussainkhan22
  • 2
2 Solutions
 
slightwv (䄆 Netminder) Commented:
There is a LAST_ANALYZED column in DBA_TABLES (and USER_TABLES).

There is an older analyze table command but I suggest the newer DBMS_STATs package to generate them.
0
 
sindhuxyzCommented:
ANALYZE TABLE employees COMPUTE STATISTICS;
ANALYZE INDEX employees_pk COMPUTE STATISTICS;

ANALYZE TABLE employees ESTIMATE STATISTICS SAMPLE 100 ROWS;
ANALYZE TABLE employees ESTIMATE STATISTICS SAMPLE 15 PERCENT;

Read this article for more:

http://www.oracle-base.com/articles/8i/CostBasedOptimizerAndDatabaseStatistics.php
0
 
slightwv (䄆 Netminder) Commented:
As I mentioned before: The analyze table method is older and discouraged by Oracle.   It's best to use DBMS_STATS.

In later releases (10g and above), STATS are typically gathered automatically in the maintenance window:

http://www.dbasupport.com/oracle/ora10g/scheduler01.shtml



0

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now