Re: Shrink Datafiles

From: Wolfgang Breitling <breitliw_at_netcom.ca>
Date: 1998/01/25
Message-ID: <6aec2q$c19$1_at_tor-nn1.netcom.ca>#1/1


In article <611.316T1568T13023779_at_rheingau.netsurf.de>, "Lothar Armbruester" <lothar.armbruester_at_rheingau.netsurf.de> wrote:
>On 02-Jan-98 18:23:36 Qiuping Mao wrote:
>>What is the command for shrinking the datafile?
 

>>Thanks in advance.
>
>In Oracle 7.3 you can do something like
>
>alter datafile 'f:\orant\database\datafile.ora' resize 20M;
>
>I don't know what happens is the datafile is full so that there is no room
>for the shrink.
>
>As always, check the manual for the correct syntax because ยก'm writing
>this at home with neither Oracle nor manual to check!
>

Be careful with shrinking datafiles. Oracle stores the original file size in the file header, as well as the current size. Unfortunately, if you ever later want/need to use the "create controlfile ..." command, Oracle checks the file size that it retrieves from the OS against the create file size and gives you an ORA-01200 error if the actual file size is smaller than the size it was originally created as. Oracle doesn't mind if the current size is larger than the size it was created as, so expansion is OK. This is true for 7.3.2 at least and may be fixed in later versions. Received on Sun Jan 25 1998 - 00:00:00 CET

Original text of this message