oracle11g_system partition系统分区

oracle11g开始,支持system partition;
-----system partition的概念
Use this clause to create system partitions. System partitioning does not entail any partitioning key columns, nor do system partitions have any range or
list bounds or hash algorithms. Rather, they provide a way to equipartition dependent tables such as nested table or domain index storage tables with
partitioned base tables.
  和之前的hash,range,list partition不同,不用指定分区列;也没有hash,range,list的算法机制;它通过分区的基表把依赖表的数据平均分布;
  它适用于不能按range,list,hash进行分区,又想把数据均分在不同的分区中,可采用此种方式;
If you specify only PARTITION BY SYSTEM, then the database creates one partition with a system-generated name of the form. SYS_Pn.
  由系统产生分区名字,如:SYs_pN
If you specify PARTITION BY SYSTEM PARTITIONS integer, then the database creates as many partitions as you specify in integer, which
can range from 1 to 1024K-1.
  指定partition by system partitioins inteter,产生integer分区;分区数量自1-1024k-1

----system partition的语法
SQL> create table t_system_partition(a int,b int)
  2  partition by system partitions 2;
Table created.

---报错:原因对于system partition的表在dml必须指定分区名字,因为system partition没有显式指定分区边界
SQL> insert into t_system_partition values(1,1);
insert into t_system_partition values(1,1)
            *
ERROR at line 1:
ORA-14701: partition-extended name or bind variable must be used for DMLs on
tables partitioned by the System method
---指定分区后dml正常运行
SQL> insert into t_system_partition partition(sys_p41) values(1,1);
1 row created.
SQL> insert into t_system_partition partition(sys_p42) values(1,1);
1 row created.
SQL> insert into t_system_partition partition(sys_p42) values(3,3);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from t_system_partition;
         A          B
---------- ----------
         1          1
         1          1
         3          3
SQL> select * from t_system_partition partition(sys_p41);
         A          B
---------- ----------
         1          1
SQL> select * from t_system_partition partition(sys_p42);
         A          B
---------- ----------
         1          1
         3          3

-----system partition的操作限制
---iot或集表不能构建system partition
You cannot system partition an index-organized table or a table that is part of a cluster.
 
---组合分区不支持system partition
Composite partitioning is not supported with system partitioning.
 
---不能拆分system partition
You cannot split a system partition.
 
---用create table as select不能使用system partition
You cannot specify system partitioning in a CREATE TABLE ... AS SELECT statement.
 
---如何想用insert into as select 把数据插入到system partition中,必须在insert into指定分区表
To insert data into a system-partitioned table using an INSERT INTO ... AS subquery statement, you must use partition-extended syntax to specify the partition into which the values returned by the subquery will be inserted.
 
 
 
后记:关于oracle11g分区新特性,可参考:
 
 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9240380/viewspace-752300/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/9240380/viewspace-752300/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值