原文连接:[url]http://blog.sina.com.cn/s/blog_4be7cab90100awz2.html[/url]
分区表主键如何使用分区索引?
主键索引失效,rebuild太慢了,
打算建立分区索引时才意识到以前没做过这样的工作,
建表时,在添加primary key时会自动生成索引,这个索引并不会进行随着表分区而分区。
于是查资料,找到这篇文章
文章中心就一句话:现在需要建立主键的列上创建一个分区索引,然后添加主键,oracle会自动选用这个索引作为主键的索引。
PURPOSE
This article gives examples of how to create primary key partitioned
indexes.
SCOPE & APPLICATION
For users trying to create primary key partitioned indexes.
How To Create Primary Key Partitioned Indexes:
==============================================
Example:
SQL> -- Create partitioned table TEST_A
SQL>
SQL> CREATE TABLE test_a (col1 number, col2 number, col3 varchar2(20))
2 PARTITION BY RANGE (col1, col2)
3 (partition part_test_a_1 values less than (10, 100),
4 partition part_test_a_2 values less than (20, 200),
5 partition part_test_a_3 values less than (30, 300),
6 partition part_test_a_4 values less than (40, 400));
Table created.
SQL> -- Create partitioned table TEST_B
SQL>
SQL> CREATE TABLE test_b (col1 number, col2 number, col3 varchar2(20))
2 PARTITION BY RANGE (col
分区表主键如何使用分区索引?
主键索引失效,rebuild太慢了,
打算建立分区索引时才意识到以前没做过这样的工作,
建表时,在添加primary key时会自动生成索引,这个索引并不会进行随着表分区而分区。
于是查资料,找到这篇文章
文章中心就一句话:现在需要建立主键的列上创建一个分区索引,然后添加主键,oracle会自动选用这个索引作为主键的索引。
PURPOSE
This article gives examples of how to create primary key partitioned
indexes.
SCOPE & APPLICATION
For users trying to create primary key partitioned indexes.
How To Create Primary Key Partitioned Indexes:
==============================================
Example:
SQL> -- Create partitioned table TEST_A
SQL>
SQL> CREATE TABLE test_a (col1 number, col2 number, col3 varchar2(20))
2 PARTITION BY RANGE (col1, col2)
3 (partition part_test_a_1 values less than (10, 100),
4 partition part_test_a_2 values less than (20, 200),
5 partition part_test_a_3 values less than (30, 300),
6 partition part_test_a_4 values less than (40, 400));
Table created.
SQL> -- Create partitioned table TEST_B
SQL>
SQL> CREATE TABLE test_b (col1 number, col2 number, col3 varchar2(20))
2 PARTITION BY RANGE (col