bbed简单替换block测试
有朋友在我论坛中提问copy一个块,如何在前台显示其中数据,前段时间比较忙,没有及时答复该问题,今天通过试验方式进行了测试说明,本试验简单,仅是同一个数据文件中的同一个对象中的两个block进行了替换 创建测试表 SQL conn chf/xifenfeiConnected.SQL create
有朋友在我论坛中提问copy一个块,如何在前台显示其中数据,前段时间比较忙,没有及时答复该问题,今天通过试验方式进行了测试说明,本试验简单,仅是同一个数据文件中的同一个对象中的两个block进行了替换
创建测试表
SQL> conn chf/xifenfei Connected. SQL> create table t_xifenfei as select * from dba_objects; Table created. SQL> select EXTENT_ID,FILE_ID,BLOCK_ID,BLOCKS from dba_extents where segment_name='T_XIFENFEI' AND OWNER='CHF'; EXTENT_ID FILE_ID BLOCK_ID BLOCKS ---------- ---------- ---------- ---------- 0 4 176 8 1 4 184 8 2 4 192 8 3 4 200 8 4 4 208 8 5 4 216 8 6 4 224 8 7 4 232 8 8 4 240 8 9 4 248 8 10 4 256 8 EXTENT_ID FILE_ID BLOCK_ID BLOCKS ---------- ---------- ---------- ---------- 11 4 264 8 12 4 272 8 13 4 280 8 14 4 288 8 15 4 296 8 16 4 384 128 17 4 512 128 18 4 640 128 19 4 768 128 20 4 896 128 21 4 1024 128 EXTENT_ID FILE_ID BLOCK_ID BLOCKS ---------- ---------- ---------- ---------- 22 4 1152 128 23 4 1280 128 24 4 1408 128 25 rows selected. SQL> select * from (select distinct dbms_rowid.rowid_relative_fno(rowid), 2 dbms_rowid.rowid_block_number(rowid) from t_xifenfei ORDER BY 2 )where rownum <p><strong>查询file 4 block 180 数据情况</strong></p> <pre class="brush:php;toolbar:false"> SQL> select object_id from t_xifenfei where dbms_rowid.rowid_relative_fno(rowid)=4 2 and dbms_rowid.rowid_block_number(rowid)=180; OBJECT_ID ---------- 81 82 83 84 85 86 87 88 89 90 91 OBJECT_ID ---------- 92 93 94 95 96 97 98 99 100 101 102 OBJECT_ID ---------- 103 104 105 106 107 108 109 110 111 112 113 OBJECT_ID ---------- 114 115 116 117 118 119 120 121 122 123 124 OBJECT_ID ---------- 125 126 127 129 128 130 131 132 133 134 135 OBJECT_ID ---------- 137 136 138 139 140 141 142 143 144 145 146 OBJECT_ID ---------- 147 148 149 150 151 153 152 154 155 156 76 rows selected.
查询file 4 block 181 数据情况
SQL> select object_id from t_xifenfei where dbms_rowid.rowid_relative_fno(rowid)=4 2 and dbms_rowid.rowid_block_number(rowid)=181; OBJECT_ID ---------- 157 158 159 160 161 162 163 164 165 166 167 OBJECT_ID ---------- 168 169 170 171 172 173 174 175 176 177 178 OBJECT_ID ---------- 179 180 181 182 183 184 185 186 187 188 189 OBJECT_ID ---------- 190 191 192 193 194 195 196 197 198 199 200 OBJECT_ID ---------- 201 202 203 204 205 206 208 207 209 210 211 OBJECT_ID ---------- 212 213 214 215 216 217 218 219 220 221 222 OBJECT_ID ---------- 223 224 225 226 227 228 229 230 231 75 rows selected.
定位file 4 文件名
SQL> select name from v$datafile where file#=4; NAME -------------------------------------------------------------------------------- /u01/app/oracle/oradata/ORCL/users01.dbf
bbed 替换file 4 block 180到file 4 block 181
[oracle@oel6 ~]$ bbed filename='/u01/app/oracle/oradata/ORCL/users01.dbf' mode=edit blocksize=8192 Password: BBED: Release 2.0.0.0.0 - Limited Production on Wed Aug 6 21:17:11 2014 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. ************* !!! For Oracle Internal Use only !!! *************** BBED> show all FILE# 0 BLOCK# 1 OFFSET 0 DBA 0x00000000 (0 0,1) FILENAME /u01/app/oracle/oradata/ORCL/users01.dbf BIFILE bifile.bbd LISTFILE BLOCKSIZE 8192 MODE Edit EDIT Unrecoverable IBASE Dec OBASE Dec WIDTH 80 COUNT 512 LOGFILE log.bbd SPOOL No BBED> map File: /u01/app/oracle/oradata/ORCL/users01.dbf (0) Block: 180 Dba:0x00000000 ------------------------------------------------------------ KTB Data Block (Table/Cluster) struct kcbh, 20 bytes @0 struct ktbbh, 96 bytes @20 struct kdbh, 14 bytes @124 struct kdbt[1], 4 bytes @138 sb2 kdbr[76] @142 ub1 freespace[856] @294 ub1 rowdata[7038] @1150 ub4 tailchk @8188 BBED> p kcbh struct kcbh, 20 bytes @0 ub1 type_kcbh @0 0x06 ub1 frmt_kcbh @1 0xa2 ub1 spare1_kcbh @2 0x00 ub1 spare2_kcbh @3 0x00 ub4 rdba_kcbh @4 0x010000b4 ub4 bas_kcbh @8 0x000b258a ub2 wrp_kcbh @12 0x0000 ub1 seq_kcbh @14 0x02 ub1 flg_kcbh @15 0x04 (KCBHFCKV) ub2 chkval_kcbh @16 0x0eb6 ub2 spare3_kcbh @18 0x0000 BBED> p kcbh block 181 struct kcbh, 20 bytes @0 ub1 type_kcbh @0 0x06 ub1 frmt_kcbh @1 0xa2 ub1 spare1_kcbh @2 0x00 ub1 spare2_kcbh @3 0x00 ub4 rdba_kcbh @4 0x010000b5 ub4 bas_kcbh @8 0x000b258a ub2 wrp_kcbh @12 0x0000 ub1 seq_kcbh @14 0x02 ub1 flg_kcbh @15 0x04 (KCBHFCKV) ub2 chkval_kcbh @16 0xa1c5 ub2 spare3_kcbh @18 0x0000 BBED> copy block 180 to block 181 File: /u01/app/oracle/oradata/ORCL/users01.dbf (0) Block: 181 Offsets: 0 to 511 Dba:0x00000000 ------------------------------------------------------------------------ 06a20000 b4000001 8a250b00 00000204 b60e0000 01000000 252d0100 84250b00 00000000 03003200 b0000001 ffff0000 00000000 00000000 00000000 00800000 84250b00 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00014c00 ffffaa00 02045803 58030000 4c00221f c21e661e 0e1eb01d 521df81c 9e1c421c ea1b901b 361be11a 8c1a361a da198019 2419c818 73181918 b9176017 0717ae16 5416f815 a2154915 f0149614 3914dc13 7f131f13 c8126e12 1412ba11 61110511 a9104f10 f20f900f 370fdc0e 710e070e a60d430d df0c850c 2a0ccf0b 640bfa0a 9d0a400a e6098509 2e09d408 79081e08 c3076607 0907a206 3806e005 75050b05 b0045a04 02040000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 BBED> p kcbh block 181 struct kcbh, 20 bytes @0 ub1 type_kcbh @0 0x06 ub1 frmt_kcbh @1 0xa2 ub1 spare1_kcbh @2 0x00 ub1 spare2_kcbh @3 0x00 ub4 rdba_kcbh @4 0x010000b4 ub4 bas_kcbh @8 0x000b258a ub2 wrp_kcbh @12 0x0000 ub1 seq_kcbh @14 0x02 ub1 flg_kcbh @15 0x04 (KCBHFCKV) ub2 chkval_kcbh @16 0x0eb6 ub2 spare3_kcbh @18 0x0000 BBED> p rdba_kcbh ub4 rdba_kcbh @4 0x010000b4 BBED> d File: /u01/app/oracle/oradata/ORCL/users01.dbf (0) Block: 181 Offsets: 4 to 515 Dba:0x00000000 ------------------------------------------------------------------------ b4000001 8a250b00 00000204 b60e0000 01000000 252d0100 84250b00 00000000 03003200 b0000001 ffff0000 00000000 00000000 00000000 00800000 84250b00 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00014c00 ffffaa00 02045803 58030000 4c00221f c21e661e 0e1eb01d 521df81c 9e1c421c ea1b901b 361be11a 8c1a361a da198019 2419c818 73181918 b9176017 0717ae16 5416f815 a2154915 f0149614 3914dc13 7f131f13 c8126e12 1412ba11 61110511 a9104f10 f20f900f 370fdc0e 710e070e a60d430d df0c850c 2a0ccf0b 640bfa0a 9d0a400a e6098509 2e09d408 79081e08 c3076607 0907a206 3806e005 75050b05 b0045a04 02040000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 BBED> set count 32 COUNT 32 BBED> d File: /u01/app/oracle/oradata/ORCL/users01.dbf (0) Block: 181 Offsets: 4 to 35 Dba:0x00000000 ------------------------------------------------------------------------ b4000001 8a250b00 00000204 b60e0000 01000000 252d0100 84250b00 00000000 BBED> m /x b5 File: /u01/app/oracle/oradata/ORCL/users01.dbf (0) Block: 181 Offsets: 4 to 35 Dba:0x00000000 ------------------------------------------------------------------------ b5000001 8a250b00 00000204 b60e0000 01000000 252d0100 84250b00 00000000 BBED> sum apply Check value for File 0, Block 181: current = 0x0eb7, required = 0x0eb7 BBED> p kcbh block 181 struct kcbh, 20 bytes @0 ub1 type_kcbh @0 0x06 ub1 frmt_kcbh @1 0xa2 ub1 spare1_kcbh @2 0x00 ub1 spare2_kcbh @3 0x00 ub4 rdba_kcbh @4 0x010000b5 ub4 bas_kcbh @8 0x000b258a ub2 wrp_kcbh @12 0x0000 ub1 seq_kcbh @14 0x02 ub1 flg_kcbh @15 0x04 (KCBHFCKV) ub2 chkval_kcbh @16 0x0eb7 ub2 spare3_kcbh @18 0x0000
验证替换后的file 4 block 181
SQL> select object_id from t_xifenfei where dbms_rowid.rowid_relative_fno(rowid)=4 2 and dbms_rowid.rowid_block_number(rowid)=181; OBJECT_ID ---------- 81 82 83 84 85 86 87 88 89 90 91 OBJECT_ID ---------- 92 93 94 95 96 97 98 99 100 101 102 OBJECT_ID ---------- 103 104 105 106 107 108 109 110 111 112 113 OBJECT_ID ---------- 114 115 116 117 118 119 120 121 122 123 124 OBJECT_ID ---------- 125 126 127 129 128 130 131 132 133 134 135 OBJECT_ID ---------- 137 136 138 139 140 141 142 143 144 145 146 OBJECT_ID ---------- 147 148 149 150 151 153 152 154 155 156 76 rows selected.
通过替换block 180的block到181,查询block 181和180数据相同,证明替换block成功
- dd操作数据文件
- 在UltraEdit中定位数据文件内容
- 系统中数据文件第一个数据块和oracle 中第一个数据块关系
- 使用bbed修复损坏datafile header
- bbed模拟提交事务一之修改itl
- 记录因磁盘头被重写,抢救redo恢复经历
- bbed处理ORA-01200故障
- bbed模拟提交事务二之屏蔽smon回滚事务
原文地址:bbed简单替换block测试, 感谢原作者分享。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

In addition to its excellent performance and functions, Xiaomi Mi 14 also supports NFC, which allows the mobile phone to communicate wirelessly with smart access cards. Through settings, we can bind the NFC function of Xiaomi 14 to the access card to achieve convenient access card management. Next, the editor will introduce how to set up the NFC function of Xiaomi 14 for access control cards. How to set up access control card NFC on Xiaomi 14? 1. Open the wallet, click on the door card, click on the physical door card to add, and put the Xiaomi smart lock close to the NFC area. 2. Select to continue reading the card content in the pop-up window, put the Xiaomi smart lock close to the NFC area again, enter the card name, select the card, and click Finish. 3. Click Write and place the Xiaomi smart lock close to the NFC area to complete the reading. You just need to follow the instructions above

What do you think of furmark? 1. Set the "Run Mode" and "Display Mode" in the main interface, and also adjust the "Test Mode" and click the "Start" button. 2. After waiting for a while, you will see the test results, including various parameters of the graphics card. How is furmark qualified? 1. Use a furmark baking machine and check the results for about half an hour. It basically hovers around 85 degrees, with a peak value of 87 degrees and room temperature of 19 degrees. Large chassis, 5 chassis fan ports, two on the front, two on the top, and one on the rear, but only one fan is installed. All accessories are not overclocked. 2. Under normal circumstances, the normal temperature of the graphics card should be between "30-85℃". 3. Even in summer when the ambient temperature is too high, the normal temperature is "50-85℃

Moondrop has released the Block true wireless earbuds for audio enthusiasts that sit comfortably in the outer ear. Unlike earbuds jammed into ear canals, the Block does not cause a plugged ear feeling or collect ear wax. The 13 mm driver is enclosed

The "Inaction Test" of the new fantasy fairy MMORPG "Zhu Xian 2" will be launched on April 23. What kind of new fairy adventure story will happen in Zhu Xian Continent thousands of years after the original work? The Six Realm Immortal World, a full-time immortal academy, a free immortal life, and all kinds of fun in the immortal world are waiting for the immortal friends to explore in person! The "Wuwei Test" pre-download is now open. Fairy friends can go to the official website to download. You cannot log in to the game server before the server is launched. The activation code can be used after the pre-download and installation is completed. "Zhu Xian 2" "Inaction Test" opening hours: April 23 10:00 - May 6 23:59 The new fairy adventure chapter of the orthodox sequel to Zhu Xian "Zhu Xian 2" is based on the "Zhu Xian" novel as a blueprint. Based on the world view of the original work, the game background is set

Functional testing verifies function functionality through black-box and white-box testing, while code coverage measures the portion of code covered by test cases. Different languages (such as Python and Java) have different testing frameworks, coverage tools and features. Practical cases show how to use Python's Unittest and Coverage and Java's JUnit and JaCoCo for function testing and coverage evaluation.

CheatEngine is a game editor that can edit and modify the game's memory. However, its default language is non-Chinese, which is inconvenient for many friends. So how to set Chinese in CheatEngine? Today, the editor will give you a detailed introduction to how to set up Chinese in CheatEngine. I hope it can help you. Setting method one: 1. Double-click to open the software and click "edit" in the upper left corner. 2. Then click “settings” in the option list below. 3. In the opened window interface, click "languages" in the left column

Detailed explanation of how to replace newlines in PHP In PHP development, sometimes we need to replace or process newlines in strings. Line breaks may be expressed differently on different platforms, so they need to be processed uniformly to ensure that strings display consistently in different environments. This article will introduce in detail how to replace newlines in PHP, including common newline characters and specific code examples. 1. Common newline characters In different operating systems, the representation of newline characters may be slightly different. The main newline characters include: Windo

Title: PHP replacement skills revealed! PHP, as a popular server-side scripting language, is often used to handle data replacement and manipulation. In daily development, we often encounter situations where strings need to be replaced. This article will reveal some commonly used replacement techniques in PHP and give specific code examples to help readers better master these techniques. 1. Use the str_replace() function The str_replace() function is one of the most commonly used string replacement functions in PHP. it can
