ORA-08102异常重现及恢复
现象:
SQL> alter table t add primary key(id);
alter table t add primary key(id)
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-08102: index key not found, obj# 52, file 1, block 72661 (2)
重现异常:
SQL> SELECT OWNER#,NAME,CON# FROM CON$ WHERE NAME='_NEXT_CONSTRAINT';
OWNER# NAME CON#
---------- ------------------------------ ----------
0 _NEXT_CONSTRAINT 11222
SQL> set lines 200
SELECT OWNER#,NAME,CON#,
dbms_rowid.ROWID_RELATIVE_FNO(rowid) fno,
dbms_rowid.ROWID_BLOCK_NUMBER(rowid) bno,
dbms_rowid.ROWID_ROW_NUMBER(rowid) rno FROM CON$ WHERE NAME='_NEXT_CONSTRAINT';
OWNER# NAME CON# FNO BNO RNO
---------- ------------------------------ ---------- ---------- ---------- ----------
0 _NEXT_CONSTRAINT 11222 1 289 12
[oracle@cqfrog bbed]$ bbed parfile=par.txt
BBED> set file 1 block 289
FILE# 1
BLOCK# 289
- BBED> p *kdbr[12]
rowdata[0]
----------
ub1 rowdata[0] @1207 0x2c
- BBED> x /rccnn
rowdata[0] @1207
----------
flag@1207: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@1208: 0x02
cols@1209: 4
col 0[1] @1210: .
col 1[16] @1212: _NEXT_CONSTRAINT
col 2[4] @1229: 11222
col 3[1] @1234: 0
BBED> dump /v offset 1229 count 16
File: /u01/app/oracle/oradata/orcl/system01.dbf (1)
Block: 289 Offsets: 1229 to 1244 Dba:0x00400121
-------------------------------------------------------
04c3020d 1701802c 00040180 105f4e45 l .......,....._NE
<16 bytes per line>
SQL> select dump(11222, 16) from dual;
DUMP(11222,16)
----------------------
Typ=2 Len=4: c3,2,d,17
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
BBED> dump /v offset +4
File: /u01/app/oracle/oradata/orcl/system01.dbf (1)
Block: 289 Offsets: 1233 to 1248 Dba:0x00400121
-------------------------------------------------------
1701802c 00040180 105f4e45 58545f43 l ...,....._NEXT_C
<16 bytes per line>
BBED> modify /x 1901802c
File: /u01/app/oracle/oradata/orcl/system01.dbf (1)
Block: 289 Offsets: 1233 to 1248 Dba:0x00400121
------------------------------------------------------------------------
1901802c 00040180 105f4e45 58545f43
<32 bytes per line>
BBED> sum apply
Check value for File 1, Block 289:
current = 0x7fca, required = 0x7fca
BBED> dump /v offset 1233
File: /u01/app/oracle/oradata/orcl/system01.dbf (1)
Block: 289 Offsets: 1233 to 1248 Dba:0x00400121
-------------------------------------------------------
1901802c 00040180 105f4e45 58545f43 l ...,....._NEXT_C
<16 bytes per line>
SQL> startup
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2217952 bytes
Variable Size 549455904 bytes
Database Buffers 276824064 bytes
Redo Buffers 6606848 bytes
Database mounted.
Database opened.
SQL> select /*+ FULL(t1) */ name,con# from con$ t1 where name='_NEXT_CONSTRAINT';
NAME CON#
------------------------------ ----------
_NEXT_CONSTRAINT 11224
SQL> select /*+ index(t1 I_CON2) */ name,con# from con$ t1 where name='_NEXT_CONSTRAINT';
NAME CON#
------------------------------ ----------
_NEXT_CONSTRAINT 11222
SQL> create table t as select * from test where rownum<10;
Table created.
SQL> desc t;
Name Null? Type
----------------------------------------- -------- ----------------------------
ID NUMBER
NAME VARCHAR2(128
SQL> alter table t add primary key(id);
alter table t add primary key(id)
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-08102: index key not found, obj# 52, file 1, block 72661 (2)
修复ORA-08102异常:
SQL> alter table t add primary key(id);
alter table t add primary key(id)
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-08102: index key not found, obj# 52, file 1, block 72661 (2)
SQL> select /*+ FULL(t1) */ name,con# from con$ t1 where name='_NEXT_CONSTRAINT';
NAME CON#
------------------------------ ----------
_NEXT_CONSTRAINT 11224
SQL> select /*+ index(t1 I_CON2) */ name,con# from con$ t1 where name='_NEXT_CONSTRAINT';
NAME CON#
------------------------------ ----------
_NEXT_CONSTRAINT 11222
SQL> alter system dump datafile 1 block 72661;
System altered.
SQL> select * from v$diag_info;
1 Default Trace File /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_6051.trc
SQL> select UTL_RAW.CAST_TO_NUMBER(replace('c3 02 0d 19',' ','')) from dual;
UTL_RAW.CAST_TO_NUMBER(REPLACE('C3020D19','',''))
-------------------------------------------------
11224
row#198[3566] flag: ---D--, lock: 2, len=13, data:(6): 00 41 38 6c 00 ad
col 0; len 4; (4): c3 02 0d 15
row#199[3540] flag: ---D--, lock: 2, len=13, data:(6): 00 41 38 6c 00 af
col 0; len 4; (4): c3 02 0d 16
row#200[3553] flag: ------, lock: 0, len=13, data:(6): 00 40 01 21 00 0c
col 0; len 4; (4): c3 02 0d 17
----- end of leaf block dump -----
End dump data blocks tsn: 0 file#: 1 minblk 72661 maxblk 72661
SQL> select UTL_RAW.CAST_TO_NUMBER(replace('c3 02 0d 17',' ','')) from dual;
UTL_RAW.CAST_TO_NUMBER(REPLACE('C3020D17','',''))
-------------------------------------------------
11222
BBED> set file 1 block 72661;
FILE# 1
BLOCK# 72661
BBED> dump offset 3677 count 16
File: /u01/app/oracle/oradata/orcl/system01.dbf (1)
Block: 72661 Offsets: 3677 to 3692 Dba:0x00411bd5
------------------------------------------------------------------------
04c3020d 17010200 41386c00 ad04c302
BBED> modify /x 19 offset 3681
File: /u01/app/oracle/oradata/orcl/system01.dbf (1)
Block: 72661 Offsets: 3681 to 3696 Dba:0x00411bd5
------------------------------------------------------------------------
19010200 41386c00 ad04c302 0d150100
<32 bytes per line>
BBED> sum apply
Check value for File 1, Block 72661:
current = 0x1fa3, required = 0x1fa3
BBED> dump offset 3677 count 16
File: /u01/app/oracle/oradata/orcl/system01.dbf (1)
Block: 72661 Offsets: 3677 to 3692 Dba:0x00411bd5
------------------------------------------------------------------------
04c3020d 19010200 41386c00 ad04c302
<32 bytes per line>
SQL> select /*+ FULL(t1) */ name,con# from con$ t1 where name='_NEXT_CONSTRAINT';
NAME CON#
------------------------------ ----------
_NEXT_CONSTRAINT 11224
SQL> select /*+ index(t1 I_CON2) */ name,con# from con$ t1 where name='_NEXT_CONSTRAINT';
NAME CON#
------------------------------ ----------
_NEXT_CONSTRAINT 11224
SQL> alter table t add primary key(id);
Table altered.
ORA-08102异常重现及恢复的更多相关文章
- Go语言 异常panic和恢复recover用法
Go语言 异常panic和恢复recover用法 背景:Go语言追求简洁优雅,所以,Go语言不支持传统的 try…catch…finally 这种异常,因为Go语言的设计者们认为,将异常与控制结构混在 ...
- mysql主从同步异常原因及恢复
mysql主从同步异常原因及恢复 前言 mysql数据库做主从复制,不仅可以为数据库的数据做实时备份,保证数据的完整性,还能做为读写分离,提升数据库的整体性能.但是,mysql主从复制经常会因为某些原 ...
- 【3】JVM-OutOfMemory异常重现
JVM中常见的OOM,那么如何通过自己编写代码产生这些OOM异常呢?通过写代码重现异常,是为了避免在工作中写出有OOM BUG的代码.之前虽然看过相关文章,但是没自己写过这些代码,这次在编写的实际过程 ...
- 通过NBU还原数据库提示LINKING异常,无法恢复数据
错误提示: 解决方法:
- Java中的受检异常
Java中的受检异常 Java提供了三种异常类型,受检异常(checked exception).运行时异常(runtime exception).错误(error).那么这受检异常在实际开发中又有什 ...
- SQL Server数据库的三种恢复模式:简单恢复模式、完整恢复模式和大容量日志恢复模式(转载)
SQL Server数据库有三种恢复模式:简单恢复模式.完整恢复模式和大容量日志恢复模式: 1.Simple 简单恢复模式, Simple模式的旧称叫”Checkpoint with truncate ...
- [Effective Java]第九章 异常
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
- Win32环境下的程序崩溃异常定位
1 案例描述 作为Windows程序员,平时最担心见到的事情可能就是程序发生了崩溃(异常),这时Windows会提示该程序执行了非法操作,即将关闭.请与您的供应商联系.呵呵,这句微软的“名 ...
- 云计算之路-阿里云上:3个manager节点异常造成 docker swarm 集群宕机
今天 11:29 - 11:39 左右,docker swarm 集群 3 个 manager 节点同时出现异常,造成整个集群宕机,由此给您带来很大的麻烦,请您谅解. 受此次故障影响的站点有:博问,闪 ...
随机推荐
- django 获取当前访问的URL
next_url = request.path_info print(next_url) print(request.get_full_path()) //打印出全路径(路径和参数) print(re ...
- Caddy源码阅读(二)启动流程与 Event 事件通知
Caddy源码阅读(二)启动流程与 Event 事件通知 Preface Caddy 是 Go 语言构建的轻量配置化服务器.https://github.com/caddyserver/caddy C ...
- C# HTTP系列13 以form-data方式上传多个文件以及键值对集合到远程服务器
系列目录 [已更新最新开发文章,点击查看详细] 类似于以下场景,将表单中的用户信息(包含附件)上传到服务器并保存到数据库中, <form id="form1" run ...
- 从零开始搭建Java开发环境第三篇:最新版IDEA常用配置指南,打造你的最酷IDE
刚刚使用IntelliJ IDEA 编辑器的时候,会有很多设置,会方便以后的开发,工欲善其事必先利其器. 比如:设置文件字体大小,代码自动完成提示,版本管理,本地代码历史,自动导入包,修改注释,修改t ...
- Setup Factory 9 简单打包
由于项目资源太大,使用VS自带打包工具无法实现需求,所以Setup Factory 9进行打包生成多个文件的方案,下面记录使用方法: 一:这里点击下载:下载,提取码:tt7a 二:下载完安装需要注册码 ...
- java程序员学习路线阶段总结20190903
算法:锻炼写代码的逻辑 刷题位置:leetcode 书籍:小灰漫画算法 leecode使用方法: 转载自http://blog.csdn.net/tostq 又到了一年毕业就业季了,三年前的校招季我逃 ...
- 表单模糊查询的三种简单方式(springboot-h2-mybatis)
前几天运营提到说后台管理系统有几个地方想要模糊查询.. 想了下是简单的,就是要注意以前方法的被调用情况,进行增量改动,以免牵一发而动全身.整理一波记录下(本次案例是按名字模糊查询学生信息). 三种 ...
- 【EDU68 E】 Count The Rectangles 数据结构算几何
CF # 题意 总共有5000条线段,这些线段要么水平,要么垂直,问这些线段组成了多少矩形. # 思路 这是一个n*n*(log)的思路 自己一开始想着枚举两条垂直边,想着怎么把水平的边插入,再进行冗 ...
- LuoGu-P2863牛的舞会The Cow Prom[tarjan 缩点模板]
传送门:https://www.luogu.org/problemnew/show/P2863 思路:tarjan模板题,之前会的tarjan,一直想学缩点到底是什么操作,发现就是把同组的放在一个数组 ...
- POJ-1860 Currency Exchange( Bellman_Ford, 正环 )
题目链接:http://poj.org/problem?id=1860 Description Several currency exchange points are working in our ...