日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

oracle10g索引不生效,oracle 10g分区表索引失效测试

發布時間:2023/11/27 生活经验 42 豆豆
生活随笔 收集整理的這篇文章主要介紹了 oracle10g索引不生效,oracle 10g分区表索引失效测试 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一、測試環境

SQL> select * from v$version;

BANNER

----------------------------------------------------------------

Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi

PL/SQL Release 10.2.0.3.0 - Production

CORE10.2.0.3.0Production

TNS for IBM/AIX RISC System/6000: Version 10.2.0.3.0 - Productio

NLSRTL Version 10.2.0.3.0 - Production

二、測試步驟

1.全局索引測試步驟

create table tab (num number,name char(2))

partition by range(num)

(partition a values less than(10),

partition b values less than(20),

partition c values less than(30));

insert into tab values(1,'a');

insert into tab values(11,'a');

insert into tab values(21,'a');

commit;

create index g_idx on tab (num);

----------------------- add測試----------------------------

alter table tab add partition d values less than (40);

alter table tab add partition e values less than (maxvalue);

----------------------- drop測試---------------------------

insert into tab values(31,'a');

commit;

alter table tab drop partition e;

alter table tab drop partition d;

alter index g_idx rebuild;

----------------------- truncate測試----------------------------

alter table tab add partition d values less than (40);

alter table tab add partition e values less than (maxvalue);

insert into tab values(31,'a');

commit;

alter table tab truncate partition e;

alter table tab truncate partition d;

alter index g_idx rebuild;

----------------------- split測試---------------------------

alter table tab add partition d values less than (maxvalue);

alter table tab split partition d at (40) into (partition d,partition e);

insert into tab values(45,'a');

commit;

alter table tab split partition e at (50) into (partition e,partition f);

insert into tab values(65,'a');

commit;

alter table tab split partition f at (60) into (partition f,partition g);

insert into tab values(75,'a');

commit;

alter table tab split partition g at (70) into (partition g,partition h);

alter index g_idx rebuild;

-----------------------查詢語句---------------------------

select index_name,status from dba_indexes where wner='TEST'

2.本地索引測試步驟

create table tab (num number,name char(2))

partition by range(num)

(partition a values less than(10),

partition b values less than(20),

partition c values less than(30));

insert into tab values(1,'a');

insert into tab values(11,'a');

insert into tab values(21,'a');

commit;

create index l_idx on tab (num) local;

----------------------- add測試----------------------------

alter table tab add partition d values less than (40);

alter table tab add partition e values less than (maxvalue);

----------------------- drop測試---------------------------

insert into tab values(31,'a');

commit;

alter table tab drop partition e;

alter table tab drop partition d;

----------------------- truncate測試----------------------------

alter table tab add partition d values less than (40);

alter table tab add partition e values less than (maxvalue);

insert into tab values(31,'a');

commit;

alter table tab truncate partition e;

alter table tab truncate partition d;

----------------------- split測試---------------------------

alter table tab add partition d values less than (maxvalue);

alter table tab split partition d at (40) into (partition d,partition e);

insert into tab values(45,'a');

commit;

alter table tab split partition e at (50) into (partition e,partition f);

insert into tab values(65,'a');

commit;

alter table tab split partition f at (60) into (partition f,partition g);

insert into tab values(75,'a');

commit;

alter table tab split partition g at (70) into (partition g,partition h);

alter index l_idx rebuild partition h;

alter index l_idx rebuild partition g;

-----------------------查詢語句---------------------------

select index_name,partition_name,status from dba_ind_partitions where index_owner='TEST'

三、測試結論

add partition

drop partition

truncate partition

分區表中無數據

分區表中有數據

分區表中無數據

分區表中有數據

global index

VALID

VALID

UNUSABLE

VALID

UNUSABLE

local index

USABLE

USABLE

USABLE

USABLE

USABLE

split partition( split partition a into a and b )

a,b分區均無數據

a分區有數據

b分區無數據

a分區無數據

b分區有數據

a,b分區均有數據

global index

VALID

VALID

VALID

UNUSABLE

local index

USABLE

USABLE

USABLE

UNUSABLE

所查數據字典:

全局索引:dba_indexes

本地索引:dba_ind_partitions

rebuild index語句:

全局索引:alter index g_idx rebuild;

本地索引:alter index l_idx rebuild partition h;

總結

以上是生活随笔為你收集整理的oracle10g索引不生效,oracle 10g分区表索引失效测试的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。