Oracle 10g 裸裝置資料檔案恢複,ORA-19501、ORA-27063

來源:互聯網
上載者:User

環境說明:
OS:aix 6.1
DB:Oracle 10gR2  裸裝置

使用rman備份整個Database Backup失敗,提示71資料檔案失敗,單獨備份這個資料檔案
$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Thu Nov 7 09:14:31 2013

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

connected to target database: ORCL (DBID=1237792397, not open)

RMAN>  backup as copy datafile 71 format '/backup_dir/in71_%U';

Starting backup at 07-NOV-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1086 devtype=DISK
channel ORA_DISK_1: starting datafile copy
input datafile fno=00071 name=/dev/rdata_03
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/07/2013 09:18:10
ORA-19501: read error on file "/dev/rdata_03", blockno 178305 (blocksize=8192)
ORA-27063: number of bytes read/written is incorrect
IBM AIX RISC System/6000 Error: 5: I/O error
Additional information: -1
Additional information: 1048576

RMAN> backup check logical validate datafile 71;

Starting backup at 07-NOV-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00071 name=/dev/rdata_03
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/07/2013 09:47:03
ORA-19501: read error on file "/dev/rdata_03", blockno 178305 (blocksize=8192)
ORA-27063: number of bytes read/written is incorrect
IBM AIX RISC System/6000 Error: 5: I/O error
Additional information: -1
Additional information: 1048576

查詢壞塊個數
SQL> select * from  v$database_block_corruption;

no rows selected

沒有查詢到邏輯壞塊,猜測為物理壞塊,資料庫層面還認為是好的資料庫造成了讀的時候提示I/O error


檢查71號檔案的資料區塊個數
SQL> select bytes/8192 from v$datafile where file#=71;

BYTES/8192
----------
  1280000
 
 
驗證裸裝置是否可以讀
$ dbv file=/dev/rdata_03 blocksize=8192

DBVERIFY: Release 10.2.0.1.0 - Production on Thu Nov 7 09:48:08 2013

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

DBVERIFY - Verification starting : FILE = /dev/rdata_03

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

 

找出壞塊,使用Oracle內建的工具
$ dbv file=/dev/rdata_03 blocksize=8192

DBVERIFY: Release 10.2.0.1.0 - Production on Thu Nov 7 09:48:08 2013

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

DBVERIFY - Verification starting : FILE = /dev/rdata_03

DBV-00102: File I/O error on FILE (/dev/rdata_03) during verification read operation (-2)
同時在另一個視窗中查看
$ ps -ef | grep dbv                   
  oracle  598170  593980  38 09:57:42  pts/1  0:00 dbv file=/dev/rdata_03 blocksize=8192
  oracle 1712282  581750  0 09:57:46  pts/0  0:00 grep dbv
$ truss -faieo /tmp/strace.out -p 598170


598170: klseek(5, 746045440, 0, 0x0FFFFFFFFFFF9530)    = 0
...skipping...
598170: kread(5, " ( 0\011 ???D 5 ??.., 8192)    = 8192
598170: klseek(5, 1461190656, 0, 0x0FFFFFFFFFFF9530)    = 0
598170: kread(5, " ( 0\011 ???D 5 ??.., 8192)    Err#5  EIO
598170: kwrite(2, "\n D B V - 0 0 1 0 2 :  ", 12)      = 12
598170: kwrite(2, " F i l e  I / O  e r r".., 24)    = 24
598170: kwrite(2, " / d e v / r d a t a _ c".., 15)    = 15
598170: kwrite(2, " )  d u r i n g  ", 9)              = 9
598170: kwrite(2, " v e r i f i c a t i o n".., 17)    = 17
598170: kwrite(2, "  o p e r a t i o n  (", 12)      = 12
598170: kwrite(2, " -", 1)                              = 1
598170: kwrite(2, " 2", 1)                              = 1
598170: kwrite(2, " )", 1)                              = 1
598170: kwrite(2, "\n", 1)                              = 1
598170: close(5)                                        = 0
598170: close(4)                                        = 0
598170: kfcntl(1, F_GETFL, 0x00000000101A2087)          = 67110914
598170: kfcntl(2, F_GETFL, 0x00000000101A2087)          = 67110914
598170: _exit(1)
...skipping...
598170: kread(5, " ( 0\011 ???D 5 ??.., 8192)    = 8192
598170: klseek(5, 1461190656, 0, 0x0FFFFFFFFFFF9530)    = 0
598170: kread(5, " ( 0\011 ???D 5 ??.., 8192)    Err#5  EIO
598170: kwrite(2, "\n D B V - 0 0 1 0 2 :  ", 12)      = 12
598170: kwrite(2, " F i l e  I / O  e r r".., 24)    = 24
598170: kwrite(2, " / d e v / r d a t a _ c".., 15)    = 15
598170: kwrite(2, " )  d u r i n g  ", 9)              = 9
598170: kwrite(2, " v e r i f i c a t i o n".., 17)    = 17
598170: kwrite(2, "  o p e r a t i o n  (", 12)      = 12
598170: kwrite(2, " -", 1)                              = 1
598170: kwrite(2, " 2", 1)                              = 1
598170: kwrite(2, " )", 1)                              = 1
598170: kwrite(2, "\n", 1)                              = 1
598170: close(5)                                        = 0
598170: close(4)                                        = 0
598170: kfcntl(1, F_GETFL, 0x00000000101A2087)          = 67110914
598170: kfcntl(2, F_GETFL, 0x00000000101A2087)          = 67110914
598170: _exit(1)
找到開始的壞塊
1461190656/8192=178368
說明第一個壞塊為178368,驗證最後的壞塊,最大的資料區塊是1280000

$ dbv file=/dev/rdata_03 blocksize=8192 start=1461190656

DBVERIFY: Release 10.2.0.1.0 - Production on Thu Nov 7 10:10:58 2013

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


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

$ dbv file=/dev/rdata_03 blocksize=8192 start=194719

DBVERIFY: Release 10.2.0.1.0 - Production on Thu Nov 7 10:52:56 2013

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

DBVERIFY - Verification starting : FILE = /dev/rdata_03


DBVERIFY - Verification complete

Total Pages Examined        : 1085282
Total Pages Processed (Data) : 1272
Total Pages Failing  (Data) : 0
Total Pages Processed (Index): 127
Total Pages Failing  (Index): 0
Total Pages Processed (Other): 1082867
Total Pages Processed (Seg)  : 0
Total Pages Failing  (Seg)  : 0
Total Pages Empty            : 1016
Total Pages Marked Corrupt  : 0
Total Pages Influx          : 0
Highest block SCN            : 1845997064 (2919.1845997064)

採用資料拼接的模式重構這個資料檔案

$ dd if=/dev/zero of=/backup_dir/rdata_03_02 bs=8192 count=16343
16343+0 records in.
16343+0 records out.
$ dd if=/dev/rdata_03 of=/backup_dir/rdata_03_03 bs=8192 skip=194710
1116010+0 records in.
1116010+0 records out.
$ dd if=/dev/rdata_03 of=/backup_dir/rdata_03_01 bs=8192 count=178367
178367+0 records in.
178367+0 records out.
$ cat /backup_dir/rdata_03_01 /backup_dir/rdata_03_02 /backup_dir/rdata_03_03 > /backup_dir/rdata_03_ct

更多詳情見請繼續閱讀下一頁的精彩內容:

SPFILE 錯誤導致資料庫無法啟動(ORA-01565)

ORA-01172、ORA-01151錯誤處理

ORA-00600 [2662]錯誤解決

ORA-01078 和 LRM-00109 報錯解決方案

ORA-00471 處理方法筆記

ORA-00314,redolog 損壞,或丟失處理方法

ORA-00257 歸檔日誌過大導致無法儲存的解決辦法

  • 1
  • 2
  • 3
  • 下一頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.