实验四:一个包含多个大小不一数据文件的表空间,各个数据文件的剩余空间一样多吗?为什么
实验使用中应该保持数据文件大小一致。如表空间有三个数据文件,大小分别是9M,19M,9M,在分配3M的空间时,会在每个数据文件中各分配1M。一直到两个9M的数据文件空间用完,再分配时,则从剩余的一个数据文件中分配。见实验:
BYS@ bys3>select a.tablespace_name,a.file_id,b.file_name,a.bytes/1024/1024 file_byte_mb from dba_free_space a,dba_data_files b where a.file_id=b.file_id and a.tablespace_name='TEST3';
TABLESPACE_NAME FILE_ID FILE_NAME FILE_BYTE_MB
--------------- ---------- ------------------------------ ------------
TEST3 11 /u01/oradata/bys3/test3_1.dbf 9
TEST3 12 /u01/oradata/bys3/test3_2.dbf 19
TEST3 13 /u01/oradata/bys3/test3_3.dbf 9
BYS@ bys3>insert into test1 values(789999);
1 row created.
BYS@ bys3>commit;
Commit complete.
BYS@ bys3>select a.tablespace_name,a.file_id,b.file_name,a.bytes/1024/1024 file_byte_mb from dba_free_space a,dba_data_files b where a.file_id=b.file_id and a.tablespace_name='TEST3';
TABLESPACE_NAME FILE_ID FILE_NAME FILE_BYTE_MB
TEST3 11 /u01/oradata/bys3/test3_1.dbf 1
TEST3 12 /u01/oradata/bys3/test3_2.dbf 11
TEST3 13 /u01/oradata/bys3/test3_3.dbf 1
BYS@ bys3>create table test2(aa int) tablespace test3 storage (initial 5m);
Table created.
BYS@ bys3>insert into test2 values(789999);
1 row created.
BYS@ bys3>commit;
Commit complete.
BYS@ bys3>select a.tablespace_name,a.file_id,b.file_name,a.bytes/1024/1024 file_byte_mb from dba_free_space a,dba_data_files b where a.file_id=b.file_id and a.tablespace_name='TEST3';
TABLESPACE_NAME FILE_ID FILE_NAME FILE_BYTE_MB
--------------- ---------- ------------------------------ ------------
TEST3 12 /u01/oradata/bys3/test3_2.dbf 8