Re: Identifying deleted rows for a table

From: Jonathan Lewis <>
Date: Tue, 19 Apr 2011 07:58:20 +0100
Message-ID: <>

]"onedbguru" <> wrote in message
]On Apr 18, 1:28 pm, "Jonathan Lewis" <>
]> It depends how much work you want Oracle to do, what sort of precision
]> want in your answer, and what assumptions you are prepared to make about
]> your data. For example, if you're prepared to assume that every row in a
]> table is about the same size then there's a query on my blog that could
]> helpful:
]> Slice and dice it various ways, but if you have an expected number of
]> per block this gives you some idea of how many blocks are not filled.
]You can spend a lot of time researching to find allocated but unused
]blocks or you can just look up ALTER {TABLE|INDEX} SHRINK and attempt
]to fix the problem ONLINE without interruption of day-to-day

You could indeed attempt to fix the problem without knowing what the problem was and what the impact might be, but then you might end up as one of the unhappy individuals posting the question: "I did a shrink space on a table and its been running for the last 24 hours and has generated over 75 GB of redo; what should I do ?"

Joel Garry's comment about 'average row length' x number of rows might be a good enough first approximation for the OP to allow him to decide how much more time he's going to spend on understanding the problem. Your hypothesis of a batch job that deletes lots of old rows while inserting new ones might give him the idea that SHRINK is the worst way he could have to reclaim his space because in that scenario he might end up copying every row (one at a time - with index maintenance) from the "new" end of the table to the "old" end of the table because all the empty space is currently at the old end of the table.


Jonathan Lewis
Received on Tue Apr 19 2011 - 01:58:20 CDT

Original text of this message