Oracle分区表drop和truncate partition索引失效问题

Hive:drop partition与truncate partition用法和区别 Hive:drop partition与truncate partition用法和区别 一、drop partition与truncate partition用法 drop partition: alter table dw.lens.2090_lens_bianzu_simulation_result drop partition(date=20200419,hour=11) truncate partition: truncate table dw.lens.2090_lens_bianzu_si 阅读详情

DBA的维护管理中,索引失效是一常见的问题,比如move、ctas、交换分区等都会造成索引的失效,以下实验是验证drop partition、truncate partition分区对本地索引和全局索引的影响,在平常中,truncate table表是不会对索引失效的。

基础环境

SQL> create table ou_part (a integer)
  2  partition by range(a)
  3  (
  4  PARTITION OU_PART_01 VALUES less than(10) tablespace TS_OU_01,
  5  partition ou_part_02 values less than(20) tablespace ts_ou_02,
  6  partition ou_part_03 values less than(30) tablespace ts_ou_03,
  7  partition ou_part_04 values less than(40) tablespace ts_ou_04
  8  );
 
Table created
 
Executed in 0.016 seconds
 
SQL> insert into ou_part values (1);
 
1 row inserted
 
Executed in 0 seconds
 
SQL> insert into ou_part values (11);
 
1 row inserted
 
Executed in 0 seconds
 
SQL> insert into ou_part values (21);
 
1 row inserted
 
Executed in 0 seconds
 
SQL> insert into ou_part values (31);
 
1 row inserted
 
Executed in 0 seconds
 
SQL> commit;
 
Commit complete

 

 实验1 
SQL> create index index_glo on ou_part (a) global;
 
Index created
 
Executed in 0 seconds
  
SQL> select status ,index_name from user_indexes where index_name = 'INDEX_GLO';
 
STATUS   INDEX_NAME
-------- ------------------------------
VALID    INDEX_GLO
 
Executed in 0.015 seconds
 
SQL> alter table ou_part truncate partition ou_part_01;
 
Table truncated
 
Executed in 0 seconds
 
SQL> select * from ou_part;
 
                                      A
---------------------------------------
                                     11
                                     21
                                     31
 
Executed in 0.016 seconds
 

此时发现 a=1的数据已经被删除。
SQL> select status ,index_name from user_indexes where index_name = 'INDEX_GLO';
 
STATUS   INDEX_NAME
-------- ------------------------------
UNUSABLE INDEX_GLO
 
Executed in 0 seconds
 此时索引变为了不可用状态,说明当truncate一个分区时,索引会失效。
SQL> alter index index_glo rebuild;
 
Index altered
 
Executed in 0 seconds
 
SQL> select status ,index_name from user_indexes where index_name = 'INDEX_GLO';
 
STATUS   INDEX_NAME
-------- ------------------------------
VALID    INDEX_GLO
 
Executed in 0 seconds
 
SQL> alter table ou_part drop partition ou_part_02;
 
Table altered
 
Executed in 0 seconds
 
SQL> select * from ou_part;
 
                                      A
---------------------------------------
                                     21
                                     31
 
Executed in 0 seconds
 
SQL> select status ,index_name from user_indexes where index_name = 'INDEX_GLO';
 
STATUS   INDEX_NAME
-------- ------------------------------
UNUSABLE INDEX_GLO
 
Executed in 0 seconds

此时索引为不可用,说明drop 分区后索引不可用

实验1说明全局索引在drop partition、truncate partition后索引都会失效,对于Global index,Oracle提供了一参数update global indexes,可避免truncate或drop partition时索引失效问题,另外一种方法是rebuild,这2种方法各有利弊,在生产上不同的环境方法也不一样。

 

实验二
  
SQL> create index index_loc on ou_part (a) local;
 
Index created
 
Executed in 0 seconds
 
SQL> select a.status from User_Ind_Partitions a where a.Index_Name = 'INDEX_LOC';
 
STATUS
--------
USABLE
USABLE
USABLE
USABLE
 
Executed in 0.016 seconds
 SQL> select status from User_Indexes where Index_Name = 'INDEX_LOC';
 
STATUS
--------
N/A
 
Executed in 0.016 seconds
 
SQL> alter table ou_part truncate partition ou_part_01;
 
Table truncated
 
Executed in 0.031 seconds
 
SQL> select a.status from User_Ind_Partitions a where a.Index_Name = 'INDEX_LOC';
 
STATUS
--------
USABLE
USABLE
USABLE
USABLE
 
Executed in 0.016 seconds
 此时会发现truncate partition后,局部索引并没有失效,说明当truncate partition时会维护局部索引
SQL> alter table ou_part drop partition ou_part_01;
 
Table altered
 
Executed in 0 seconds
 
SQL> select a.status from User_Ind_Partitions a where a.Index_Name = 'INDEX_LOC';
 
STATUS
--------
USABLE
USABLE
USABLE
 
Executed in 0.016 seconds

对于局部索引来说,当删除分区表的一个分区时,相对应的,该分区的索引就一同被删除了。

对于索引失效问题,Oracle提供了2种处理方法

1、update global indexes,此种方法主要针对的是全局索引

2、rebuild,支持全局索引和本地索引

这里主要讲的是drop、truncate,那add、split、merge分区又会有什么不同呢,或者有其他需要注意的地方没。

行为预测模型:Social LSTM与Graph Neural Networks 行为预测模型:Social LSTM与Graph Neural Networks ,人工智能,计算机视觉,大模型,AI,本文围绕行为预测模型Social LSTM与Graph Neural Networks展开,介绍了两者的基础概念、原理、应用场景,还对比了它们在优势、劣势和适用场景上的不同,最后给出了相应的代码示例。Social LSTM基于LSTM,通过社交池化层处理多智能体交互;图神经网络处理图结构数据,靠消息传递获取信息,二者各有侧重,适用于不同场景。 阅读详情

相关推荐

告别手动操作!用Python脚本批量处理Siemens NX零件文件(导入/导出/移除参数)

本文详细介绍了如何利用Python脚本实现Siemens NX零件文件的批量处理,包括导入、导出和移除参数等操作。通过NX Open API和Python UF接口,工业设计师可以大幅提升工作效率,告别繁琐的手动操作。文章提供了完整的实战指南,涵盖环境配置、核心功能实现以及性能优化技巧,特别适合需要进行Siemens-NXUG二次开发的工程师参考。

weixin_28222493的博客 262

【mysql表分区系】mysql表分区谨慎使用DROP PARTITION语法以及TRUNCATE PARTITION

首先声明下我这边使用的mysql版本是5.7.29版本,当然下面的问题我这边也是基于这个版本。这里因为没有考证其他版本是否也会有这些问题,可自行来查阅资料。

run_boy_2022的博客 4054

求一个点到任意两个点所在直线距离 C#代码公式

求点C(X0,Y0) 到点A(x1,y1)和点B(x2,y2)所在直线的距离 1.已知任意两个点,求这两个点所在直线 已知点A(x1,y1),点B(x2,y2) 设直线上另外任意一个点为(x,y) 那么 (x-x1)/(y-y1) = (x2-x1)/(y2-y1); 整理后得方程: (y2-y1)x + (x1-x2)y + (y1-...

qq_29434987的博客 4493

分区truncate操作的介绍

① 马上回收空间:   alter table table_name truncate partition partition_name drop storage;   ② 同时维护全局索引:   alter table table_name drop partition partition_name update global indexes;   ㈡ 对全局索引的作用   大分区表t

enenwenwen的专栏 2万+

【Labview学习】——如何实现软件的中/英文切换

各位亲爱的小伙伴们大家好,这里是小万的labview专题,今天为大家带来的是软件的中/英文切换,在全球化的浪潮之下,各行各业发生着巨大的变化,emmm………… 以下是简单的演示图片,注意观察菜单栏和软件界面各控件的语言状态: 本次分享将分为两部分:菜单中英文切换&界面控件中英文切换 ** 菜单中英文切换 ** 1. 中/英文菜单制造 要想实现菜单的中/英文语言切换,就得做两个菜单,一个...

weixin_44827166的博客 1万+

条件风险价值CVaR内容介绍(MATLAB例程)

在对微电网优化调度过程中,由于新能源机组出力和负荷的不确定性,若采用确定性的优化调度方案会存在一定的风险。反之,若风电和光伏输出功率的实际值高于预测值时,则需要降低可控机组出力或者弃风弃光,这都会给系统带来运行费用增加的风险。下,损失超过VaR值时的条件均值[1]。VaR是指在一定的置信水平下,某一投资组合在未来某一时间段内的最大损失。为m维决定系统风险损失的随机向量f(y)为y的概率密度函数。式中,m为所有场景的数量,yk为第k个场景下随机变量的值,为第k个场景发生的概率。的最小值即为CVaR,对应的。

贾贾的博客 3061

Oracle分区表索引

导致全局索引失效,本地索引因为分区已经drop掉了,也就不存在索引失效的说法了,drop分区时指定update global indexes全局索引不会失效。导致全局索引和本地索引都失效,split分区时指定update global indexes全局索引不会失效,split相关的分区本地索引可以重建。导致全局索引失效,不会导致本地索引失效,truncate分区时指定update global indexes全局索引不会失效。不会导致全局和本地索引失效。...

viviliving的专栏 8689

基于Simulink的无线充电系统LCC补偿网络建模与控制

本文详细介绍了基于Simulink的无线充电系统LCC补偿网络建模与控制方法。首先分析了无线充电系统面临的核心挑战,提出LCC补偿网络解决方案,阐述了其恒流输出和输入阻抗解耦原理。通过Simulink分步演示了系统建模过程,包括松耦合变压器、LCC+LC补偿网络、功率变换级搭建以及频率跟踪控制实现。仿真结果表明,LCC补偿系统在气隙变化和负载跳变下能保持输出电压稳定(波动±3%),效率达89%。文章还总结了工程实现要点,并探讨了动态充电、多负载系统等扩展应用。该教程为开发高效智能的无线充电系统提供了实用指导

amy_mhd的博客 64

Oracle分区表删除分区数据时导致索引失效解决(转载)

原文地址:https://blog.youkuaiyun.com/e_wsq/article/details/80896258 一、描述 今天有个小任务就是要删除些数据,哈哈,先自己小开心一下。因为要删除的数据表是我之前转换成的分区表。这个分区表是按照里面有个创建时间字段来分区的,1个季度为1个分区。所以我现在要将2017年7月1日之前的数据删除(数据量约1000万),可以直接删除表分区数据就...

叁、三的随笔 1713

用 ABAP 驾驭 OAuth 2.0:从 Authorization Code 到 SAML Bearer 的全栈落地指南

ABAP平台OAuth 2.0客户端开发实践 本文为SAP开发者详细解析ABAP平台内置OAuth 2.0客户端的使用方法,涵盖四种授权流的最佳实践: 授权流选择: Authorization Code:适用于用户交互场景 SAML 2.0 Bearer:适合已有SAML体系的企业 Client Credentials:系统间通信 Password Credentials:过渡方案(不推荐) 配置流程: 通过SE80定义Client Profile 使用SOAUTH2_CLIENT/OA2C_CONFIG配

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 310

【专栏必读】王道考研408操作系统+Linux系统编程万字笔记使用说明及章节导航

王道408考研操作系统)第一章计算机系统概述-第一节1、2:操作系统概念、概念和特征1:理解fork的作用prinf("还没有执行fork函数的本进程为:%d\n" , getpid());//其返回值是pid类型的 sleep(1);if(ret > 0) //父进程返回的是子进程ID {printf("我是父进程,我的id是:%d,我的孩子id是%d\n" , getpid() , ret);sleep(1);} } else if(ret == 0) //子进程fork返回值是0 {.........

快乐江湖的博客 3万+

truncate分区表的操作,会导致全局索引失效?

今天看到《删除分区如何不让全局索引失效?》这篇文章有朋友提了个问题,truncate是删除数据操作,但他是DDL语句,不是delete这种DML语句,不会写redo和undo,不能rol...

bisal的专栏 8116

Scale-up,scale-out技术概述

本文系统分析了Scale-up与Scale-out两种扩展技术在现代计算中的应用与发展。Scale-up通过增强单节点性能,适用于高耦合任务,而Scale-out通过横向扩展节点,实现高可用性和无限扩展。在芯片层面,Chiplet技术推动Scale-up发展;在数据中心层面,二者协同工作构建强大集群。光模块在长距离高带宽传输中发挥关键作用。文章对比了NVIDIA、AMD和Broadcom三家公司的技术路线,指出NVIDIA采用封闭生态,AMD选择开放标准,Broadcom则主导底层连接技术。未来发展方向将聚

元直的博客 1449

Oracle分区表删除分区数据时导致索引失效解决

一、描述      今天有个小任务就是要删除些数据,哈哈,先自己小开心一下。因为要删除的数据表是我之前转换成的分区表。这个分区表是按照里面有个创建时间字段来分区的,1个季度为1个分区。所以我现在要将2017年7月1日之前的数据删除(数据量约1000万),可以直接删除表分区数据就好。如果要是用delete去删除这么多的数据,我还要写存储过程,分批提交的这样做。就是这样的一简单的truncate pa...

冷月宫主的专栏 9126

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

oracle分区表local索引,操作分区表对global和local索引的影响

使用分区表,要非常注意索引。因为删除、move分区都会造成索引失效。小表的索引和非主键、唯一建索引还好,重建即可。如果是几十G的表,重建索引花费巨大,会严重影响查询性能;如果是主键或者唯一键索引,索引失效会插入重复的数据,带来的麻烦更大。所以,我们一定要重视分区表操作,避免引起索引失效。哪些操作会引起索引失效?ADDPARTITION | SUBPARTITION (hash)COALESCE P...

weixin_39600447的博客 1305

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

oracle组合索引失效_在Oracle数据库中,哪些操作会导致索引失效?

题目在Oracle数据库中,哪些操作会导致索引失效?A答案当某些操作导致数据行的ROWID改变,索引就会完全失效。可以分普通表和分区表来讨论哪些操作将导致索引失效。(一)普通表索引失效的情形如下所示:① 手动置索引无效:ALTER INDEX IND_OBJECT_ID UNUSABLE;。② 如果对表进行MOVE操作(包含移动表空间和压缩操作)或在线重定义表后,那么该表上所有的索引状态会变为UN...

weixin_39556702的博客 246

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Oracle drop,truncate partition 索引失效 实验

--Oracle drop,truncate partition 索引失效实验 create tablespace part_tbs1 datafile '/oradata/dg1/part_tbs1.dbf' size...

cuiyong8723的博客 891

oracle表分区失效14400,Oracle分区表删除分区数据时导致索引失效解决

一、描述今天有个小任务就是要删除些数据,哈哈,先自己小开心一下。因为要删除的数据表是我之前转换成的分区表。这个分区表是按照里面有个创建时间字段来分区的,1个季度为1个分区。所以我现在要将2017年7月1日之前的数据删除(数据量约1000万),可以直接删除表分区数据就好。如果要是用delete去删除这么多的数据,我还要写存储过程,分批提交的这样做。就是这样的一简单的truncate partitio...

weixin_29601703的博客 731

mysql truncate 索引_truncate分区表的操作,会导致全局索引失效?

今天看到《删除分区如何不让全局索引失效?》这篇文章有朋友提了个问题, truncate是删除数据操作,但他是DDL语句,不是delete这种DML语句,不会写redo和undo,不能rollback。官方文档,已经明确指出,除非使用update indexes,否则用truncate分区表,就会导致全局索引失效,必须重建,Unless you specify UPDATE INDEXES, any...

weixin_26845891的博客 1727

使用分区表的请一定注意这个问题

在Oracle数据库中,分区表(Partitioned Tables)是处理大规模数据的利器,通过将表数据按键值(如日期、范围)分成逻辑分区,提高查询效率和管理灵活性。异步全局索引维护机制从Oracle 12c开始,当执行DROP或TRUNCATE PARTITION并带有UPDATE GLOBAL INDEXES时,Oracle默认采用异步全局索引维护(Asynchronous Global Index Maintenance)。通过主动管理,可最大化分区表的优势,确保系统稳定。

xiaofan23z的专栏 745

在Oracle数据库中,哪些操作会导致索引失效?

A答案 当某些操作导致数据行的ROWID改变,索引就会完全失效。可以分普通表和分区表来讨论哪些操作将导致索引失效。 (一)普通表索引失效的情形如下所示: ① 手动置索引无效:ALTER INDEX IND_OBJECT_ID UNUSABLE;。 ② 如果对表进行MOVE操作(包含移动表空间和压缩操作)或在线重定义表后,那么该表上所有的索引状态会变为UNUSABLE。MOVE操作的S...

qq_40588579的博客 2175

Oracle之分区truncate、drop、add等索引失效分分析

truncate分析: 结论:全局索引truncate 分区和交换分区都会导致索引失效果 局部索引truncate分区不会导致索引失效。 此处只说索引失效的场景(只会影响全局索引): 结论:全局索引truncate 分区和交换分区都会导致索引失效果 局部索引truncate分区不会导致索引失效。 connect ljb/ljb drop table part_tab_

qq_33879355的博客 2747

Partition Tabel测试drop和truncate 分区对全局和本地索引是否有影响

创建分区表: create table test10 ( sal_date date not null, sal_id number not null, sal_row number(12) not null ) partition by range(sal_date) ( partition p_1 v

Vage Fang的Oracle 990

Oracle 分区表中索引失效

当对分区表进行 一些操作时,会造成索引失效。 当有truncate/drop/exchange操作分区 时全局索引会失效。 exchange的临时表没有索引,或者有索引,没有用including indexes的关键字,会导致局部的索引失效,就是某个分区失效重建局部索引只能用alter index local_idx rebuild partition p1这样的方式 分区表SP...

weixin_34050389的博客 905

下列哪条语句不会引起mysql的索引失效_在Oracle数据库中,哪些操作会导致索引失效?...

原标题:在Oracle数据库中,哪些操作会导致索引失效?题目在Oracle数据库中,哪些操作会导致索引失效?A答案当某些操作导致数据行的ROWID改变,索引就会完全失效。可以分普通表和分区表来讨论哪些操作将导致索引失效。(一)普通表索引失效的情形如下所示:① 手动置索引无效:ALTER INDEX IND_OBJECT_ID UNUSABLE;。② 如果对表进行MOVE操作(包含移动表空间和压缩操...

weixin_31101725的博客 346
上一篇: oracle定期生成和删除表分区
下一篇: MyEclipse8.5注册码有效期2018年
myheartjava
博客等级 码龄14年 6粉丝 6原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值