Oracle11g repair of Bad blocks I: A Brief Introduction to the bbed command. This tool will be used later ..
Oracle11g repair of Bad blocks I: A Brief Introduction to the bbed command. This tool will be used later ..
Repair of oracle11g Bad blocks
I. a brief introduction to the bbed command. Later, we will use this tool to construct the block checksum and do not express it to simulate Bad blocks.
Show all current configuration options
Info: list the files that can be processed by the current bbed.
Set dba fileid, block: set the id and block number of the data file to be processed.
Set dba fileid, block can also be replaced by set file fileid and set block blockno
Set offset xxx offset uses the set block number setting as the baseline offset for the number of bytes of the current block number
Dump/v displays the content of the current data block. By default, the content is displayed starting from the number of offset bytes set for the current data block. The/v parameter shows the detailed content, which is detailed to what realm, and will be known later.
Find/c search content TOP/c specify search content as character TOP specify from the data block header offset is 0 start the entire search to find a display, if you want to find the next character, specify f.
The content to be modified in modify/c is modified by default from the number of file, block number, and offset bytes specified in set.
Ii. Create a test table
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. query the block where the jiujian table is located.
Statement: 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 is the block where the table jiujian is located.
3. Create a configuration file for bbed.
[Oracle @ oracle ~] $ Cat bbed. par
Blocksize = 8192
Listfile =/oracle/file
Mode = edit
Text file Content
[Oracle @ oracle ~] $ Cat file
1/oracle/CRM/system01.db 786432000
2/oracle/CRM/sysaux01.dbf 566231040
3/oracle/CRM/undotbs01.dbf 104857600
4/backup/users01.dbf 1827143680
5/oracle/CRM/pos. DB 524288000
6/oracle/CRM/erp. dbf 104857600
7/oracle/CRM/user01.dbf 5242880
10/oracle/CRM/undotbs02.dbf 104857600
The file content is obtained by the following statement:
SQL> select file # | ''| name |'' | bytes from v $ datafile;
FILE # | ''| NAME |'' | BYTES
--------------------------------------------------------------------------------
1/oracle/CRM/system01.db 786432000
2/oracle/CRM/sysaux01.dbf 566231040
3/oracle/CRM/undotbs01.dbf 104857600
4/backup/users01.dbf 1827143680
5/oracle/CRM/pos. DB 524288000
6/oracle/CRM/erp. dbf 104857600
7/oracle/CRM/user01.dbf 5242880
10/oracle/CRM/undotbs02.dbf 104857600
4. Construct Bad blocks with bbed
[Oracle @ oracle ~] $ Bbed parfile = bbed. par
Password: blockedit
BBED> show display Configuration
FILE #1
BLOCK #1
OFFSET 0
DBA 0x00400001 (4194305)
FILENAME/oracle/CRM/system01.dbf
BIFILE bifile. bbd
LISTFILE/oracle/file
Blocsize 8192
MODE Edit
EDIT Unrecoverable
IBASE Dec
OBASE Dec
WIDTH 80
COUNT 1, 512
LOGFILE log. bbd
SPOOL No