【Troubleshooting】DBV-00102: File I/O error on FILE () during end read operation (-2) on the raw device




  • 数据库平台:AIX 6.1
    数据库版本:oracle 10.2.0.5.7

    【问题描述】
    新搭建了数据库平台并使用裸设备。
    在新建表空间时,AIX主机中报错如下:

    $ errpt|more
    E86653C3   0522104313 P H LVDD           I/O ERROR DETECTED BY LVM
    E86653C3   0522103313 P H LVDD           I/O ERROR DETECTED BY LVM

    然后使用dbv命令进行检测,结果如下:

    $ dbv file=/dev/rora_temp02 blocksize=8192 logfile=rora_temp02.txt

    DBVERIFY: Release 10.2.0.5.0 - Production on Wed May 22 10:48:54 2013

    Copyright (c) 1982, 2007, Oracle.  All rights reserved.

    DBV-00102: File I/O error on FILE (/dev/rora_temp02) during end read operation (-2)

    【分析过程】
    情况1:
    在创建表空间时,由于使用裸设备,会出现如下显示的空间不足的报错:

    SQL> CREATE TABLESPACE test1 datafile '/dev/rora_temp02' SIZE 4g;
    CREATE TABLESPACE test1
    *
    ERROR AT line 1:
    ORA-01119: error IN creating DATABASE FILE '/dev/rora_temp02'
    ORA-27042: NOT enough SPACE ON RAW PARTITION TO fullfill request
    IBM AIX RISC SYSTEM/6000 Error: 6: No such device OR address
    Additional information: 1
    Additional information: 1
    Additional information: -1

    此时AIX操作系统日志中,会报出I/O ERROR DETECTED BY LVM的错误。

    情况2:
    首先创建表空间;

    SQL> CREATE TABLESPACE test1 datafile '/dev/rora_temp02' SIZE 2g;

    TABLESPACE created.

    然后使用dbv检查裸设备文件,结果显示正常。

    $ dbv file=/dev/rora_temp02 blocksize=8192 logfile=rora_temp02.txt

    DBVERIFY: Release 10.2.0.5.0 - Production on Wed May 22 10:48:54 2013

    Copyright (c) 1982, 2007, Oracle. All rights reserved.

    DBVERIFY - Verification starting : FILE = /dev/rora_temp02

    DBVERIFY - Verification complete

    Total Pages Examined : 393216
    Total Pages Processed (Data) : 0
    Total Pages Failing (Data) : 0
    Total Pages Processed (Index): 0
    Total Pages Failing (Index): 0
    Total Pages Processed (Other): 8
    Total Pages Processed (Seg) : 0
    Total Pages Failing (Seg) : 0
    Total Pages Empty : 393208
    Total Pages Marked Corrupt : 0
    Total Pages Influx : 0
    Highest block SCN : 2321525859 (28.2321525859)

    使用resize命令修改数据文件使用的空间,让其大于裸设备的空间,出现报错:

    SQL> ALTER DATABASE datafile '/dev/rora_temp02' resize 10240m;
    ALTER DATABASE datafile '/dev/rora_temp02' resize 10240m
    *
    ERROR AT line 1:
    ORA-01237: cannot extend datafile 34
    ORA-01110: data FILE 34: '/dev/rora_temp02'
    ORA-19502: WRITE error ON FILE "/dev/rora_temp02", blockno 524032
    (blocksize=8192)
    ORA-27063: NUMBER OF bytes read/written IS incorrect
    IBM AIX RISC SYSTEM/6000 Error: 6: No such device OR address
    Additional information: -1
    Additional information: 1048576

    此时再使用dbv检查此文件,出现报错;

    $ dbv file=/dev/rora_temp02 blocksize=8192 logfile=rora_temp02.txt

    DBVERIFY: Release 10.2.0.5.0 - Production on Wed May 22 10:48:54 2013

    Copyright (c) 1982, 2007, Oracle. All rights reserved.

    DBV-00102: File I/O error on FILE (/dev/rora_temp02) during end read operation (-2)

    此时AIX操作系统日志中,就会报出I/O ERROR DETECTED BY LVM的错误。
    如果此时重新resize数据文件使用的空间,让其小于裸设备的空间;

    SQL> ALTER DATABASE tempfile '/dev/rora_temp02' resize 1024m;

    DATABASE altered.

    再次用dbv检测,则结果恢复正常。

    $ dbv file=/dev/rora_temp02 blocksize=8192 logfile=rora_temp02.txt

    DBVERIFY: Release 10.2.0.5.0 - Production on Wed May 22 10:48:54 2013

    Copyright (c) 1982, 2007, Oracle. All rights reserved.

    DBVERIFY - Verification starting : FILE = /dev/rora_temp02

    DBVERIFY - Verification complete

    Total Pages Examined : 393216
    Total Pages Processed (Data) : 0
    Total Pages Failing (Data) : 0
    Total Pages Processed (Index): 0
    Total Pages Failing (Index): 0
    Total Pages Processed (Other): 8
    Total Pages Processed (Seg) : 0
    Total Pages Failing (Seg) : 0
    Total Pages Empty : 393208
    Total Pages Marked Corrupt : 0
    Total Pages Influx : 0
    Highest block SCN : 2321525859 (28.2321525859)

    结论:
    AIX的报错I/O ERROR DETECTED BY LVM是由于创建表空间时size的设置超过了裸设备的可用空间。
    如果resize时超过了裸设备的可用空间,在使用dbv检查数据文件时,就会出现DBV-00102: File I/O error on FILE (/dev/rora_temp02) during end read operation (-2)的报错。重新resize一个合理值,则可解决此报错。

    MOS的官方解释:
    The information in this article applies to:DBVerify
    Symptoms:WHile running DBV on a file
    error:DBV-00102: FILE I/O ERROR ON FILE   <file name>
    Also,the size shown at the OS level will be different than the size shown at the Oracle level(through dba_data_files)
    Fix:
    Resize the datafile by small amount will solve this issue
    using
    Alter database datafile ........................resize .........

    【处理方法】
    将报错的裸设备文件,重新resize一个适当的大小。
    Alter database datafile ......resize ......

    Comments

    1. Thank you very much. This really helped me with my work. I appreciate your help. Thanks a lot.

    Speak Your Mind

    *

    京ICP备14059771号-2