当前位置:网站首页>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---------- 82503CHANGE #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
边栏推荐
- 浅谈C语言整型数据的存储
- 基于STC8G2K64S4单片机通过OLED屏幕显示模拟量光敏模拟值
- Confluence可以连接数据库但是在下一步就报错了
- 调试ZYNQ的u-boot 2017.3 不能正常启动,记录调试过程
- IDLE开发wordCount程序(第五弹)
- What is an MQTT gateway?What is the difference with traditional DTU?
- The constraints of the database learning table
- .NET-7.WPF学习经验总结
- 941 · Sliding Puzzles
- 添加spark的相关依赖和打包插件(第六弹)
猜你喜欢
随机推荐
WooCommerce 安装和 rest api 使用
排序二叉树代码
个人博客系统
什么是MQTT网关?与传统DTU有哪些区别?
All articles summary directory
Ladies and gentlemen, oracle11g, cdc2.2, flink1.13.6, single-table incremental synchronization.Without adding data
mysql数据库定时备份(保留近7天的备份)
Qt使用私有接口绘制窗口阴影
2022 Henan Mengxin League (fifth) game: University of Information Engineering H - Xiao Ming drinking milk tea
MySQL事务隔离级别
裸辞—躺平—刷题—大厂(Android面试的几大技巧)
2022河南萌新联赛第(五)场:信息工程大学 K - 矩阵生成
[Network Security] Practice AWVS Range to reproduce CSRF vulnerability
复现dns外带数据结合sqlmap
C语言文件操作
761. Special Binary Sequences
C language file operation
MySQL索引事务
机器学习_LGB调参汇总(开箱即食)
IDLE开发wordCount程序(第五弹)









