时间:2021-07-01 10:21:17 帮助过:4人阅读
Partition Characteristics:
1.Partition Key;
2.Partitioning Strategies
Partitioning Strategies:
1. range
2. list
3. hash
创建一个有多个分区的表的实例:
create table testpt(tid int)
partition by range (tid)
(partition testpt_b10 values less than (10),
partition testpt_u9 values less than (MAXVALUE))
查看用户表的分区
select * from user_tab_partitions
创建Interval Partitioning:
create table testpt(tid int)
partition by range (tid)
interval(5)
(partition testpt_b10 values less than (5),
partition testpt_u9 values less than (10))
当采用以间隔分区时,必须指定至少一个range partition
创建List Partitioning:
create table testpt(tid int)
partition by list (tid)
(partition testpt_odd values (1,3,5,7,9),
partition testpt_even values (2,4,6,8,0)
)
创建Hash Partitioning:
create table testpt(tid int)
partition by hash (tid)
partitions 3;
Reference Partitioning:
比如有orders 和line_items 两个表,order_id 是 orders 的主键,是line_items 的外键。如果某个订单保存到orders 中的某个partition,则该订单的所有在 line_items 中的项也保存到该partition中。如果某个分区被增加到orders中,则该分区被自动被加到 line_items 中。
Oracle数据库分区相干知识点
标签:rate character stp cte lin ash 自动 rac ble