|
TOP
|
|
Oracle中如何手工提交ClusterTable的事务(二)
ta header at 0x7fadb771ea64 =============== tsiz: 0x1f98 hsiz: 0x1a pbl: 0x7fadb771ea64 76543210 flag=-------K ntab=2 ---- > 大于2,说明这是一个cluster table nrow=2 frre=-1 fsbo=0x1a fseo=0x1f78 avsp=0x1f5e tosp=0x1f5e 0xe:pti[0] nrow=1 offs=0 0x12:pti[1] nrow=1 offs=1 0x16:pri[0] offs=0x1f82 0x18:pri[1] offs=0x1f78 block_row_dump: tab 0, row 0, @0x1f82 tl: 22 fb: K-H-FL-- lb: 0x0 cc: 1 curc: 1 comc: 1 pk: 0x018000ac.0 nk: 0x018000ac.0 col 0: [ 2] c1 02 tab 1, row 0, @0x1f78 tl: 10 fb: -CH-FL-- lb: 0x2 cc: 1 cki: 0 col 0: [ 5] 62 61 69 64 75 end_of_block_dump End dump data blocks tsn: 7 file#: 6 minblk 172 maxblk 172 |
大家可以看到,这跟普通的data block的dump内容是有所差别的,因为这里涉及到cluster table。
下面来模拟下手工提交cluster table的事务。
+++++模拟事务不提交 ?
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
SQL> alter system checkpoint; System altered. SQL> alter system flush buffer_cache; System altered. SQL> show user USER is "SYS" SQL> conn roger/roger Connected. SQL> delete from t_0610 where id=8; ++++++不提交 1 row deleted. SQL> alter system flush buffer_cache; System altered. SQL> select xidusn,xidslot,xidsqn,ubablk,ubafil,ubarec from v$transaction; XIDUSN XIDSLOT XIDSQN UBABLK UBAFIL UBAREC |
这里我们可以看到对于这个未提交的事务XID为:3.17.1212 前面我们已经知道 测试表中的数据分布在3个block中,这里我模拟的情况是删除第3条数据,且不提交,通过bbed来实现手工 提交这个未提交事务,注意:第3条数据是在第3个block中,即174 block。
+++++首先修改表的itl等信息 ?
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 |
BBED> set file 6 block 174 FILE# 6 BLOCK# 174 BBED> map File: /oracle/oradata/roger/roger01.dbf (6) Block: 174 Dba:0x018000ae ------------------------------------------------------------ KTB Data Block (Table/Cluster) struct kcbh, 20 bytes @0 struct ktbbh, 72 bytes @20 struct kdbh, 14 bytes @100 struct kdbt[2], 8 bytes @114 sb2 kdbr[2] @122 ub1 freespace[8030] @126 ub1 rowdata[32] @8156 ub4 tailchk @8188 BBED> p kdbr sb2 kdbr[0] @122 8066 sb2 kdbr[1] @124 8056 BBED> p ktbbh struct ktbbh, 72 bytes @20 ub1 ktbbhtyp @20 0x01 (KDDBTDATA) union ktbbhsid, 4 bytes @24 ub4 ktbbhsg1 @24 0x00012ecf ub4 ktbbhod1 @24 0x00012ecf struct ktbbhcsc, 8 bytes @28 ub4 kscnbas @28 0x00b94309 ub2 kscnwrp @32 0x0000 sb2 ktbbhict @36 2 ub1 ktbbhflg @38 0x32 (NONE) ub1 ktbbhfsl @39 0x00 ub4 ktbbhfnx @40 0x018000a8 struct ktbbhitl[0], 24 bytes @44 struct ktbitxid, 8 bytes @44 ub2 kxidusn @44 0x0009 ub2 kxidslt @46 0x0002 ub4 kxidsqn @48 0x0000044c struct ktbituba, 8 bytes @52 ub4 kubadba @52 0x00c000f9 ub2 kubaseq @56 0x014a ub1 kubarec @58 0x1d ub2 ktbitflg @60 0x8000 (KTBFCOM) union _ktbitun, 2 bytes @62 sb2 _ktbitfsc @62 0 ub2 _ktbitwrp @62 0x0000 u |
|