| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.tools -> Re: how to shrink data file
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_at_263.net> a écrit dans le message news: 95avs7$1n6p$1_at_news.cz.js.cn...Received on Fri Feb 02 2001 - 02:30:49 CST
> 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".
>
>
>
>
>
![]() |
![]() |