SQL> create table t_partition_hash (id number,name varchar2(50))
Table created
要實現同樣的效果可以:
SQL> create table t_partition_hash2 (id number,name varchar2(50))
Table created
這就是說 指定分區數量和可供使用的表空間,分區數并不一定要等於表空間數。
要查詢表的分區信息,仍然通過user_part_tables,user_tab_partitions 兩個數據字典。
global 索引hash分區
hash 分區索引的字句與hash分區表的創建子句完全相同,例如:
SQL> create index idx_part_hash_id on t_partition_hash(id)
create index idx_part_hash_id on t_partition_hash(id)
global partition by hash(id)
partitions 3 store in(tbspart01,tbspart02,tbspart03)
ORA-14005: missing RANGE keyword
可能是9i不支持global index
創建local索引:
create index idx_part_hash_id2 on t_partition_hash(id) local;
global partition by hash(id)
partitions 3 store in(tbspart01,tbspart02,tbspart03);
對於global 索引,在10g中只能支持range和hash分區