[20190918]shrink space与ORA-08102错误.txt
1.环境:
SCOTT@test01p> @ ver1
PORT_STRING VERSION BANNER CON_ID
------------------------------ -------------- -------------------------------------------------------------------------------- ----------
IBMPC/WIN_NT64-9.1.0 12.2.0.1.0 Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production 0
2.再现ORA-08102错误:
SCOTT@test01p> create table t(x int, pad varchar2(100)) enable row movement;
Table created.
SCOTT@test01p> insert /*+ append*/ into t select level, lpad('x', 100, 'x') from dual connect by level<=1e4;
10000 rows created.
SCOTT@test01p> alter table t add y int default 10 not null;
Table altered.
SCOTT@test01p> create index i_t_xy on t(x,y);
Index created.
SCOTT@test01p> delete t where x<=5000;
5000 rows deleted.
SCOTT@test01p> commit ;
Commit complete.
SCOTT@test01p> alter table t shrink space;
alter table t shrink space
*
ERROR at line 1:
ORA-08102: index key not found, obj# 27979, file 11, block 2445 (2)
SCOTT@test01p> host oerr ora 8102
08102, 00000, "index key not found, obj# %s, file %s, block %s (%s)"
// *Cause: Internal error: possible inconsistency in index
// *Action: Send trace file to your customer support representative, along
// with information on reproducing the error
3.10046跟踪看看.
SCOTT@test01p> alter session set events '10046 level 12';
Session altered.
SCOTT@test01p> alter table t shrink space;
alter table t shrink space
*
ERROR at line 1:
ORA-08102: index key not found, obj# 27979, file 11, block 2445 (2)
SCOTT@test01p> alter session set events '10046 off';
Session altered.
--//检查转储发现:
oer 8102.2 - obj# 27979, rdba: 0x02c0098d(afn 11, blk# 2445)
kdk key 8102.2:
ncol: 3, len: 12
key: (12): 03 c2 64 31 ff 06 02 c0 1d a5 00 00
mask: (2048):
--//通过bbed观察看看.
--//03 c2 64 31 ,03表示长度.后面3位表示oracle数字.
SCOTT@test01p> @ conv_n c26431
N20
----------
9948
BBED> set dba 11,2446
DBA 0x02c0098e (46139790 11,2446)
--//注:windows下bbed,无法识别10g以上版本的os头,block存在+1的偏移.
BBED> map
File: D:\APP\ORACLE\ORADATA\TEST\TEST01P\USERS01.DBF (11)
Block: 2446 &n