From: "Michel Cadot" <micadot@netcourrier.com>
Newsgroups: comp.databases.oracle.misc
Subject: Re: how to shrink data file
Date: Fri, 2 Feb 2001 09:30:49 +0100
Organization: Guest of France Telecom Oleane's newsreading service
Lines: 37
Message-ID: <95dr7q$t0$1@s1.read.news.oleane.net>
References: <95avs7$1n6p$1@news.cz.js.cn>
Reply-To: "Michel Cadot" <micadot@netcourrier.com>
NNTP-Posting-Host: 195.101.229.231
X-Trace: s1.read.news.oleane.net 981102650 928 195.101.229.231 (2 Feb 2001 08:30:50 GMT)
X-Complaints-To: abuse@oleane.net
NNTP-Posting-Date: Fri, 2 Feb 2001 08:30:50 +0000 (UTC)
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200


You can't resize the file below the last allocated block.
You can find the minimum size with a query like the following:

select substr(f.file_name,1,70) "Filename",
   max(e.block_id*(e.bytes/e.blocks)+e.bytes)/1024 "MinSize (Kb)"
from dba_extents e, dba_data_files f
where e.file_id = f.file_id
group by f.file_name
/

--
Have a nice day
Michel


"zhang liang" <novazl@263.net> a écrit dans le message news: 95avs7$1n6p$1@news.cz.js.cn...
> After checking dba_free_space, I found that "system" tablespace has 1.67G
> free bytes. Since the data file for "system" tablespace is about 2.1G, I try
> to use the following command to resize file system01.rbf to about 800M:
>
> alter database datafile '/oracle/u01/oradata/wapdb/system01.rbf' resize
> 800M;
>
> But the following error message was returned:
>
> ORA-03297: file contains used data beyond requested RESIZE value
>
>
> The same kind of error also occurs when I try to shrink file "rbs01.dbf",
> which holds tablespace "rbs".
>
>
>
>
>



