?
Solved

how to determine whether we should reorg the table or not ?

Posted on 2006-10-19
3
Medium Priority
?
2,057 Views
Last Modified: 2007-11-27
Hi,

In our database, there are few tables with 7 to 15 gb each in size and our total db size is somewhere around 300G-500G.

How do we say that we need to do reorg for this table or not ?

I mean, we can check what is the high water mark for the table in the dba_tables after the analyze table is done but is there any script/sql which can say that 'reorg required' for those reorganization is a must so that it will free up the unwanted space to which it has got allocated and for those which is not required 'reorg not required'.

I can determine the empty_blocks, blocks from dba_tables,dba_segments after analyzing a table. But on what primary basis do we say that we need to reorg the table or not ?

For me as of now, performance is not an issue. So apart from performance issue, kindly let me know what are the other factors which will decide whether we should reorg a table or not ?

Let me know if you need more info.

Waiting for experts comments !!

Note: I have posted this Q initally in the product info section under this oracle but got very little or no response. So want to try by posting the Q under directly oracle.
   
Thanks
0
Comment
Question by:Naveen Kumar
2 Comments
 
LVL 35

Assisted Solution

by:Mark Geerlings
Mark Geerlings earned 300 total points
ID: 17767822
Usually tables only need to be re-organized if one of these are true:
1. the application has done lots of deletes of scattered rows, so many blocks are now filled somewhere between the values for PCTFREE and PCTUSED.
2. the application has done lots of updates that added many bytes to the records, so many of them are now "chained" across multiple blocks.

Another reason for re-organizing a table even if neither of those conditions are true, is if the records have accumulated in chronological order (as is typical) but they are almost always retrieved based on a foreign key value that is not related to the order in which the records were created.  For example, in an order-entry system, orders are entered as they are received, but if most reports on the order information are sorted by customer, it may greatly speed up the response times for queries and reports if the orders table is sorted by customer, then reloaded in order by customer periodically.
0
 
LVL 18

Accepted Solution

by:
rbrooker earned 700 total points
ID: 17768988
Hi,

just a note: the blocks / empty blocks from a table analyse will give oyu the empty blocks above the high water mark.  they will not tell you that 60% of the blocks below the high water mark are empty.  you could take the average row length and multiply it by the number of rows in the table, this will give you an approximate "size of the data".  you can compare this against the number of blocks allocated multiplied by the block size of the tablespace.  if they are vastly different, then a reorg may be justified.

avg row len * rows =
155 bytes * 15million = 2.1GB

blocksize * blocks allocated =
16k * 200000 = 3.05GB

i would reorg in this case, almost a GB over allocated.

mind you, you need to factor in growth as well.

good luck :)
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

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…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Suggested Courses
Course of the Month16 days, 18 hours left to enroll

864 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