Corrupted block is simulated and repaired via bbed in Oracle

Source: Internet
Author: User
Tags dba numeric

The use of bbed requires attention:

1, win under Oracle does not provide

2, with Oracle software release

3, Unix/linux under the use of the need for prior relink

4, Oracle initially used bbed to repair bad block, starting from 9i can be recovered through the Rman blockrecover, but only if the prior backup

[Oracle@xys oracle]$ bbed

Password:

Bbed:release 2.0.0.0.0-limited Production on Tue June 9 13:13:04 2009

Copyright (c) 1982, +, Oracle. All rights reserved.

************* !!! For Oracle Internal with only!!! ***************

Bbed> help all;

SET DBA [DBA | file#, block#]

SET filename ' filename '

SET FILE file#

SET Block [+/-]block#

SET offset [[+/-]byte offset | symbol | *symbol]

SET BLOCKSIZE bytes

SET list[file] ' filename '

SET WIDTH Character_count

SET COUNT Bytes_to_display

SET IBase [HEX | OCT | DEC]

SET Obase [HEX | OCT | DEC]

SET MODE [BROWSE | EDIT]

SET SPOOL [Y | N

Show [<set parameter> | ALL]

INFO

MAP[/V] [DBA | FILENAME | FILE | Block]

DUMP[/V] [DBA | FILENAME | FILE | Block | OFFSET | COUNT]

PRINT[/X|D|U|O|C] [DBA | FILE | FILENAME | Block | OFFSET | Symbol | *symbol]

EXAMINE[/NUF] [DBA | FILE | FILENAME | Block | OFFSET | Symbol | *symbol]

</nuf>:

N-A number which specifies a repeat count.

U-a letter which specifies a unit size:

B-B1, Ub1 (byte)

H-B2, UB2 (Half-word)

W-B4, UB4 (word)

R-oracle Table/index Row

F-a letter which specifies a display format:

X-hexadecimal

D-decimal

u-unsigned Decimal

O-octal

C-character (native)

N-oracle number

T-oracle Date

I-oracle rowID

FIND[/X|D|U|O|C] numeric/character string [Top | CURR]

COPY [DBA | FILE | FILENAME | Blocks] to [DBA | FILE | FILENAME | Block]

MODIFY[/X|D|U|O|C] Numeric/character string

[DBA | FILE | FILENAME | Block | OFFSET | Symbol | *symbol]

Assign[/x|d|u|o] <target Spec>=<source spec>

<target spec>: [DBA | FILE | FILENAME | Block | OFFSET | Symbol | *symbol]

<source spec>: [value | <target spec options>]

SUM [DBA | FILE | FILENAME | Block] [APPLY]

PUSH [DBA | FILE | FILENAME | Block | OFFSET]

POP [All]

REVERT [DBA | FILE | FILENAME | Block]

UNDO

Help [<bbed command> | ALL]

VERIFY [DBA | FILE | FILENAME | Block]

corrupt [DBA | FILE | FILENAME | Block]

Bbed>

--======================================

Sql> CREATE TABLE TT (ID int, name VARCHAR2 ()) tablespace trans;

Table has been created.

Sql> INSERT INTO TT values (1, ' a ');

1 lines have been created.

Sql> commit;

Submit completed.

Sql> Select Dbms_rowid.rowid_relative_fno (ROWID) fno,dbms_rowid.rowid_block_numb

ER (rowid) bno, tt.* from TT;

FNO BNO ID NAME

---------- ---------- ---------- --------------------

5 1 A

Sql> select Tablespace_name,file_id,file_name from Dba_data_files;

Tablespace_name file_id file_name

-------------------- ---------- --------------------

SYSTEM 1/DEV/RAW/RAW1

UNDOTBS1 2/DEV/RAW/RAW3

Sysaux 3/DEV/RAW/RAW2

USERS 4/DEV/RAW/RAW6

TRANS 5/DEV/RAW/RAW14

Sql>

--============================================

Bbed> dump file 5 block 15;

File:/dev/raw/raw14 (5)

Block:15 offsets:0 to 8191 dba:0x0140000f

------------------------------------------------------------------------

06a20000 0f004001 a7a91000 00000306 91370000 01000000 302b0000 a2a91000

00000000 02003200 09004001 07002c00 bc000000 c2008000 58000c00 01200000

A7a91000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00010100 ffff1400 901f7b1f 7b1f0000 0100901f 00000000 00000000

...... Omitting extraneous information

00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

00000000 00000000 00000000 00000000 00000000 2c010202 c1020161 0306a7a9

<32 bytes per line>

Bbed> find/x Curr

File:/dev/raw/raw14 (5)

Block:15 offsets:8187 to 8191 dba:0x0140000f

------------------------------------------------------------------------

610306a7 A9

<32 bytes per line>

Bbed> sum;

Check value for File 5, block 15:

Current = 0x3791, required = 0x3791

Bbed> Help Modify

MODIFY[/X|D|U|O|C] Numeric/character string

[DBA | FILE | FILENAME | Block | OFFSET | Symbol | *symbol]

Bbed> modify/x file 5 block offset 8187;

File:/dev/raw/raw14 (5)

Block:15 offsets:8187 to 8191 dba:0x0140000f

------------------------------------------------------------------------

620306a7 A9

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.