【参考】将表建在指定的数据文件上

时间:2022-07-20 00:33:17

SQL> create tablespace maclean datafile size 10M;

Tablespace created.


SQL> alter tablespace maclean add  datafile size 10M;

Tablespace altered.

SQL> alter tablespace maclean add  datafile size 10M;

Tablespace altered.

SQL> select name,file# from v$DATAFILE;

NAME                                                                        FILE#
---------------------------------------------------------------------- ----------
C:\APP\ORADATA\G11R2\DATAFILE\O1_MF_SYSTEM_6VWCSPD4_.DBF                        1
C:\APP\ORADATA\G11R2\DATAFILE\O1_MF_SYSAUX_6VWCT4N3_.DBF                        2
C:\APP\ORADATA\G11R2\DATAFILE\O1_MF_UNDOTBS1_6VWCTGK4_.DBF                      3
C:\APP\ORADATA\G11R2\DATAFILE\O1_MF_USERS_6VWCV01L_.DBF                         4
C:\APP\ORADATA\G11R2\DATAFILE\O1_MF_UI_6YW3OX2J_.DBF                            5
C:\APP\ORADATA\G11R2\DATAFILE\O1_MF_TOO_MANY_70679V7W_.DBF                      6
C:\APP\ORADATA\G11R2\DATAFILE\O1_MF_ASSFDS_7088L5MF_.DBF                        7
C:\APP\ORADATA\G11R2\DATAFILE\O1_MF_SYSTEM_70PLM9PB_.DBF                        8
C:\SS.DBF                                                                       9
C:\APP\ORADATA\G11R2\DATAFILE\O1_MF_MACLEAN_7CBQ9RLD_.DBF                      10
C:\APP\ORADATA\G11R2\DATAFILE\O1_MF_MACLEAN_7CBQBJXK_.DBF                      11
C:\APP\ORADATA\G11R2\DATAFILE\O1_MF_MACLEAN_7CBQBLQR_.DBF                      12

12 rows selected.

SQL> create table extend_on_datafile12 (t1 int) tablespace maclean;

Table created.

SQL> alter table  extend_on_datafile12 allocate extent ( datafile 'C:\APP\ORADATA\G11R2\DATAFILE\O1_MF_MACLEAN_7CBQBLQR_.DBF' size 2M);

Table altered.


SQL> select file_id  from dba_extents where segment_name='EXTEND_ON_DATAFILE12';

   FILE_ID
----------
        12
        12
        12