Solved

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

Posted on 2006-10-19
3
2,029 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 34

Assisted Solution

by:Mark Geerlings
Mark Geerlings earned 150 total points
Comment Utility
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
Comment Utility
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

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

Suggested Solutions

Title # Comments Views Activity
Oracle SQL Query Syntax 6 84
UNIX SCP 5 45
VB.Net - CSV to Oracle table 4 27
Clone Oracle 12c Database 5 24
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

772 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

10 Experts available now in Live!

Get 1:1 Help Now