一次ORA-00600[13011]处理过程
一次掉电后,DG主库启动alert中报如下错误
1 | Errors in file /home/oracle/app/oracle/diag/rdbms/min/min/trace/min_m002_4099.trc (incident=16328): |
查看trace文件,部分内容如下
1 |
|
MOS中关于ORA-600 [13013]描述
1 | Format: ORA-600 [13013] [a] [b] {c} [d] [e] [f] |
确定object
1 | SQL> select owner,object_name,object_type from dba_objects where object_id=6665; |
可见与trc文件中的sql中对象名吻合,都是WRH$_RSRC_PLAN
查看trc文件中的PLAN TABLE
1 | ----- Plan Table ----- |
1.The most common cause of this error is an index corruption. The first step is to check the indexes for corruption, i.e. run
1 | SQL> ANALYZE INDEX WRH$_RSRC_PLAN_PK VALIDATE STRUCTURE; |
2.If the indexes do not report corruption, further test for corruption the base tables referenced in the execution plan or the statement producing the error:
1 | SQL> ANALYZE TABLE WRH$_RSRC_PLAN VALIDATE STRUCTURE CASCADE; |
查看生成的trace文件内容
1 | *** 2016-07-21 01:31:31.840 |
对于文件内容,简单介绍如下:
1 | trace文件中包含: |
运行以下sql查询索引的文件和块号
1 | SELECT dbms_utility.data_block_address_file( |
结果如下:
1 | SQL> SELECT dbms_utility.data_block_address_file( |
接下来运行如下查询,定位具体的segment
1 | select owner, segment_name, segment_type |
结果如下:
1 | SQL> select owner, segment_name, segment_type |
看来仍然是上面分析过的索引,这里是因为表和索引的数据不一致,那么重建索引
1 | alter table WRH$_RSRC_PLAN drop constraint WRH$_RSRC_PLAN_PK cascade; |
再次分析表,发现错误消失了
1 | SQL> ANALYZE TABLE WRH$_RSRC_PLAN VALIDATE STRUCTURE CASCADE; |
至此,问题解决
掉电仍是数据库的大敌,而此次并非只在这一张表上有讹误,还有其他一些WRH$表,这些表均属于sysaux表空间,这些表都是awr系列表,写入频繁,掉电容易引起数据的不一致性,但是,正因为是awr数据,并不是特别重要,修复起来也相对容易。
记录一下AWR Performance Tables介绍
1 | The Oracle10g dynamic performance tables constitute the foundation of sophisticated automations such as Automatic Memory Management (AMM ) as well as intelligent advisory tools such as ADDM and the SQL Tuning Advisor. |