?
Solved

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

Posted on 2006-10-19
3
Medium Priority
?
2,038 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
Suggested Courses

770 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