Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: how can i shirnk your datafile file size?

Re: how can i shirnk your datafile file size?

From: DA Morgan <damorgan_at_psoug.org>
Date: Thu, 22 Nov 2007 10:25:47 -0800
Message-ID: <1195755940.296557@bubbleator.drizzle.com>


Havel Zhang wrote:
> hi all:
>
> I have a tablespace have a datafile sizing 8GB, but actually, I just
> using 2GB data. But when i resize that data file, oracle will return
> an error:
> Failed to commit: ORA-03297: file contains used data beyond requested
> RESIZE value .
>
> I have search the table dba_segment, and cleared all tables/indexes on
> that datafile, but still can not shirnk this datafile.
>
> Can u help me?
>
> Thank you.
>
> Havel

You think you have but Oracle disagrees.

Start here:
SELECT file_id, file_name
FROM dba_data_files
WHERE tablespace_name = <your tablespace>;

Then using the correct file_id:

SELECT owner, segment_name, segment_type FROM dba_extents
WHERE file_id = <file_id>;

You might also want to run DBMS_SPACE.VERIFY_SHRINK_CANDIDATE or DBMS_SPACE.VERIFY_SHRINK_CANDIDATE_TBF
http://www.psoug.org/reference/dbms_space.html

-- 
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Thu Nov 22 2007 - 12:25:47 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US