Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Bbed modifies ITL value to manually commit transactions

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Version of the database is 11.2.0.4

Welcome to join the ORACLE Super Group: 17115662 solve all kinds of ORACLE problems free of charge. BLOG will migrate to http://www.htz.pw in the future.

1, database version

Www.htz.pw > select * from v$version

BANNER

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production

PL/SQL Release 11.2.0.3.0-Production

CORE 11.2.0.3.0 Production

TNS for Linux: Version 11.2.0.3.0-Production

NLSRTL Version 11.2.0.3.0-Production

2, create a test table

Www.htz.pw > create table scott.htz tablespace users as select * from dba_objects where rownum select rowid from scott.htz

ROWID

-

AAASkGAAEAAABkzAAA

Www.htz.pw > @ rowid_to_info.sql

Enter value for rowid: AAASkGAAEAAABkzAAA

ROWID_TYPE: 1

OBJECT_NUMBER: 76038

RELATIVE_FNO: 4

BLOCK_NUMBER: 6451

ROW_NUMBER: 0

PL/SQL procedure successfully completed.

3. Simulation experiment

3.1 Update row records

Www.htz.pw > conn scott/oracle

Connected.

Www.htz.pw > select owner from htz

OWNER

-

SYS

Www.htz.pw > update htz set owner='HUANGTINGZHONG'

1 row updated.

3.2 brushing blocks from BUFFER_CACHE into data files

Here opens another window to execute

Www.htz.pw > alter system flush buffer_cache

System altered.

Www.htz.pw > select owner from scott.htz

OWNER

-

SYS

3.3 blocks in DUMP data files

The purpose of the dump block is to see if the value has changed, as well as the identifier information for the row

Www.htz.pw > select file_name from dba_data_files

FILE_NAME

/ oracle/app/oracle/oradata/orcl1123/users01.dbf

/ oracle/app/oracle/oradata/orcl1123/undotbs1.dbf

/ oracle/app/oracle/oradata/orcl1123/sysaux01.dbf

/ oracle/app/oracle/oradata/orcl1123/system01.dbf

/ oracle/app/oracle/oradata/orcl1123/undotbs2.dbf

/ oracle/app/oracle/oradata/orcl1123/htz01.dbf

/ oracle/app/oracle/oradata/orcl1123/tbs_data.dbf

/ oracle/app/oracle/oradata/orcl1123/undotbs3.dbf

Www.htz.pw > @ dump_block.sql

Enter value for datafile: 4

Enter value for block_id: 6451

Old 1: alter system dump datafile & datafile block & block_id

New 1: alter system dump datafile 4 block 6451

System altered.

You can see the following information in the trace file

Block header dump: 0x01001933

Object id on Block? Y

Seg/obj: 0x12906 csc: 0x00.24e77c itc: 3 flg: e typ: 1-DATA

Brn: 0 bdba: 0x1001930 ver: 0x01 opc: 0

Inc: 0 exflg: 0

Itl Xid Uba Flag Lck Scn/Fsc

0x01 0xffff.000.00000000 0x00000000.0000.00 Cmurmuri-0 scn 0x0000.0024e747

0x02 0x000d.003.000000d7 0x0140026c.0202.04-1 fsc 0x0000.00000000

0x03 0x0000.000.00000000 0x00000000.0000.00-0 fsc 0x0000.00000000

Bdba: 0x01001933

Data_block_dump,data header at 0x2a97c20a7c

=

Tsiz: 0x1f80

Hsiz: 0x14

Pbl: 0x2a97c20a7c

76543210

Flag=-

Ntab=1

Nrow=1

Frre=-1

Fsbo=0x14

Fseo=0x1edb

Avsp=0x1f14

Tosp=0x1f14

0xe:pti [0] nrow=1 offs=0

0x12:pri [0] offs=0x1edb

Block_row_dump:

Tab 0, row 0, @ 0x1edb

Tl: 88 fb:-- Hmurf FLMI-lb: 0x2 cc: 14

Col 0: [14] 48 55 41 4e 47 54 49 4e 47 5a 48 4f 4e 47

Col 1: [5] 49 43 4f 4c 24

Col 2: * NULL*

Col 3: [2] c1 15

Col 4: [2] c1 03

Col 5: [5] 54 41 42 4c 45

Col 6: [7] 78 6f 09 11 0a 2f 0e

Col 7: [7] 78 6f 09 11 0a 3b 01

Col 8: [19] 32 30 31 31 2d 30 39 2d 31 37 3a 30 39 3a 34 36 3a 31 33

Col 9: [5] 56 41 4c 49 44

Col 10: [1] 4e

Col 11: [1] 4e

Col 12: [1] 4e

Col 13: [2] c1 02

4 the related content of the modification block of the parallelism bbed

In fact, bbed only needs to change two addresses, one is to change the flg in itl to submit, and the other is to clear the value of itl in the line.

BBED > p ktbbh

Struct ktbbh, 96 bytes @ 20

Ub1 ktbbhtyp @ 20 0x01 (KDDBTDATA)

Union ktbbhsid, 4 bytes @ 24

Ub4 ktbbhsg1 @ 24 0x00012906

Ub4 ktbbhod1 @ 24 0x00012906

Struct ktbbhcsc, 8 bytes @ 28

Ub4 kscnbas @ 28 0x0024e77c

Ub2 kscnwrp @ 32 0x0000

Sb2 ktbbhict @ 36 3

Ub1 ktbbhflg @ 38 0x32 (NONE)

Ub1 ktbbhfsl @ 39 0x00

Ub4 ktbbhfnx @ 40 0x01001930

Struct ktbbhitl [0], 24 bytes @ 44

Struct ktbitxid, 8 bytes @ 44

Ub2 kxidusn @ 44 0xffff

Ub2 kxidslt @ 46 0x0000

Ub4 kxidsqn @ 48 0x00000000

Struct ktbituba, 8 bytes @ 52

Ub4 kubadba @ 52 0x00000000

Ub2 kubaseq @ 56 0x0000

Ub1 kubarec @ 58 0x00

Ub2 ktbitflg @ 60 0x8000 (KTBFCOM)

Union _ ktbitun, 2 bytes @ 62

Sb2 _ ktbitfsc @ 62 0

Ub2 _ ktbitwrp @ 62 0x0000

Ub4 ktbitbas @ 64 0x0024e747

Struct ktbbhitl [1], 24 bytes @ 68

Struct ktbitxid, 8 bytes @ 68

Ub2 kxidusn @ 68 0x000d

Ub2 kxidslt @ 70 0x0003

Ub4 kxidsqn @ 72 0x000000d7

Struct ktbituba, 8 bytes @ 76

Ub4 kubadba @ 76 0x0140026c

Ub2 kubaseq @ 80 0x0202

Ub1 kubarec @ 82 0x04

Ub2 ktbitflg @ 84 0x0001 (NONE)

Union _ ktbitun, 2 bytes @ 86

Sb2 _ ktbitfsc @ 860

Ub2 _ ktbitwrp @ 86 0x0000

Ub4 ktbitbas @ 88 0x00000000

BBED > set mode edit

MODE Edit

BBED > set count 16

COUNT 16

One thing to note here is that the test platform is X86. If it is a minicomputer, it is a little different. There is no need for high-low conversion.

BBED > modify / x 0080 offset 84

Warning: contents of previous BIFILE will be lost. Proceed? (Ybig N) y

File: / oracle/app/oracle/oradata/orcl1123/users01.dbf (0)

Block: 6451 Offsets: 84 to 99 Dba:0x00000000

00800000 00000000 00000000 00000000

BBED > p ktbbh.ktbbhitl [1]

Struct ktbbhitl [1], 24 bytes @ 68

Struct ktbitxid, 8 bytes @ 68

Ub2 kxidusn @ 68 0x000d

Ub2 kxidslt @ 70 0x0003

Ub4 kxidsqn @ 72 0x000000d7

Struct ktbituba, 8 bytes @ 76

Ub4 kubadba @ 76 0x0140026c

Ub2 kubaseq @ 80 0x0202

Ub1 kubarec @ 82 0x04

Ub2 ktbitflg @ 84 0x8000 (KTBFCOM)

Union _ ktbitun, 2 bytes @ 86

Sb2 _ ktbitfsc @ 860

Ub2 _ ktbitwrp @ 86 0x0000

Ub4 ktbitbas @ 88 0x00000000

You can see here that there is a problem with the ITL value of the behavior reported below.

BBED > verify

DBVERIFY-Verification starting

FILE = / oracle/app/oracle/oradata/orcl1123/users01.dbf

BLOCK = 6451

Block Checking: DBA = 16783667, Block Type = KTB-managed data block

Data header at 0x2a98b8727c

Kdbchk: row locked by non-existent transaction

Table=0 slot=0

Lockid=2 ktbbhitc=3

Block 6451 failed with check code 6101

DBVERIFY-Verification complete

Total Blocks Examined: 1

Total Blocks Processed (Data): 1

Total Blocks Failing (Data): 1

Total Blocks Processed (Index): 0

Total Blocks Failing (Index): 0

Total Blocks Empty: 0

Total Blocks Marked Corrupt: 0

Total Blocks Influx: 0

Message 531 not found; product=RDBMS; facility=BBED

BBED > p * kdbr [0]

Rowdata [0]

-

Ub1 rowdata [0] @ 8023 0x2c

BBED > set offset 8023

OFFSET 8023

BBED > dump

File: / oracle/app/oracle/oradata/orcl1123/users01.dbf (0)

Block: 6451 Offsets: 8023 to 8038 Dba:0x00000000

2c020e0e 4855414e 4754494e 475a484f

BBED > modify / x 2c00

File: / oracle/app/oracle/oradata/orcl1123/users01.dbf (0)

Block: 6451 Offsets: 8023 to 8038 Dba:0x00000000

2c000e0e 4855414e 4754494e 475a484f

BBED > sum apply

Check value for File 0, Block 6451:

Current = 0xbebc, required = 0xbebc

There is no mistake in the following report.

BBED > verify

DBVERIFY-Verification starting

FILE = / oracle/app/oracle/oradata/orcl1123/users01.dbf

BLOCK = 6451

DBVERIFY-Verification complete

Total Blocks Examined: 1

Total Blocks Processed (Data): 1

Total Blocks Failing (Data): 0

Total Blocks Processed (Index): 0

Total Blocks Failing (Index): 0

Total Blocks Empty: 0

Total Blocks Marked Corrupt: 0

Total Blocks Influx: 0

Message 531 not found; product=RDBMS; facility=BBED

6. View the data changed by bbed

Open another window to view the data in the table

Www.htz.pw > select owner from scott.htz

OWNER

-

HUANGTINGZHONG

You can see here that the data has been updated.

However, it should be noted that when you execute the rollback statement in the update window, you can still fall back.

If you execute the rollback command in the original window, the record will still be rolled back.

Www.htz.pw > rollback

Rollback complete.

Www.htz.pw > select owner from scott.htz

OWNER

-

SYS

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report