Solved

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

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle sql query 7 74
Oracle - SQL Parse String 5 46
MULTIPLE DATE QUERY 15 91
setting local variables in a cursor block 3 20
Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
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.
Via a live example, show how to take different types of Oracle backups using RMAN.

828 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