Solved

Oracle analyze table

Posted on 2010-08-25
3
736 Views
Last Modified: 2013-12-12
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
Comment
Question by:hussainkhan22
  • 2
3 Comments
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 33520541
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
 
LVL 5

Accepted Solution

by:
sindhuxyz earned 250 total points
ID: 33520591
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
 
LVL 76

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 250 total points
ID: 33520662
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question