SCOTT@book> select count(*) from t;
select count(*) from t
*
ERROR at line 1:
ORA-08103: object no longer exists
--//再线ora-08103.
--//而执行如下不会报错:
SCOTT@book> select count(*) from t where rownum<=10001;
COUNT(*)
----------
10001
SCOTT@book> select count(*) from t where rownum<=10002;
select count(*) from t where rownum<=10002
*
ERROR at line 1:
ORA-08103: object no longer exists
--//检查跟踪文件:
kcbzibmlt: dump suspect buffer, err=8103
buffer tsn: 7 rdba: 0x01800103 (6/259)
scn: 0x0000.00000000 seq: 0x01 flg: 0x05 tail: 0x00000001
frmt: 0x02 chkval: 0xa783 type: 0x00=unknown
Hex dump of corrupt header 4 = CORRUPT
Dump of memory from 0x000000006A4EA000 to 0x000000006A4EA014
06A4EA000 0000A200 01800103 00000000 05010000 [................]
06A4EA010 0000A783 [....]
Hex dump of block: st=4, typ_found=0
Dump of memory from 0x000000006A4EA000 to 0x000000006A4EC000
06A4EA000 0000A200 01800103 00000000 05010000 [................]
06A4EA010 0000A783 00000000 00000000 00000000 [................]
06A4EA020 00000000 00000000 00000000 00000000 [................]
Repeat 508 times
06A4EBFF0 00000000 00000000 00000000 00000001 [................]
Dump of buffer cache at level 8 for tsn=7 rdba=25166080
--//可以发现dba =6,259报错.
5.如何跳过呢?
--//我测试仅仅设置坏块.如果真有数据可以通过一些特殊的方式读出来,这个给看运气.通过10231事件跳过坏块
$ oerr ora 10231
10231, 00000, "skip corrupted blocks on _table_scans_"
// *Cause:
// *Action: such blocks are skipped in table scans, and listed in trace files
--//alter session set db_file_multiblock_read_count=1 ;
ALTER SESSION SET EVENTS '10231 TRACE NAME CONTEXT FOREVER, LEVEL 10';
SCOTT@book> ALTER SESSION SET EVENTS '10231 TRACE NAME CONTEXT FOREVER, LEVEL 10';
Session altered.
SCOTT@book> select count(*) from t ;
select count(*) from t
*
ERROR at line 1:
ORA-08103: object no longer exists
--//不行.在bbed设置坏块看看.
BBED> set dba 6,259
DBA 0x01800103 (25166083 6,259)
BBED> corrupt
Block marked media corrupt.
BBED> sum apply ;
Check value for File 6, Block 259:
current = 0xa683, required = 0xa683
SCOTT@book> select count(*) from t ;
COUNT(*)
----------
10001
--//ok.跳过坏块.