- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
2#
发表于 2012-5-9 18:55:35
create table file$ /* file table */
( file# number not null, /* file identifier number */
status$ number not null, /* status (see KTS.H): */
/* 1 = INVALID, 2 = AVAILABLE */
blocks number not null, /* size of file in blocks */
/* zero for bitmapped tablespaces */
ts# number, /* tablespace that owns file */
relfile# number, /* relative file number */
maxextend number, /* maximum file size */
inc number, /* increment amount */
crscnwrp number, /* creation SCN wrap */
crscnbas number, /* creation SCN base */
ownerinstance varchar("M_IDEN"), /* Owner instance name */
spare1 number, /* tablespace-relative DBA of space file header */
/* NULL for dictionary-mapped tablespaces */
spare2 number,
spare3 varchar2(1000),
spare4 date
)
/
SQL> select fenum,ferfn from x$kccfe;
FENUM FERFN
---------- ----------
1 1
2 2
3 3
4 4
5 5
6 6
7 1024
7 rows selected.
SQL> select file#,relfile# from file$;
FILE# RELFILE#
---------- ----------
1 1
2 2
3 3
4 4
5 5
6 6
7 1024
7 rows selected.
oradebug dump controlf 4;
DATA FILE #6:
(name #20) /s01/oradata/G10R25/datafile/o1_mf_bct_test_7tgwoyyd_.dbf
creation size=640 block size=8192 status=0xe head=20 tail=20 dup=1
tablespace 9, index=7 krfil=6 prev_file=0
DATA FILE #7:
(name #13) /s01/oradata/G10R25/datafile/o1_mf_bigs_7tnktkkv_.dbf
creation size=1280 block size=8192 status=0xe head=13 tail=13 dup=1
tablespace 10, index=8 krfil=1024 prev_file=0
dba 绝对数据块地址
rdba 相对数据块地址
buffer header中存放有 RDBA, 所以与 buffer相关的操作 均会使用RDBA
例如读取block buffer时 发现 Fractured 仍会报RDBA
Corrupt block relative dba: 0x08d098c7 (file 35, block 1087687)
Fractured block found during backing up datafile
Data in bad block:
type: 6 format: 2 rdba: 0x08d098c7
BBED> map /v
File: /s01/lost1.dbf (0)
Block: 20 Dba:0x00000000
------------------------------------------------------------
KTB Data Block (Table/Cluster)
struct kcbh, 20 bytes @0
ub1 type_kcbh @0
ub1 frmt_kcbh @1
ub1 spare1_kcbh @2
ub1 spare2_kcbh @3
ub4 rdba_kcbh @4
ub4 bas_kcbh @8
ub2 wrp_kcbh @12
ub1 seq_kcbh @14
ub1 flg_kcbh @15
ub2 chkval_kcbh @16
ub2 spare3_kcbh @18
struct ktbbh, 96 bytes @20
ub1 ktbbhtyp @20
union ktbbhsid, 4 bytes @24
struct ktbbhcsc, 8 bytes @28
b2 ktbbhict @36
ub1 ktbbhflg @38
ub1 ktbbhfsl @39
ub4 ktbbhfnx @40
struct ktbbhitl[3], 72 bytes @44
struct kdbh, 14 bytes @124
ub1 kdbhflag @124
b1 kdbhntab @125
b2 kdbhnrow @126
sb2 kdbhfrre @128
sb2 kdbhfsbo @130
sb2 kdbhfseo @132
b2 kdbhavsp @134
b2 kdbhtosp @136
struct kdbt[1], 4 bytes @138
b2 kdbtoffs @138
b2 kdbtnrow @140
sb2 kdbr[79] @142
ub1 freespace[824] @300
ub1 rowdata[7064] @1124
ub4 tailchk @8188
BBED> p kcbh
struct kcbh, 20 bytes @0
ub1 type_kcbh @0 -- Block Type
-- 01 - Undo segment header
-- 02 - Undo data block
-- 03 - Save undo header
-- 04 - Save undo data block
-- 05 - Data segment header
-- 06 - Trans data, KTB managed data block(with ITL)
-- 07 - Temp table data block (no ITL)
-- 08 - Sort key
-- 09 - Sort Run
-- 10 - Segment free list block
-- 11 - Data file header
ub1 frmt_kcbh @1 -- Block Format 1=Oracle7, 2=Oracle8+
ub1 spare1_kcbh @2 -- Not used, filler field
ub1 spare2_kcbh @3 -- Not used, filler field
ub4 rdba_kcbh @4 -- RDBA (4 bytes) - Relative Data Block Address
ub4 bas_kcbh @8 -- SCN Base (4 bytes)
ub2 wrp_kcbh @12 -- SCN Wrap (2 bytes)
ub1 seq_kcbh @14 -- Sequence Number, incremented for every change made to the block at the same SCN
ub1 flg_kcbh @15 -- Flag:
-- 0x01 New Block
-- 0x02 Delayed Logging Chang advanced SCN/seq
-- 0x04 Check value saved - block XOR's to Zero
-- 0x08 Temporary block
ub2 chkval_kcbh @16 -- Optional block checksum (if DB_BLOCK_CHECKSUM=TRUE)
ub2 spare3_kcbh @18 -- Not used, filler field
在Buffer cache 可用之前(open database之前) 绝大多数 操作会用到 DBA ,所以绝大多数 恢复 操作使用DBA ,例如 blockrecover 就使用DBA
RUN
{
BLOCKRECOVER DATAFILE 3 BLOCK 2,3,4,5 TABLESPACE sales DBA 4194405, 4194409, 4194412
FROM DATAFILECOPY;
}
DBA integer Specifies the data block address (DBA) of the corrupt block. |
|