RE: RE : Query for shrinking datafile

From: Holvoet, Jo <>
Date: Mon, 3 May 2010 10:15:22 +0200
Message-ID: <>

But you will likely have to update that script since it still assumes that your whole database is using the same blocksize. The blocksize is now included in v$datafile for example :
select a.file_id                                     fileno,                                        filename,
       max(a.block_id + a.blocks - 1) * c.block_size hwm
from dba_extents a, v$datafile c
where a.file_id = c.file#
  and = '/directoryname/filename.dbf' group by a.file_id,, c.block_size;

mvg / regards,
Jo Holvoet    

-----Original Message-----
[] On Behalf Of Bertrand Guillaumin Sent: maandag 3 mei 2010 10:04
To:; Cc: Oracle L
Subject: RE : Query for shrinking datafile

You can find the asktom queries in the following link :

Go to the last paragraph.

You also have a query to know what at the end of the datafile.

But if you really need to shrink a datafile, you often have to do a reorg .


On 03/05/2010 10:49, Stefano Cislaghi wrote:
> Hi all,
> do you use any query or method to discover how much space you can save
> on a datafile? I want to say...suppose to shrink your datafile, which
> is the minimum size, according to the highest HWM position, you can
> reach for your datafile?
> Which is the easiest way to achieve this?
> Thanks
> Ste



Received on Mon May 03 2010 - 03:15:22 CDT

Original text of this message