暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Redo Record 中 OP 代码的含义

104

这是单行更新的 redo 日志转储示例,此表 c2 字段之前的值为 10,更新为20

    UPDATE t1 SET c2 = 20 WHERE c1 = 1;

    redo record 是由一个 redo header 和多个 change vector('CHANGE #?')组成。下面是 redo record 开始部分的 Header 信息:

      REDO RECORD - Thread:1 RBA: 0x003e12.00000004.01cc LEN: 0x00f8 VLD: 0x01 
      SCN: 0x0000.0ac73691 SUBSCN:  1 06/26/2003 14:40:14

      通过头部信息中的 LEN: 0x00f8 (此值为十六进制,转为十进制为248),可以看出, redo record 的长度为 248 字节。

      Redo Header:记录了 Redo 的长度 LEN: 0x00f8,redo record 的地址 RBA: 0x003e12.00000004.01cc,SCN:0x0000.0ac73691等信息

      Change Vector:它是数据变化的原子结构。

      Change 1  :

        CHANGE #1 TYP:0 CLS:26 AFN:3 DBA:0x00c04ab7 SCN:0x0000.0ac73690 SEQ:  2 OP:5.1
        ktudb redo: siz: 104 spc: 1860 flg: 0x0022 seq: 0x233f rec: 0x02
        xid: 0x0005.00b.0000460b
        ktubu redo: slt: 11 rci: 1 opc: 11.1 objn: 19378 objd: 19378 tsn: 4
        Undo type: Regular undo Undo type: Last buffer split: No
        Tablespace Undo: No
        0x00000000
        KDO undo record:
        KTB Redo
        op: 0x02 ver: 0x01
        op: C uba: 0x00c04ab7.233f.01
        KDO Op code: URP row dependencies Disabled
        xtype: XA bdba: 0x0144d022 hdba: 0x0144d021
        itli: 1 ispac: 0 maxfr: 1177
        tabn: 0 slot: 2(0x2) flag: 0x2c lock: 0 ckix: 0
        ncol: 2 nnew: 1 size: 0
        col 1: [ 2] c1 0b

        Change 2 :

          CHANGE #2 TYP:0 CLS: 1 AFN:5 DBA:0x0144d022 SCN:0x0000.0ac73690 SEQ:  1 
          OP:11.5 KTB Redo 
          op: 0x02 ver: 0x01
          op: C uba: 0x00c04ab7.233f.02
          KDO Op code: URP row dependencies Disabled
          xtype: XA bdba: 0x0144d022 hdba: 0x0144d021
          itli: 1 ispac: 0 maxfr: 1177
          tabn: 0 slot: 2(0x2) flag: 0x2c lock: 1 ckix: 0
          ncol: 2 nnew: 1 size: 0
          col 1: [ 2] c1 15

          操作码:

          以下是 Redo 日志中 OP 代码的含义(其中的?表示猜测或未知):

          1 事务控制(Transaction Control)

          2 事务读取(Transaction read)

          3 事务更新(Transaction update)

          4 块清理(Block cleanout)

             
          4.1     块清理记录(Block cleanout record)

             
          4.2     物理清理(Physical cleanout)

             
          4.3     单数组范围(Single array change)

             
          4.4     多数组范围(Multiple array changes)

             
          4.5     格式块(Format block)

             
          4.6    ktbcc redo - 提交时间块清理变更(ktbcc redo -  Commit Time Block Cleanout Change)

          5  事务 undo 管理(Transaction undo management)

              
          5.1     ktudb redo (undo block redo)

              
          5.2     ktudh redo (undo header redo)

              
          5.3     Rollout a transaction begin

            
          5.4     ktucm redo (change transaction slot state (commit/rollback))

              
          5.5     Create rollback segmenr

              
          5.6     ktubu redo: mark undo record "user undo done"

              
          5.7     Restore transaction table slot.

              
          In the ktubl for 'dbms_transaction.local_transaction_id'

              
          (begin transaction) - also arrives for incoming distributed

              
          tx, no data change but TT slot acquired. Also for recursive

              
          transaction (e.g. truncate). txn start scn:  0xffff.ffffffff

               
          Also prior to securefile LOB insertion.

              
          5.8     Mark transaction as dead

              
          5.9     Rollback extension of rollback seg

             
          5.10    Rollback segment header change for extension of rollback seg

             
          5.11    Set current undo block (uba) in undo header during rollback

              
          5.19    Transaction audit record - first

              
          5.20    Transaction audit record - subsequent

             
          5.23    ktudbr redo: disable block level recovery (reports XID)

              
          5.24    ktfbhundo - File Space Header Undo

              
          5.28    ktuuntp - ??

           

          6 Control file

           

          10 Index

              
          10.1    SQL load index block

              
          10.2    Insert Leaf Row

              
          10.3    Purge Leaf Row

              
          10.4    Delete Leaf Row

              
          10.5    Restore Leaf Row during rollback

              
          10.6    (kdxlok) Lock block (pre-split)

             
          10.7    (kdxulo) unlock block (clear block opcode during rollback (?or commit?))

              
          10.8    (kdxlne) initialize (and load) newly allocated leaf block

              
          10.9    (kdxair) apply XAT do to ITL 1  -- (service ITL) related to leaf block split

              
          10.10   Set leaf block next pointer

             
          10.11   (kdxlpr) set kdxleprv kdxlenxt (previous / next leaf pointer)

              
          10.12   Initialize root block after split

              
          10.13   index redo (kdxlem): (REDO) make leaf block empty,

              
          10.14   Restore block before image

              
          10.15   (kdxbin) Insert branch block row

              
          10.16   Purge branch row

              
          10.17   Initialize new branch block

              
          10.18   Update key data in row -- index redo (kdxlup): update keydata

              
          10.19   Clear split flag

              
          10.20   Set split flag

              
          10.21   index general undo (branch) operations

              
          10.22   Undo leaf operation

              
          10.23   restore block to tree

              
          10.24   Shrink ITL

              
          10.25   format root block

              
          10.26   format root block (undo)

              
          10.27   format root block (redo)

              
          10.28   Migrating block (undo)

              
          10.29   Migrating block (redo)

              
          10.30   Update nonkey value

              
          10.31   index root block redo (kdxdlr):  create/load index

              
          10.34   make block empty

              
          10.35   index redo (kdxlcnu): update nonkey

             
          10.37   undo index change (kdxIndexlogicalNonkeyUpdate) -- bitmap index

              
          10.38   index change (kdxIndexlogicalNonkeyUpdate) -- bitmap index

              
          10.39   index redo (kdxbur) :  branch block update range

              
          10.40   index redo (kdxbdu) :  branch block DBA update,

           

          11 Table

              
          11.1    undo row operation

              
          11.2    IRP insert row  piece

              
          11.3    DRP delete row piece

              
          11.4    lock row piece

              
          11.5    URP update row piece

              
          11.6    overwrite row piece

              
          11.7    manipulate first column

              
          11.8    change forwarding address - migration

              
          11.9    change cluster key index

              
          11.10   Set Cluster key pointers

              
          11.11   Insert multiple rows

              
          11.12   Delete multiple rows

              
          11.13   toggle block header flags

              
          11.14   [M] KDODSC

              
          11.15   [M] KDOMBC

             
          11.16 [M] Logminer support - RM for rowpiece with only logminer columns - KDOLMN

              
          11.17   Update multiple rows

              
          11.18   [M] Logminer support - RM for LOB operation errors - KDOLBE

             
          11.19   Array update ?

             
          11.20   SHK (mark as shrunk?)

             
          11.21   [M] Logminer support - KDOURP2

             
          11.22   [M] Logminer support - KDOCMP

             
          11.23   [M] Logminer support - KDODCU

             
          11.24   HCC update rowid map ?

             
          11.25   [M] Logminer support - KDOAIR

             
          11.28   "CMP2" Row Store Compress - partial compression ?

           

          12 Cluster

           

          13 Segment management

              
          13.1    ktsfm redo: -- allocate space ??

              
          13.5    KTSFRBFMT (block format) redo

             
          13.6    (block link modify) (? index )  (options: lock clear, lock set)

             
          13.7    KTSFRGRP (fgb/shdr modify freelist) redo: (options unlink block, move HWM)

              
          13.13   ktsbbu undo - undo operation on bitmap block

              
          13.14   ktsbbu undo - undo operation on bitmap block

              
          13.17   ktsphfredo - Format Pagetable Segment Header

              
          13.18   ktspffredo - Format Level 1 Bitmap Block

              
          13.19   ktspsfredo - Format Level 2 Bitmap Block

              
          13.21   ktspbfredo - Format Pagetable Datablock

              
          13.22   State change on level 1 bitmap block

              
          13.23   Undo on level 1 bitmap block

              
          13.24   State change on level 2 bitmap block

              
          13.25   Undo on level 2 bitmap block

              
          13.26   State change on level 3 bitmap block

              
          13.27   Undo on level 3 bitmap block

              
          13.28   Update LHWM and HHWM on segment header

              
          13.29   Undo on segment header

              
          13.31   Segment shrink redo for L1 bitmap block

              
          13.32   Segment shrink redo for segment header block

              
          13.36   Segment shrink redo for L2 bitmap block

              
          13.41   KTSL - Format LOB Extent Header Block (EHB)

              
          13.42   KTSL - Format LOB Persisten Undo Block (PUB)

              
          13.43   KTSL - Format LOB Hash Bucket Block (UFS)  -- uncommitted free space

              
          13.44   KTSL - Format LOB Free Space Block (FSB)   -- also CFS, committed free space

              
          13.45   KTSL - Format LOB Segment Header Block (SHB)

              
          13.49   KTSL - HBB redo record

              
          13.50   KTSL - LOB Hash Bucket Block (HBB) undo

              
          13.51   KTSL - FSB redo record (Free Space Block)

              
          13.52   KTSL - LOB Free Space Block (FSB) undo record:

              
          13.53   KTSL - PUA redo record: (Persistent Undo Amend ?)

              
          13.54   KTSL - LOB Persistent Undo Block (PUB) undo record

              
          13.55   KTSL - Segment Header (SHB) redo record

              
          13.56   KTSL - LOB Segment Header Block (SHB) undo record

           

           

          14 Extent management

              
          14.1    ktecush redo: clear extent control lock

              
          14.2    ktelk redo - lock extent (map)

              
          14.3    Extent de-allocate

              
          14.4    kteop redo - redo operation on extent map

              
          14.5    kteopu undo - undo operation on extent map

              
          14.6    kteopf redo - format an extent map block

              
          14.8    kteoputrn - undo operation for flush for truncate

              
          14.12   kteuUpdredo redo - Propagate Extent commit timetmep

           

          15 Tablespace

           

          16 Row cache

           

          17 Recovery management

              
          17.1    End backup mode marker

              
          17.3    Crash Recovery at scn:  0x0000.02429111

              
          17.28   STANDBY METADATA CACHE INVALIDATION (after commit on sys table update)

              
          17.51   RC Invalidation Marker

           

          18 Block image (hot backups)

              
          18.1    Block image

              
          18.3    Object / Range reuse

                   
          (Range reuse:  pdb = 3 tsn=7 base=0x04402380 nblks=128)

                   
          (Object reuse: tsn=2 objd=76515)

           

          19 Direct loader

             
          19.1    Direct Loader block redo entry (for logged direct path writes)

              
          19.2    Direct Loader invalidate block range redo entry (for nologging direct path writes)

              
          19.3    Direct block relogging - KCBLCRLB

              
          19.4    Invalidate range relogging - KCBLCRIR

           

          20 Compatibility segment (?)

              
          20.24   Media Recovery Marker - related to LOB load (KDLI)

           

          21 LOB segment

              
          21.1    kdlop (Long Feild) redo:  [sic]

                      
          (insert basicfile clob)

           

          22 Locally managed tablespace

              
          22.2    ktfbhredo - File Space Header Redo:

              
          22.3    ktfbhundo - File Space Header Undo:

              
          22.5    ktfbbredo - File BitMap Block Redo:

              
          22.16   File Property Map Block (FPM)

           

          23 Block writes

             
          23.1    MEDIA RECOVERY MARKER (Block written record 12c)

           
          23.2    Block read record (BRR) - written when db_lost_write_protect enabled

             
          23.3    MEDIA RECOVERY MARKER (Block written record 19c)

           

          24 DDL statements

             
          24.1    MEDIA RECOVERY MARKER - DDL

             
          24.2    Direct load block end mark

             
          24.4    Media recovery marker

             
          24.10   ??

             
          24.11   ??

           

          25 Queues

           

          26 LOB

              
          26.4    Invalidate LOB (?) (KDLI)

              
          26.6    Load LOB (KDLI)

           

          27 Block Change Tracking


          文章转载自山东Oracle用户组,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

          评论