Home > Database > Mysql Tutorial > body text

oracle关于坏块的修复一

WBOY
Release: 2016-06-07 17:40:33
Original
1005 people have browsed it

oracle11g关于坏块的修复一:bbed的命令简单介绍,后面用该工具..

                        oracle11g关于坏块的修复
一:bbed的命令简单介绍,后面用该工具构造块校验和不一致以达到模拟坏块目的

show 显示当前所有配置选项
info:列出当前bbed能处理的文件
set dba fileid,block:设置当前要处理的数据文件id和块号
set dba fileid,block 也可以用 set file  fileid 和set block  blockno 代替
set offset xxx  offset 以set block 块号的设置为基准偏移当前块号的字节数
dump  /v  显示当前数据块的内容 默认从当前数据块设置的offset字节数处开始显示。/v 参数显示详细内容,详细到啥境界,后面就晓得了。
find /c 查找的内容 TOP   /c 指定查找内容为字符  TOP指定从数据块头部偏移量为0处开始整块搜索搜到一处显示一处,如果要查找下一个该字符则指定f即可
modify /c 要修改内容  默认从set指定的文件、块号、offset偏移字节数处进行修改。


二: 创建测试用的表
SQL> create table jiujian(des varchar(30)) tablespace pos;

Table created.

SQL> insert into jiujian values('zhangxu love oracle');

1 row created.

SQL> select * from jiujian;

DES
------------------------------
zhangxu love oracle

2 查询表jiujian所在的块
语句: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 jiujian;
SQL> select rowid,
  2  dbms_rowid.rowid_relative_fno(rowid) rel_fno,
  3  dbms_rowid.rowid_block_number(rowid) blockno,
  4  dbms_rowid.rowid_row_number(rowid) rowno
  5  from jiujian;

ROWID                 REL_FNO    BLOCKNO      ROWNO
------------------ ---------- ---------- ----------
AAATqzAAFAAAACHAAA          5        135          0
字段BLOCKNO 135即为表jiujian所在的块

三:创建bbed的配置文件
[oracle@oracle ~]$ cat bbed.par
blocksize=8192
listfile=/oracle/file
mode=edit
文本文件file 内容
[oracle@oracle ~]$ cat file
1 /oracle/CRM/system01.dbf 786432000
2 /oracle/CRM/sysaux01.dbf 566231040
3 /oracle/CRM/undotbs01.dbf 104857600
4 /backup/users01.dbf 1827143680
5 /oracle/CRM/pos.dbf 524288000
6 /oracle/CRM/erp.dbf 104857600
7 /oracle/CRM/user01.dbf 5242880
10 /oracle/CRM/undotbs02.dbf 104857600
file 内容由以下语句获取:
SQL> select file#||' '||name||' '||bytes from v$datafile;

FILE#||''||NAME||''||BYTES
--------------------------------------------------------------------------------
1 /oracle/CRM/system01.dbf 786432000
2 /oracle/CRM/sysaux01.dbf 566231040
3 /oracle/CRM/undotbs01.dbf 104857600
4 /backup/users01.dbf 1827143680
5 /oracle/CRM/pos.dbf 524288000
6 /oracle/CRM/erp.dbf 104857600
7 /oracle/CRM/user01.dbf 5242880
10 /oracle/CRM/undotbs02.dbf 104857600

四 开始用bbed构造坏块

[oracle@oracle ~]$ bbed parfile=bbed.par 
Password:blockedit


BBED> show   显示配置
        FILE#           1
        BLOCK#          1
        OFFSET          0
        DBA             0x00400001 (4194305 1,1)
        FILENAME        /oracle/CRM/system01.dbf
        BIFILE          bifile.bbd
        LISTFILE        /oracle/file
        BLOCKSIZE       8192
        MODE            Edit
        EDIT            Unrecoverable
        IBASE           Dec
        OBASE           Dec
        WIDTH           80
        COUNT           512
        LOGFILE         log.bbd
        SPOOL           No

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template