利用RMAN检测数据库坏块的脚本

虽然我们也可以通过dbv(db file verify)工具做到对单个数据文件的坏块检测,但是直接使用RMAN的”backup validate check logical database;”结合V$DATABASE_BLOCK_CORRUPTION视图要方便地多。

Script:

1) $ rman target / nocatalog 2) RMAN> run { allocate channel d1 type disk; allocate channel d2 type disk; allocate channel d3 type disk; allocate channel d4 type disk; backup validate check logical database; } 3) select * from V$DATABASE_BLOCK_CORRUPTION ; REM www.oracledatabase12g.com & www.askmaclean.com 4) . . . → Read More: 利用RMAN检测数据库坏块的脚本

Oracle内部错误:ORA-00600[13013][5001]故障诊断一例

周五被叫到客户现场解决一套10.2.0.4 RAC数据库上的ORA-00600[13013]内部错误问题,这个问题同事已经在上午通过远程拨号了解过情况, 初步判断是索引存在讹误corruption引起的600。

前期诊断

同事在我抵达现场之前已经做了初步的诊断,该10.2.0.4上的RAC系统主用节点的告警日志中多次出现ORA-00600:[13013], [5001]、ORA-00600:[qertbFetchByRowID]及ORA-00600: [25027] 等内部错误,具体的日志如下:

Fri Sep 16 01:16:54 2011 Errors in file /oravl01/oracle/admin/CRMDB2/udump/crmdb22_ora_2138788.trc: ORA-00600: internal error code, arguments: [13013], [5001], [66209], [50730514], [23], [50730514], [3], [] Fri Sep 16 01:16:55 2011 Trace dumping is performing id=[cdmp_20110916011655] Fri Sep 16 01:17:06 2011 Errors in file /oravl01/oracle/admin/CRMDB2/udump/crmdb22_ora_2138788.trc: ORA-00600: internal error code, arguments: [13013], . . . → Read More: Oracle内部错误:ORA-00600[13013][5001]故障诊断一例

手工模拟Oracle数据块逻辑讹误引发ORA-00600:[13013], [5001]一例

上周在客户那里遇到了一例由Oracle Bug引发的表数据块逻辑讹误触发ORA-00600:[13013], [5001]的问题,这里为了更好地说明该问题,于是萌发了手工模拟该数据块逻辑讹误的想法。

基础知识

Oracle中表的数据块由块头、事务槽、行字典、行数据等多种结构组成。 行数据(rowdata)实际是由许多row piece 行片组成的,每一条row piece的头部都有flag、locks、cols(cc)三个标志位。

其中flag标记了该row piece的类型,该flag位占用一个字节,其不同的bit位代表不同的含义,见下表:

ROW_CLUSTER_KEY = 0×80; KDRHFK ROW_CTABLE_NUMBER = 0×40; KDRHFC ROW_HEAD_PIECE = 0×20; KDRHFH ROW_DELETED_ROW = 0×10; KDRHFD ROW_FIRST_PIECE = 0×08; KDRHFF ROW_LAST_PIECE = 0×04; KDRHFL ROW_FROM_PREVIOUS = 0×02; KDRHFP ROW_CONTINUE_NEXT = 0×01; KDRHFN

一般来说最普通的一条row piece是普通堆表(heap table)的未被删除的且无行迁移/链接的,其flag位应为

普通row的flag一般为 Single Row = ROW_HEAD_PIECE + ROW_FIRST_PIECE + ROW_LAST_PIECE= . . . → Read More: 手工模拟Oracle数据块逻辑讹误引发,ORA-00600:[13013] [5001]一例

HowTo validate a date/timestamp column

Applies to:

Oracle Server – Enterprise Edition – Version: 9.2.0.1 to 11.2.0.1.0 – Release: 9.2 to 11.2 Information in this document applies to any platform.

Goal

Goal of this document is to validate all date/timestamp values of a specific column in specific table (check will be done on partial content of timestamp: up till the . . . → Read More: HowTo validate a date/timestamp column

How to Find all corrupted objects associated with one or many contiguous corrupted blocks reported in V$DATABASE_BLOCK_CORRUPTION or alert log / trace file

Applies to:

Oracle Server – Enterprise Edition – Version: 10.1.0.2 to 11.2.0.1 – Release: 10.1 to 11.2 Information in this document applies to any platform.

Purpose

To identify the corrupted blocks in database, the easier method is to run following RMAN command:

$ rman target /

RMAN> run { ## allocate multiple channels to run . . . → Read More: How to Find all corrupted objects associated with one or many contiguous corrupted blocks reported in V$DATABASE_BLOCK_CORRUPTION or alert log / trace file

Dealing with Database Corruption

Dealing with database corruption View more documents from Maclean Liu