473,378 Members | 1,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

What is ANALYZE do?

AdusumalliGopikumar
How we can use Analyze to know our table statics,,


i mean explain the steps involved.
Aug 20 '07 #1
3 13107
amitpatel66
2,367 Expert 2GB
http://www-eleves-isia.cma.fr/documentation/OracleDoc/ANALYZE.html
Aug 21 '07 #2
debasisdas
8,127 Expert 4TB
syntax for analysing a table is :
Expand|Select|Wrap|Line Numbers
  1. ANALYZE TABLE emp ESTIMATE STATISTICS;
Analyze statement generate statistaics that help CBO to estimate the cost of execution plan.

The full syntax (not using DBMS package) is

Expand|Select|Wrap|Line Numbers
  1. ANALYZE TABLE xxxxx ESTIMATE STATISTICS SAMPLE 20 PERCENT;
In case you do not mention the sample size, Oracle will only use 1064 rows to sample, which might be very small for a large table.

Once you start analyzing some of your tables you really ought to analyze all of them. Otherwise you will find yourself in a situation in which you join several tables one of which has stats and the others lack them: because one of the tables has been analyzed Oracle will estimate (i.e. make up) statistics for the other tables. This is not good idea.
Aug 21 '07 #3
debasisdas
8,127 Expert 4TB
Validating the structure
Expand|Select|Wrap|Line Numbers
  1. analyze table table-name validate structure ;
  2. analyze table table-name validate structure online;
  3. analyze table table-name validate structure cascade;
  4. analyze table table-name validate structure cascade online;
This command validates the integrity of the db blocks of the underlying table.
If cascade is specified, the command also checks the index
ORA-01499 is thrown if the validation fails.
analyze table requires a temporary segment if the statement cannot be completed in memory.


Using ANALYZE command is little bit older now. If you are using oracle >8i then you have new package called dbms_stats.

To analyze schema use
Expand|Select|Wrap|Line Numbers
  1. dbms_stats.gather_schema_stats
For table use the following
Expand|Select|Wrap|Line Numbers
  1. dbms_stats.gather_table_stats
To make use of CBO for your queries, you need to give upto date statistics of your tables,indexes to optimizer. By collecting them, optimizer gives the best execution plan for the query.
Aug 21 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Holger Marzen | last post by:
Hi all, the docs are not clear for me. If I want (in version 7.1.x, 7.2.x) to help the analyzer AND free unused space do I have to do a vacuum vacuum analyze or is a
1
by: Joseph Shraibman | last post by:
Is there any way to force analyze to run on a whole table? In other words for large tables to avoid sampling? What happens if I run a vacuum analyze? ---------------------------(end of...
3
by: Joseph Shraibman | last post by:
Trying this: VACUUM VERBOSE ANALYZE; on a 7.4.1 database only does a vacuum, not the analyze. I've tried this on two seperate databases. Is this a known bug? I haven't seen anything about...
3
by: user_5701 | last post by:
Hello, I have an Access 2000 database that I need to export certain queries to Excel 2000. The problem is that I have to take the toolbars away from the users for security purposes, but still let...
5
by: John | last post by:
Hi, I need some software that will analyze my C# application (consisting of multiple projects and many classes) and show the relationships between classes and methods. I want to visually see...
0
by: Rajesh Kumar Mallah | last post by:
Greeting, Will it be an useful feature to be able to vacumm / analyze all tables in a given schema. eg VACUUM schema.* ; at least for me it will be a good feature.
1
by: Klint Gore | last post by:
query is select t2.field4, t1.* from t1 left outer join t2 on t2.field1 = t1.field1 and t2.field2 = t1.field2 There are 55k rows in t1 (103 fields) and 10k in t2 (4 fields, 4 is text)....
5
by: Jon Lapham | last post by:
I have been using the EXPLAIN ANALYZE command to debug some performance bottlenecks in my database. In doing so, I have found an oddity (to me anyway). The "19ms" total runtime reported below...
16
by: Ed L. | last post by:
I'm getting a slew of these repeatable errors when running ANALYZE and/or VACUUM ANALYZE (from an autovacuum process) against a 7.3.4 cluster on HP-UX B.11.00: 2004-09-29 18:14:53.621 ERROR:...
0
by: Nemo | last post by:
Hello, I wan't some information how i can create a tree analyze. Look att my fundamental tree analyze. | --------------------- | -----------
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.