- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
2#
发表于 2012-4-15 20:38:41
先说一点 题外话 关于 如何绕过 存在 讹误corruption的 data block (有数据的块):
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> create tablespace mac datafile '/s01/mac.dbf' size 20M;
Tablespace created.
SQL> create table maclean tablespace mac as select * from dba_objects;
Table created.
SQL> alter system checkpoint;
System altered.
RMAN> backup tablespace mac;
[oracle@vrh8 ~]$ bbed filename=/s01/mac.dbf blocksize=8192 mode=edit password=blockedit
BBED: Release 2.0.0.0.0 - Limited Production on Sun Apr 15 08:25:31 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************
BBED> set block 20
BLOCK# 20
BBED> map /v
File: /s01/mac.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> corrupt
Block marked media corrupt.
SQL> alter system flush buffer_cache;
System altered.
SQL> select count(*) from maclean;
select count(*) from maclean
*
ERROR at line 1:
ORA-01578: ORACLE data block corrupted (file # 17, block # 20)
ORA-01110: data file 17: '/s01/mac.dbf'
SQL> declare
2 begin
3 dbms_repair.skip_corrupt_blocks (
4 schema_name => 'SYS',
5 object_name => 'MACLEAN',
6 object_type => dbms_repair.table_object,
7 flags => dbms_repair.skip_flag);
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> select table_name, skip_corrupt from dba_tables where table_name = 'MACLEAN';
TABLE_NAME SKIP_COR
------------------------------ --------
MACLEAN ENABLED
SQL> select count(*) from maclean;
COUNT(*)
----------
50634
SQL> select count(*) from dba_objects;
COUNT(*)
----------
50713 |
|