Solved

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

Posted on 2006-10-19
3
2,030 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
3 Comments
 
LVL 35

Assisted Solution

by:Mark Geerlings
Mark Geerlings earned 150 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 350 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
select only modified column name  based on the status 15 47
EXECUTE IMMEDIATE 5 53
Best RAID for a BDD Oracle 4 62
su - oracle could not open session 6 52
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

920 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

12 Experts available now in Live!

Get 1:1 Help Now