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

How does Oracle BBED modify the data in a block

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the relevant knowledge of "how Oracle BBED modifies the data in the data block". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

BBED modifies data:

Create test data:

SQL > create table dbhang (id number,name varchar2 (20))

Table created.

SQL > insert into dbhang values (1Magnesia baoyuhang')

1 row created.

SQL > commit

Commit complete.

SQL > select * from dbhang

ID NAME

1 baoyuhang

View file number, block number, line number:

Select

Rowid

Dbms_rowid.rowid_relative_fno (rowid) rel_fno

Dbms_rowid.rowid_block_number (rowid) blockno

Dbms_rowid.rowid_row_number (rowid) rowno

From dbhang

ROWID REL_FNO BLOCKNO ROWNO

AAAVoxAABAAAW8BAAA 1 93953 0

Query data file:

SQL > select file# | |''| | name | |''| | bytes from v$datafile

FILE# | |''| | NAME | |''| | BYTES

1 / oracle/app/oradata/prod/system01.dbf786432000

2 / oracle/app/oradata/prod/sysaux01.dbf545259520

3 / oracle/app/oradata/prod/undotbs01.dbf94371840

4 / oracle/app/oradata/prod/users01.dbf5242880

5 / oracle/app/oradata/prod/example01.dbf328335360

6 / oracle/app/oradata/prod/dbhang01.dbf52428800

7 / oracle/app/oradata/prod/dbhang02.dbf52428800

Save the information of the above query in the text:

[oracle @ server1 ~] $cat datafile.txt

1 / oracle/app/oradata/prod/system01.dbf 786432000

2 / oracle/app/oradata/prod/sysaux01.dbf 545259520

3 / oracle/app/oradata/prod/undotbs01.dbf 94371840

4 / oracle/app/oradata/prod/users01.dbf 5242880

5 / oracle/app/oradata/prod/example01.dbf 328335360

6 / oracle/app/oradata/prod/dbhang01.dbf 52428800

7 / oracle/app/oradata/prod/dbhang02.dbf 52428800

Shut down the database:

SQL > shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

Create a BBED parameter file:

[oracle @ server1 ~] $cat bbed.par

Blocksize=8192

Listfile=/home/oracle/datafile.txt / / specify a text file

Mode=edit / / edit mode

Now change the data baoyuhang to bbbyuhang

Connect to BBED for data location:

[oracle @ server1 ~] $bbed parfile=/home/oracle/bbed.par

Password:

BBED: Release 2.0.0.0.0-Limited Production on Thu Jul 30 05:59:45 2020

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

*! For Oracle Internal Use only!! *

BBED >

Specify block 93953 of document 1:

BBED > set dba 1re93953 offset 0

DBA 0x00416f01 (4288257 1pm 93953)

OFFSET 0

Positioning data: (determine the offset of the data in block)

BBED > find / c baoyuhang

File: / oracle/app/oradata/prod/system01.dbf (1)

Block: 93953 Offsets: 8179 to 8191 Dba:0x00416f01

62616f79 7568616e 6704066c 38

Dump take a look at offset 8179 information:

BBED > dump / v dba 1 93953 offset 8179 count 128

File: / oracle/app/oradata/prod/system01.dbf (1)

Block: 93953 Offsets: 8179 to 8191 Dba:0x00416f01

62616f79 7568616e 6704066c 38 l baoyuhang..l8

Offsets: 8179 to 8191 represents the address of this line.

It also means that baoyuhang belongs to 8179-8191

B:8179

A:8180

O:8181

Modify block to replace bao with bbb:

BBED > modify / c bbb dba 1 93953 offset 8179

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

File: / oracle/app/oradata/prod/system01.dbf (1)

Block: 93953 Offsets: 8179 to 8191 Dba:0x00416f01

62626279 7568616e 670106ba 3c

View the modified data again:

BBED > dump / v dba 1 93953 offset 8179 count 128

File: / oracle/app/oradata/prod/system01.dbf (1)

Block: 93953 Offsets: 8179 to 8191 Dba:0x00416f01

62626279 7568616e 6704066c 38 l bbbyuhang..l8

Apply changes:

BBED > sum dba 1BI 93953 apply

Check value for File 1, Block 93953:

Current = 0x29a2, required = 0x29a2

Go back to sqlplus to query the modified data

SQL > startup

ORACLE instance started.

Total System Global Area 830930944 bytes

Fixed Size 2257800 bytes

Variable Size 541068408 bytes

Database Buffers 281018368 bytes

Redo Buffers 6586368 bytes

Database mounted.

Database opened.

SQL > select * from dbhang

ID NAME

1 bbbyuhang

The revision is complete.

Installation of BBED: http://blog.itpub.net/69975956/viewspace-2707944/

This is the end of the content of "how Oracle BBED modifies the data in the data block". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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: 296

*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