Oracle数据库分区相干知识点

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 中。








转载于:https://www.cnblogs.com/vanwoos/p/7805148.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值