【盖国强】成功恢复案例:解决字典表误Truncate故障

昨天,成功帮助客户恢复了一个故障数据库。

故障的原因是技术人员将数据库中的几个数据字典表Truncate掉,这直接导致了数据库不可用。
数据库环境为Oracle 9.2.0.7 RAC环境。由于数据库的事务量巨大,所以数据库没有备份。

现场检查确认,主要被截断的表有这样一些
SQL> select object_name,object_type from dba_objects where object_name like 'IDL%';

OBJECT_NAME                    OBJECT_TYPE
------------------------------ ------------------
IDL_CHAR$                      TABLE
IDL_SB4$                      TABLE
IDL_UB1$                      TABLE
IDL_UB2$                      TABLE

关于 IDL_UB1$表,我以前讨论过,这是非常重要的字典表,一旦出现故障,数据库会出现大量的ORA-00600错误,所有事务不能进行:
ORA-00600: internal error code, arguments: [17069], [0xC0000000DDDFA690], [], [], [], [], [], []

ORA-600 17069错误是最头疼的,客户当时数据库的一个跟踪日志已经暴涨到5G左右。

IDL系列字典表是记录数据库对象编译信息的,丢失了其中的数据,所有过程、Package等都将无法执行。
摘引一点关于这几个字典表作用的说明:
IDL_UB1$ is one of four tables that hold compiled PL/SQL code:

IDL_UB1$
IDL_CHAR$
IDL_UB2$
IDL_SB4$

"PL/SQL is based on the programming language Ada. As a result, PL/SQL uses a
variant of Descriptive Intermediate Attributed Notation for Ada (DIANA), which
is a tree-structured intermediate language. It is defined using a meta-notation
called Interface Definition Language (IDL). DIANA provides for communication
internal to compilers and other tools.

"At compile time, PL/SQL source code is translated into machine-readable
m-code.Both the DIANA and m-code for a procedure or package are stored in the
database.At run time, they are loaded into the shared (memory) pool. The DIANA is
used to compile dependent procedures; the m-code is simply executed."

These four tables hold the DIANA and the so-code m-code. I think "m-code" is
short for machine-dependent byte code but there is a sizable machine-indenpendent part as well. If you have a look at sql.bsq, you can see
that Oracle documents the "type" column of these tables as follows:

part number not null,
/* part: 0 = diana, 1 = portable pcode, 2 = machine-dependentpcode */

更严重的情况可能会导致大量系统DBMS包失效,其重新编译将更加复杂。

恢复进行了6个小时,成功帮助用户恢复了数据库,消除了所有ORA-600错误。
恢复最主要的是通过运行相关的脚本,重建和重新编译所有Procedure/Trigger/Package等对象,重新生成这些对象的DIANA和so-code m-code,这些主要的脚本包括catlog.sql,catproc.sql等。

当然最重要的是,一些ORA-00600错误需要解决,这可能会花费大量的时间。

这一案例的恢复过程并不重要,重要的是DBA应该学会永远不要让我们的数据库置于这样的危险境地。
DBA四大守则之一: 备份重于一切

DBA的基本素质之一: 严谨

-The End-

作者: eygle | English Version 版权声明:转载时请务必以超链接形式标明文章 和作者信息及 本声明
链接:

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/1384/viewspace-232326/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/1384/viewspace-232326/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值