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<5 ; DBMS_ROWID.ROWID_RELATIVE_FNO(ROWID) DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID) ------------------------------------ ------------------------------------ 4 179 4 180 4 181 4 182
查询file 4 block 180 数据情况
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测试, 感谢原作者分享。

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

小米14除了具备出色的性能和功能外,还支持NFC,使得手机可以与智能门禁卡进行无线通信。通过设置,我们可以将小米14的NFC功能与门禁卡绑定,从而实现便捷的门禁卡管理。接下来,小编将介绍如何设置小米14的NFC功能用于门禁卡。小米14怎么设置门禁卡nfc?1、打开钱包,点击门卡,点击实体门卡添加,将小米智能锁贴近NFC区域。2、在弹窗中选择继续读取卡片内容,再次将小米智能锁贴近NFC区域,输入卡名称、选择卡片,点击完成。3、点击写入,将小米智能锁贴近NFC区域即可读取完成。大家只需要按照上面的内

furmark怎么看?1、在主界面中设置“运行模式”和“显示模式”,还能调整“测试模式”,点击“开始”按钮。2、等待片刻后,就会看到测试结果,包含了显卡各种参数。furmark怎么算合格?1、用furmark烤机,半个小时左右看一下结果,基本上在85度左右徘徊,峰值87度,室温19度。大号机箱,5个机箱风扇口,前置两个,上置两个,后置一个,不过只装了一个风扇。所有配件都没有超频。2、一般情况下,显卡的正常温度应该在“30-85℃”之间。3、就算是大夏天周围环境温度过高,正常温度也是“50-85℃

Moondrop 为音频爱好者发布了 Block 真无线耳机,可舒适地佩戴在外耳中。与塞入耳道的耳塞不同,Block 不会造成耳朵堵塞的感觉或积聚耳垢。随附 13 毫米驱动器

新派幻想仙侠MMORPG《诛仙2》“无为测试”即将于4月23日开启,在原著千年后的诛仙大陆,会发生怎样的全新仙侠冒险故事?六境仙侠大世界,全日制修仙学府,自由自在的修仙生活,仙界中的万般妙趣都在等待着仙友们亲自前往探索!“无为测试”预下载现已开启,仙友们可前往官网下载,开服前无法登录游戏服务器,激活码可在预下载安装完成后使用。《诛仙2》“无为测试”开放时间:4月23日10:00——5月6日23:59诛仙正统续作全新仙侠冒险篇章《诛仙2》以《诛仙》小说为蓝图,在继承原著世界观的基础上,将游戏背景设

CheatEngine是一款游戏编辑器,能够对游戏的内存进行编辑修改。但是它的默认语言是非中文的,对于很多小伙伴来说比较不方便,那么CheatEngine怎么设置中文呢?今天小编就给大家详细介绍一下CheatEngine设置中文的方法,希望可以帮助到你。 设置方法一 1、双击打开软件,点击左上角的“edit”。 2、接着点击下方选项列表中的“settings”。 3、在打开的窗口界面中,点击左侧栏中的“languages”

函数测试通过黑盒和白盒测试验证函数功能,而代码覆盖率衡量了测试用例覆盖的代码部分。不同语言(如Python和Java)的测试框架、覆盖率工具和特性不同。实战案例展示了如何使用Python的Unittest和Coverage以及Java的JUnit和JaCoCo进行函数测试和覆盖率评估。

PHP替换换行的方法详解在PHP开发中,有时候我们需要对字符串中的换行符进行替换或处理。换行符在不同平台下可能会有不同的表示方式,因此需要对其进行统一处理,以确保字符串在不同环境下的显示效果一致。本文将详细介绍PHP中替换换行的方法,包括常见的换行符和具体的代码示例。一、常见的换行符在不同操作系统中,换行符的表示方式可能略有不同。主要的换行符包括:Windo

题目:PHP替换技巧大揭秘!PHP作为一种流行的服务器端脚本语言,经常被用来处理数据的替换和操作。在日常开发中,我们经常会遇到需要对字符串进行替换的情况。本文将为大家揭秘PHP中一些常用的替换技巧,并给出具体的代码示例,帮助读者更好地掌握这些技术。1.使用str_replace()函数str_replace()函数是PHP中最常用的字符串替换函数之一。它可
