为了了解partition及subpartition在表空间中的分布情况,做如下实验
SQL> select table_name,partition_name,subpartition_count,partition_position,tablespace_name from user_tab_partitions;
TABLE_NAME PARTITION_NAME SUBPARTITION_COUNT PARTITION_POSITION TABLESPACE_NAME
MESSAGE MESSAGE_PART1 4 1 MYWEBIM
MESSAGE MESSAGE_PART2 4 2 MYWEBIM
MESSAGE MESSAGE_PART3 4 3 MYWEBIM
在user_tab_subpartitions中查看subpartition情况,根据命令每个partition被分为4个subpartition,subpartition_position分别为1、2、3、4,但由于store in命令中只给定三个表空间,所以1、2、3号subpartition被散列到指定表空间中,4号被循环散列到第一个指定的表空间PART1_TEST_TB中
1* select table_name,partition_name,subpartition_name,subpartition_position,tablespace_name from user_tab_subpartitions
SQL> /
TABLE_NAME PARTITION_NAME SUBPARTITION_NAME SUBPART_POSITION TABLESPACE_NAME
MESSAGE MESSAGE_PART1 SYS_SUBP21 1 PART1_TEST_TB
MESSAGE MESSAGE_PART1 SYS_SUBP22 2 PART2_TEST_TB
MESSAGE MESSAGE_PART1 SYS_SUBP23 3 PART3_TEST_TB
MESSAGE MESSAGE_PART1 SYS_SUBP24 4 PART1_TEST_TB
MESSAGE MESSAGE_PART2 SYS_SUBP25 1 PART1_TEST_TB
MESSAGE MESSAGE_PART2 SYS_SUBP26 2 PART2_TEST_TB
MESSAGE MESSAGE_PART2 SYS_SUBP27 3 PART3_TEST_TB
MESSAGE MESSAGE_PART2 SYS_SUBP28 4 PART1_TEST_TB
MESSAGE MESSAGE_PART3 SYS_SUBP29 1 PART1_TEST_TB
MESSAGE MESSAGE_PART3 SYS_SUBP30 2 PART2_TEST_TB
MESSAGE MESSAGE_PART3 SYS_SUBP31 3 PART3_TEST_TB
MESSAGE MESSAGE_PART3 SYS_SUBP32 4 PART1_TEST_TB