今天早上收郵件,看到師父發的rman恢複失敗的郵件。
內容如下:
資料都已經解壓完畢。 在/orabak/oracle_bak 下
但恢複時讀取備份片總是報錯
channel dev1: reading from backup piece/orabak/oracle_bak/fullrac_EPTDB_820_1_20130802
ORA-19870: error reading backup piece/orabak/oracle_bak/fullrac_EPTDB_821_1_20130802
ORA-19587: error occurred reading 0 bytesat block number 1
ORA-27091: unable to queue I/O
ORA-27067: size of I/O buffer is invalid
Additional information: 2
ORA-19870: error reading backup piece/orabak/oracle_bak/fullrac_EPTDB_820_1_20130802
ORA-19587: error occurred reading 0 bytesat block number 1
ORA-27091: unable to queue I/O
ORA-27067: size of I/O buffer is invalid
Additional information: 2
系統日誌中也可以看到
Fri Aug 9 00:30:04 2013
Corrupt block 1 found during reading backuppiece, file=/orabak/oracle_bak/fullrac_EPTDB_820_1_20130802, corr_type=1
Fri Aug 9 00:30:41 2013
Corrupt block 1 found during reading backuppiece, file=/orabak/oracle_bak/fullrac_EPTDB_819_1_20130802, corr_type=1
Fri Aug 9 00:30:41 2013
確認傳輸過程中沒有問題。
似乎在這台機器上,RMAN沒有辦法正確讀取備份片。。。
暈了。
我第一反應是備份組的問題,於是去備份目錄下看了下。
-r--r--r-- 1 oracle oinstall 20611072 Aug 08 16:41 ctl_EPTDB_824_1_20130802
-r--r--r-- 1 oracle oinstall 21474836480 Aug 08 16:42 fullrac_EPTDB_818_1_20130802
-r--r--r-- 1 oracle oinstall 21474836480 Aug 08 16:45 fullrac_EPTDB_818_2_20130802
--都是唯讀許可權,我覺得有問題,可想了下,rman備份是讀取備份組,不用寫應該不造成什麼影響吧,但想是這麼想,總覺得怪怪的。
於是查了下MOS,果然是許可權的問題:
APPLIES TO:
Oracle Database - Enterprise Edition - Version 10.2.0.1 to 10.2.0.4 [Release 10.2]
Oracle Database - Enterprise Edition - Version 10.1.0.2 to 10.2.0.1 [Release 10.1 to 10.2]
Information in this document applies to any platform.
***Checked for relevance on 06-May-2013***
SYMPTOMS
RMAN restore of read only backuppieces fails as follows:
.
ORA-19870: error reading backup piece
/bugmnt/am/ceaixcb5/tar5619852.992/app/oracle/oradata/TARCS/bkup_03hp58dk_1_1
ORA-19587: error occurred reading 0 bytes at block number 1
ORA-27091: unable to queue I/O
ORA-27067: size of I/O buffer is invalid
Additional information: 2
failover to previous backup
.
RMAN-571: ===========================================================
RMAN-569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-571: ===========================================================
RMAN-3002: failure of restore command at 07/26/2006 13:13:17
RMAN-6026: some targets not found - aborting restore
RMAN-6023: no backup or copy of datafile 4 found to restoreCAUSE
The backuppiece is in read only status at the operating system level.
SOLUTION
Make the RMAN backuppiece not only readable but also writable. See Bug 5412531 for
other details.
--確實需要寫的許可權!
REFERENCES
BUG:5412531 - RMAN FAILS RESTORING READONLY BACKUPS: ORA-19870 ORA-19587
ORA-27091 ORA-27067
解決:賦予寫的許可權即可。
經過修改許可權後,進行驗證就不會報錯了。
cd/orabak/oracle_bak
chmod775 *20130802
RMAN>restore controlfile validate;
Startingrestore at 09-AUG-13
usingchannel ORA_DISK_1
channelORA_DISK_1: starting validation of datafile backupset
channelORA_DISK_1: reading from backup piece/orabak/oracle_bak/ctl_EPTDB_824_1_20130802
channelORA_DISK_1: restored backup piece 1
piecehandle=/orabak/oracle_bak/ctl_EPTDB_824_1_20130802 tag=TAG20130802T210600
channelORA_DISK_1: validation complete, elapsed time: 00:00:02
Finishedrestore at 09-AUG-13
之後的恢複也沒有問題。
注意:中間恢複失敗,或者手工停止後,要將rman相關進程殺乾淨再重新恢複,否則後面會有問題。說不定在第二次恢複過程中,第一次的進程才停止,然後把相關檔案刪除,其實刪除的是第二次才恢複的檔案(因為檔案名稱相同)。