Solved

Oracle analyze table

Posted on 2010-08-25
3
732 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.

Join & Write a Comment

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…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

746 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now