有朋友在我论坛中提问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测试, 感谢原作者分享。

硬盘序列号是硬盘的一个重要标识,通常用于唯一标识硬盘以及进行硬件识别。在某些情况下,我们可能需要查询硬盘序列号,比如在安装操作系统、查找正确设备驱动程序或进行硬盘维修等情况下。本文将介绍一些简单的方法,帮助大家查询硬盘序列号。方法一:使用Windows命令提示符打开命令提示符。在Windows系统中,按下Win+R键,输入"cmd"并按下回车键即可打开命

如何通过PHP编写一个简单的在线预约系统随着互联网的普及和用户对便利性的追求,在线预约系统越来越受到欢迎。无论是餐厅、医院、美容院还是其他服务行业,都可以通过一个简单的在线预约系统来提高效率并为用户提供更好的服务体验。本文将介绍如何使用PHP编写一个简单的在线预约系统,并提供具体的代码示例。创建数据库和表格首先,我们需要创建一个数据库来存储预约信息。在MyS

如何使用Java编写一个简单的学生成绩报表生成器?学生成绩报表生成器是一个可以帮助老师或教育者快速生成学生成绩报告的工具。本文将介绍如何使用Java编写一个简单的学生成绩报表生成器。首先,我们需要定义学生对象和学生成绩对象。学生对象包含学生的姓名、学号等基本信息,而学生成绩对象则包含学生的科目成绩和平均成绩等信息。以下是一个简单的学生对象的定义:public

快速入门:使用Go语言函数实现简单的图书管理系统引言:随着计算机科学领域的不断发展,软件应用的需求也越来越多样化。图书管理系统作为一种常见的管理工具,也成为很多图书馆、学校和企业必备的系统之一。在本文中,我们将使用Go语言函数来实现一个简单的图书管理系统。通过这个例子,读者可以学习到Go语言中函数的基本用法以及如何构建一个实用的程序。一、设计思路:我们首先来

如何通过C++编写一个简单的音乐推荐系统?引言:音乐推荐系统是现代信息技术的一个研究热点,它可以根据用户的音乐偏好和行为习惯,向用户推荐符合其口味的歌曲。本文将介绍如何使用C++编写一个简单的音乐推荐系统。一、收集用户数据首先,我们需要收集用户的音乐偏好数据。可以通过在线调查、问卷调查等方式来获得用户对不同类型音乐的喜好程度。将数据保存在一个文本文件或数据库

如何使用PHP开发简单的文件管理功能简介:文件管理功能在很多Web应用中都是必不可少的一部分。它允许用户上传、下载、删除和展示文件,为用户提供了便捷的文件管理方式。本文将介绍如何使用PHP开发一个简单的文件管理功能,并提供具体的代码示例。一、创建项目首先,我们需要创建一个基本的PHP项目。在项目目录下创建以下文件:index.php:主页面,用于显示上传表

网络爬虫是一种自动化程序,能够自动访问网站并抓取其中的信息。这种技术在如今的互联网世界中越来越常见,被广泛应用于数据挖掘、搜索引擎、社交媒体分析等领域。如果你想了解如何使用PHP编写简单的网络爬虫,本文将会为你提供基本的指导和建议。首先,需要了解一些基本的概念和技术。爬取目标在编写爬虫之前,需要选择爬取的目标。这可以是一个特定的网站、一个特定的网页、或整个互

简单计算器是执行一些基本运算的计算器,例如“+”、“-”、“*”、“/”。计算器可以快速完成基本操作。我们将使用switch语句来制作一个计算器。示例Operator−‘+’=>34+324=358Operator−‘-’=>3874-324=3550Operator−‘*’=>76*24=1824O


Alat AI Hot

Undresser.AI Undress
Apl berkuasa AI untuk mencipta foto bogel yang realistik

AI Clothes Remover
Alat AI dalam talian untuk mengeluarkan pakaian daripada foto.

Undress AI Tool
Gambar buka pakaian secara percuma

Clothoff.io
Penyingkiran pakaian AI

AI Hentai Generator
Menjana ai hentai secara percuma.

Artikel Panas

Alat panas

Pelayar Peperiksaan Selamat
Pelayar Peperiksaan Selamat ialah persekitaran pelayar selamat untuk mengambil peperiksaan dalam talian dengan selamat. Perisian ini menukar mana-mana komputer menjadi stesen kerja yang selamat. Ia mengawal akses kepada mana-mana utiliti dan menghalang pelajar daripada menggunakan sumber yang tidak dibenarkan.

SublimeText3 Linux versi baharu
SublimeText3 Linux versi terkini

SublimeText3 versi Cina
Versi Cina, sangat mudah digunakan

Notepad++7.3.1
Editor kod yang mudah digunakan dan percuma

SublimeText3 versi Mac
Perisian penyuntingan kod peringkat Tuhan (SublimeText3)
