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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: free up datafile space problem ???

RE: free up datafile space problem ???

From: Glenn Travis <c-glenn.travis_at_wcom.com>
Date: Tue, 07 Aug 2001 12:10:52 -0700
Message-ID: <F001.003634DD.20010807122857@fatcity.com>

I just sent this to the other list...

Here is a quick script to list the tablespace/datafiles and their higwater marks, as well as generate the resize commands;

--begin script
col blksz new_value blksz noprint;
col tablespace_name for a20 heading "Tablespace|Name";

col file_name for a50 heading "File|Name";
col file_id for 999 heading "File|Id";
col file_size for 999,999.99 heading "File|Size MB";
col file_hw for 999,999.99 heading "HighWater|Size MB";
set linesize 132;
set verify off;

select value blksz from v$parameter where lower(name) = 'db_block_size'; select a.tablespace_name, b.file_name, b.file_id, b.bytes/1024/1024 file_size,
((c.max_blockid+a.blocks) * &blksz)/1024/1024 file_hw
from dba_extents a, dba_data_files b ,
(select file_id, max(block_id) max_blockid from dba_extents group by
file_id) c
where a.file_id=b.file_id
and a.file_id=c.file_id
and a.block_id = c.max_blockid
order by 1,2;

set pagesize 0;
select 'alter database datafile '||''''||b.file_name||''''||' resize '||round(((c.max_blockid+a.blocks) * &blksz)/1024/1024)||'M ;' from dba_extents a, dba_data_files b ,
(select file_id, max(block_id) max_blockid from dba_extents group by
file_id) c
where a.file_id=b.file_id
and a.file_id=c.file_id
and a.block_id = c.max_blockid;

quit
--end script

-----Original Message-----
Sent: Tuesday, August 07, 2001 2:41 PM
To: Multiple recipients of list ORACLE-L

Hi all,

I have a data file of 2G and the free bytes is 1,413,079, the used bytes is only 683,829. I like to resize it. When I issue:
alter database datafile
'/orafs02/oradata/PV_A0725/ld_data05.dbf' resize 1000M, I got:
ERROR at line 1:
ORA-03297: file contains used data beyond requested RESIZE value

But apparently, the file does NOT contain data beyond 1000M. Am I missing something?

Thank you.

Janet



Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Janet Linsy
  INET: janetlinsy_at_yahoo.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L

(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Glenn Travis INET: c-glenn.travis_at_wcom.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Tue Aug 07 2001 - 14:10:52 CDT

Original text of this message

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