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分区表索引失效测试相关推荐
- oracle 10g 分区管理,Oracle 10g分区表的自动维护
Oracle 10g分区表不支持自动化管理,一般都要手动创建分区,手动删除.今天给大家带来了一个自动化管理表空间的脚本. 本脚本主要由3个部分组成:sys_ConfigTable.sql.sys_pr ...
- oracle为表增加索引,【增加Oracle中表的索引】
1)概念: Oracle中的索引是基于表或集群的数据对象. 它具有类似于表的独立段存储结构,并且需要在表空间中分配存储空间. 2)功能: 可以提高查找表中数据的速度. 1)B树索引(测试站点): 它是 ...
- oracle 修改索引的名称,Oracle中查询索引名称,批量修改索引名称语句
在Oralce数据库数据优化过程中,对源数据表处理,原则上是做更名备份,作为被查或回退使用,所以,有修改数据表名后重新建表的操作,这样,往往也需要修改索引.主键.外键名称,方便重建,为了方便.快速生成 ...
- oracle10g密码不对,谈谈Oracle 10g 密码文件
谈谈Oracle 10g 密码文件 Oracle 10g实例搜索密码文件时默认是搜索$ORACLE_HOME/dbs目录下面的orapw$ORACLE_SID文件,当orapw$ORACLE_SID文 ...
- oracle 10g分区表,oracle10g-11gR2 分区表汇总一
在oracle10g(在10.2.0.4中测试)中:分区表共分为:range.list.hash,复合分区可以是:range-list.range-hash 测试之前先创建4个表空间tbs_1,tbs ...
- oracle10g的rat模拟,Oracle 10g Logminer 研究及测试
LogMiner提供了一个处理重做日志文件并将其内容翻译成代表对数据库的逻辑操作的SQL语句的过程.LogMiner运行在Oracle版本8.1或者更高版本中. 一,如何使用Logminer: 先要安 ...
- oracle 10g分区表,oracle10g--11gR2分区表汇总四
3.2.7.2 (分区表enable)-(非分区表diable keep index)-exchange--exchange 解释: 首先:分区表primary key是enable的,非分区表pri ...
- oracle10g生成awr报告,oracle 10g awr报告生成步骤及awr报告分析
3. io:如果需要的数据在内存中没有,则需要到磁盘中去取,就会用到物理io了,还有表之间的连接数据太多,以及排序等操作内存放不下的时候,也需要用到临时表空间,也就用到物理io了 这里有一点说明的是, ...
- oracle 删掉索引,如何清除Oracle中无用索引
DML性能低下,其中最严重的原因之一是无用索引的存在.所有SQL的插入,更新和删除操作在它们需要在每一行数据被改变时修改大量索引的时候会变得更慢. 许多Oracle 管理人员只要看见在一个SQL 查询 ...
最新文章
- linux 下的服务
- 【汇总】一大波CVPR2020开源项目重磅来袭!
- 看BAT技术面试官如何挑选Java程序员
- C语言函数指针 和 OC-Block
- linux连接磁盘阵列,CentOS/Linux 连接 iSCSI 磁盘阵列
- 易格斯拖链选型手册_拖链相关知识
- 潜移默化学会WPF(绚丽篇)--热烈欢迎RadioButton,改造成功,改造成ImageButton,新版导航 - AYUI框架 - 博客园...
- python拼图游戏代码的理解_Python加pyGame实现的简单拼图游戏实例
- mysql 嵌套if标签_对比Excel、MySQL、Python,分别讲述 “if函数” 的使用原理!
- php中修改元素值为5,php怎么改变元素数组的值
- 考研英语一和英语二的区别
- js通过图片url获取图片base64编码
- lbp2900打印机linux驱动下载,佳能LBP2900+打印机驱动
- 游艇床垫MED认证证书/床垫Wheel Mark舵轮标识认证
- 银河麒麟v10离线安装docker-ce
- 影响时尚界的十大可穿戴技术创业公司
- 【学习笔记】算法101--数学(二)2.3篇
- 计算机科学计算矩阵答案,计算机科学计算答案.doc
- JAVA的GUI编程02——事件监听(ActionListener)、TextField事件监听、(组合、内部类)
- 《马克思主义基本原理》复习重点