Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: dba_free_space missing a tablespace???
Howard,
You have a mistake in your ALTER DATABASE DATAFILE statement. Unfortunately Oracle silently ignores it. You need to use the filename instead of file# per SQL Reference documentation:
SQL> create tablespace test
datafile '/lurch/disk_4/oradata/TEST/test.dbf' size 1m;
Tablespace created.
SQL> select * from dba_free_space where tablespace_name = 'TEST';
TABLESPACE_NAME FILE_ID BLOCK_ID BYTES BLOCKSRELATIVE_FNO
------------------------------ --------- --------- --------- --------- - ----------- TEST 4 2 1040384 127 4
SQL> alter database datafile 4 resize 2m;
Database altered.
SQL> select * from dba_free_space where tablespace_name = 'TEST';
TABLESPACE_NAME FILE_ID BLOCK_ID BYTES BLOCKSRELATIVE_FNO
------------------------------ --------- --------- --------- --------- - ----------- TEST 4 2 1040384 127 4
SQL> alter database datafile '/lurch/disk_4/oradata/TEST/test.dbf' resize 2m;
Database altered.
SQL> select * from dba_free_space where tablespace_name = 'TEST';
TABLESPACE_NAME FILE_ID BLOCK_ID BYTES BLOCKSRELATIVE_FNO
------------------------------ --------- --------- --------- --------- - ----------- TEST 4 2 2088960 255 4
SQL> alter database datafile 123456 resize 2m;
Database altered.
Note that I do not have a datafile numbered 123456. In fact, I can use any number less than or equal to 2000000 (2 million). Above that I get ORA-2827. I'm not sure what parameter governs that. My Oracle version is 8.1.6.0.0, 32-bit, on Solaris 2.6 Sparc. DB_FILES is set to 200. I think MAXDATAFILES is 254 when the database is created (as seen in output of alter database backup controlfile to trace).
Yong Huang
yong321_at_yahoo.com
In article <3a70c7e6_at_news.iprimus.com.au>,
"Howard J. Rogers" <howardjr_at_www.com> wrote:
> Because, I suspect, that dba_free_space is only measuring free
EXTENTS, not
> amorphous blobs of space that hasn't been laid out yet. In any
event, the
> view gets utterly confused by re-sizes, regardless of tablespace.
Consider
> this little test:
>
> SVRMGR> create tablespace freespace datafile 'c:\free.dbf' size 1m;
> Statement processed.
> SVRMGR> select * from dba_free_space where
tablespace_name='FREESPACE';
> TABLESPACE_NAME FILE_ID BLOCK_ID BYTES BLOCKS
> RELAT
> IVE_F
> ------------------------------ ---------- ---------- ---------- ------
![]() |
![]() |