首页 > 数据库技术 > 详细

Oracle数据库分区相干知识点

时间:2017-11-08 19:22:26      阅读:203      评论:0      收藏:0      [点我收藏+]

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数据库分区相干知识点

原文:http://www.cnblogs.com/vanwoos/p/7805148.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!