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进行分区,又想把数据均分在不同的分区中,可采用此种方式;
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
由系统产生分区名字,如: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
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);
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
---------- ----------
1 1
1 1
3 3
SQL> select * from t_system_partition partition(sys_p41);
A B
---------- ----------
1 1
---------- ----------
1 1
SQL> select * from t_system_partition partition(sys_p42);
A B
---------- ----------
1 1
3 3
---------- ----------
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/