当前位置:网站首页>If the data of the oracle business table is added, deleted, or modified, will the index of the table write redo and undo?
If the data of the oracle business table is added, deleted, or modified, will the index of the table write redo and undo?
2022-08-10 06:50:00 【Liu VIP】
The Oracle database must write redo and undo for the addition, deletion and modification of the table.When the data of the table is added, deleted, or modified, the index oracle of the table will be automatically maintained.Then ask, whether oracle will also write redo and undo for this "maintenance" of the index?Manual additions, deletions, rebuilds, and index modifications are not considered.
Other Answer 1:
When we insert a piece of data, first the action will be recorded in the redo log, the operation will also be recorded in the undo, the action of the undo itself will also be recorded in the redo log as a piece of data, insert a piece of data,The index (indexes) will change, and the change of the index will also make a data record to the redo log
Other Answer 2:
Index maintenance will also generate corresponding redo logs
This ensures that the corresponding index will also be changed when applying log recovery
Other Answer 3:
Of course.
Keep in mind an essential principle that redo information will be recorded for operations involving block changes.
If you think about delayed block clearing, it's just that changes in transaction slots in the database will record redo (the essential reason why select will cause redo in some cases), not to mention the relatively "heavyweight" operation of maintaining indexes.
Other Answer 4:
I thought about it again, I personally think that the operation of automatically updating the index with the addition, deletion and modification of the table will not record redo and undo.(Do not consider the DDL situation of manual addition, deletion, rebuilding, and index modification.)
Because: the update of the index occurs automatically according to the addition, deletion and modification of the table. If the index or index-related change information also records redo and undo, thenWhen doing rollback and rollforward, the automatic index maintenance mechanism and the index change update registered in the rollforward (rollback) will conflict.
Other Answer 5:
I think so.Let me tell you what I understand: In oracle, indexes and data belong to different segments, and the bottom layer is a block. To delete a piece of data, you need to maintain the index tree, and you need to operate the block. In order to achieve crash recovery, it is necessary to change these changes.Both are written to the redo log, and I guess, if they are written together with the redo of the data block, if they belong to two atomic operations, then the transactionality of these two operations must be guaranteed.
Other Answer 6:
Just test it yourself, it's clear at a glance, why guess, just by feeling?
SQL> create table t1 (id number);Table created.SQL> insert all 2 into t1 values(1) 3 into t1 values(2) 4 into t1 values(3)5 select 1 from dual;3 rows created.SQL> commit;Commit complete.SQL> create index idx_t1 on t1(id);Index created.SQL> select current_scn from v$database;CURRENT_SCN----------- 46939397SQL> update t1 set id=5 where id=3;1 row updated.SQL> commit;Commit complete.SQL> select current_scn from v$database;CURRENT_SCN----------- 46939443SQL> altersystem dump logfile '/u01/app/oracle/oradata/HKORA/onlinelog/o1_mf_3_j7z2qcb9_.log' scn min 46939397 scn max 46939443;System altered.SQL> @tracefileVALUE------------------------------------------------------------------------------------------------------------------------------------------------------/u01/app/oracle/diag/rdbms/hkora/hkora/trace/hkora_ora_15168.trcSQL> select object_id from dba_Objects where object_Name='T1' and owner='DEVIN'; OBJECT_ID---------- 82502SQL> select object_id from dba_Objects where object_Name='IDX_T1'; OBJECT_ID---------- 82503
CHANGE #3 CON_ID:0 TYP:2 CLS:1 AFN:8 DBA:0x0200240c OBJ:82502 SCN:0x0000000002cc3cbe SEQ:1 OP:11.5 ENC:0 RBL:0 FLG:0x0000
CHANGE #2 CON_ID:0 TYP:0 CLS:1 AFN:8 DBA:0x02002413 OBJ:82503 SCN:0x0000000002cc3cd7 SEQ:1 OP:10.4 ENC:0 RBL:0 FLG:0x0000
边栏推荐
- 2022 Henan Mengxin League (fifth) game: University of Information Engineering H - Xiao Ming drinking milk tea
- 调试ZYNQ的u-boot 2017.3 不能正常启动,记录调试过程
- A few lines of code can crash the system;
- initramfs与initrd的区别
- 2022河南萌新联赛第(五)场:信息工程大学 F - 分割草坪
- 761. 特殊的二进制序列
- Nude speech - lying flat - brushing questions - big factory (several tips for Android interviews)
- SCS【2】单细胞转录组 之 cellranger
- Deep understanding of the array
- [Reinforcement Learning] "Easy RL" - Q-learning - CliffWalking (cliff walking) code interpretation
猜你喜欢
随机推荐
如何治理资源浪费?百度云原生成本优化最佳实践
杭州公积金修改手机号信息
DGIOT支持工业设备租赁以及远程管控
u-boot ERROR: Failed to allocate 0x5c6f bytes below 0x17ffffff.Failed using fdt_high value
Complex AB experiment
3.事务篇【mysql高级】
CuteOneP 一款php的OneDrive多网盘挂载程序 带会员 同步等功能
【强化学习】《Easy RL》- Q-learning - CliffWalking(悬崖行走)代码解读
高级测试:如何使用Flink对Strom任务的逻辑功能进行复现测试?
941 · Sliding Puzzles
第12章 数据库其它调优策略【2.索引及调优篇】【MySQL高级】
Data types for database learning
foreach遍历删除元素问题总结
Sort binary tree code
Reproduce dns out-band data combined with sqlmap
Elementary Structure
概率分布及其应用
Confluence可以连接数据库但是在下一步就报错了
2022河南萌新联赛第(五)场:信息工程大学 F - 分割草坪
About MongoDb query Decimal128 to BigDecimal problem