From:Steve Adams
Date:24-May-2001 10:18
Subject:   Can I specify a datafile for a table?

There is some tantalizing syntax in SYS.BOOTSTRAP$ that appears to do this. For example:

CREATE ROLLBACK SEGMENT SYSTEM STORAGE (INITIAL 50K NEXT 50K MINEXTENTS 2
MAXEXTENTS 121 OBJNO 0 EXTENTS (FILE 1 BLOCK 2))
However, that syntax is actually used to bootstrap the dictionary cache on startup, rather than to create the segments in the first place. If you check $ORACLE_HOME/rdbms/admin/sql.bsq you'll see that that there is no such EXTENTS specification when the data dictionary segments are first created. And if you try the syntax yourself, you'll get an ORA-00900: invalid SQL statement error.

You can however do what you want by creating a series of dummy tables in the tablespace as follows:

alter tablespace &TablespaceName coalesce;
set pagesize 0 feedback off

spool drop_dummy_tables.sql
select
  'drop table dummy_' || file_id || '_' || block_id || ';'
from
  dba_free_space
where
  tablespace_name = '&TablespaceName'
/
spool off

spool create_dummy_tables.sql
select
  'create table dummy_' || file_id || '_' || block_id ||
  ' (n number) tablespace ' || tablespace_name ||
  ' storage (initial ' || bytes || ');'
from
  dba_free_space
where
  tablespace_name = '&TablespaceName'
order by
  bytes desc
/
spool off

@create_dummy_tables.sql
By first coalescing the tablespace and then creating one dummy table for each free extent in the tablespace in decreasing order of size, you will have temporarily allocated all the free space in the tablespace. You can then drop the dummy table(s) in the datafile that you want to use, create your table, and then drop the other dummy tables using the drop_dummy_tables.sql script that you created first.

When creating a table, can I specify a specific datafile within the tablespace in where I want the table segment to be created?