本space主要想聚合Oralce技术专家的随笔和技术文章,另外整理和收集Oracle经典技术文章。

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

上一篇 / 下一篇  2008-04-10 09:14:22 / 个人分类:OracleACE聚合

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

故障的原因是技术人员将数据库中的几个数据字典表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版权声明:转载时请务必以超链接形式标明文章和作者信息及本声明
链接:

TAG:

引用 删除 Guest   /   2008-04-15 20:43:58
5
赵宇的DBA记事本 引用 删除 赵宇   /   2008-04-14 15:42:31
现在最可怕的人不是硬件是人为啊
引用 删除 Guest   /   2008-04-11 11:27:50
5
 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-07-24  
  12345
6789101112
13141516171819
20212223242526
2728293031  

数据统计

  • 访问量: 15539
  • 日志数: 132
  • 建立时间: 2008-03-25
  • 更新时间: 2008-07-22

RSS订阅

Open Toolbar