29
(2)全局索引 Oracle 会自动维护分区索引,对于全局索引,如果在对分区表操作时,没有指定update index,则会导致全局索引失效,需要重建。SQL> select owner,index_nam...
28
只要索引的引导列包含分区键,就是有前缀的分区索引。4.3 索引重建问题(1)分区索引 对于分区索引,不能整体进行重建,只能对单个分区进行重建。语法如下: ...
27
--这个是有前缀的分区索引。 SQL> create index i_time_global on PDBA(id) global 2 partition by range(time) 3 (partition p1 values less than (TO_DATE('2010-12-1', 'YYYY-MM-DD')),&...
26
示例2:全局分区索引,只支持Range 分区和Hash 分区:(1)创建2个测试分区表:sql> create table pdba (id number, time date) partition by range (time) 2 ( 3 partition p1 values less...
25
注意:Oracle只支持2中类型的全局分区索引: range partitioned 和 Hash Partitioned.官网的说明如下:Global Partitioned Indexes ...
24
SQL> create index ix_custaddr_local_areacode on custaddr(areacode) local;索引已创建。验证2个索引的类型:SQL> select index_name,table_name,partitioning_type,locality,ALIGNMENT from user_part_indexes wh...
23
第 2 行出现错误:ORA-14038: GLOBAL 分区索引必须加上前缀4.1 Local 本地索引 对于local索引,当表的分区发生变化时,索引的维护由Oracle自动进行。注意事项:(1) 局部...
22
(1)有前缀的分区索引指包含了分区键,并且将其作为引导列的索引。如:create index i_id_global on PDBA(id) global --引导列 2 partition by range(id) --分区键 3 (partiti...
21
3.6. Drop分区SQL> alter table custaddr drop partition T_LIST551;表已更改。SQL> select table_name,partition_name from user_tab_partitions where table_name='CUSTADDR';TABLE_NAME &...
20
3.4 . 移动分区SQL> alter table custaddr move partition P_OTHER tablespace system;表已更改。SQL> alter table custaddr move partition P_OTHER tablespace icd_service;表已更改。注意:分区移动会自动维护局...
19
3.3 合并分区Merge 相邻的分区可以merge为一个分区,新分区的下边界为原来边界值较低的分区,上边界为原来边界值较高的分区,原先的局部索引相应也会合并,全局索引会失效,需...
18
3.3 合并分区Merge 相邻的分区可以merge为一个分区,新分区的下边界为原来边界值较低的分区,上边界为原来边界值较高的分区,原先的局部索引相应也会合并,全局索引会失效,需...
17
3.2 split 分区拆分 在3.1 中,我们说明了可以使用split的方式来添加分区。 这里我们用split方法继续上面的实验。sql> alter table custaddr split partition p_other values('552') into (partition t_l...
16
TABLE_NAME PARTITION_NAME------------------------------ ------------------------...
学习之应用基础(15)
(4)添加新分区SQL> alter table custaddr add partition t_list551 values('551') tablespace icd_service;表已更改。SQL> select table_name,partition_name from user_tab_partitions where table_name='C...
学习之应用基础(14)
三. 分区表的其他操作3.1 添加新的分区添加新的分区有2中情况:(1)原分区里边界是maxvalue或者default。 这种情况下,我们需要把边界分区drop掉,加上新分区后,在添加上新的分区。 或者采用split,对边界分区进行...
学习之应用基础(13)
4.6 结束重定义SQL> BEGIN 2 dbms_redefinition.finish_redef_table( 3 uname => 'ICD', 4 orig_table => 'unpar_table', 5 int_table => 'par_table'); 6&n...
学习之应用基础(12)
2. 收集表的统计信息sql> exec dbms_stats.gather_table_stats('icd', 'unpar_table', cascade => true);pl/sql 过程已成功完成。3. 创建临时分区表sql> create table par_table (id number primary key, time...
学习之应用基础(11)
使用在线重定义的一些限制条件:(1) There must be enough space to hold two copies of the table. (2) Primary key columns cannot be modified. (3) Tables must have primary keys. (4) Redefinit...
学习之应用基础(10)
SQL> insert into p_dba values(999999,to_date('2012-12-29','yyyy-mm-dd'));insert into p_dba values(999999,to_date('2012-12-29','yyyy-mm-dd')) ...