RE: RE : Query for shrinking datafile

  • From: "Holvoet, Jo" <jo.holvoet@xxxxxxxxxxxxx>
  • To: <bertrand.guillaumin@xxxxxxxxxx>, <harel.safra@xxxxxxxxx>, <s.cislaghi@xxxxxxxxx>
  • Date: Mon, 3 May 2010 10:15:22 +0200

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,
       c.name                                        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 c.name = '/directoryname/filename.dbf'
group by a.file_id, c.name, c.block_size;

mvg / regards,
Jo Holvoet
 
 

-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Bertrand Guillaumin
Sent: maandag 3 mei 2010 10:04
To: harel.safra@xxxxxxxxx; s.cislaghi@xxxxxxxxx
Cc: Oracle L
Subject: RE : Query for shrinking datafile

You can find the asktom queries in the following link :
http://www.oracle.com/technology/oramag/oracle/04-sep/o54asktom.html

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 .

HTH
________________________________________

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
>
--
//www.freelists.org/webpage/oracle-l


--
//www.freelists.org/webpage/oracle-l


--
//www.freelists.org/webpage/oracle-l


Other related posts: