從磁帶恢復歸檔出現ORA-19870錯誤

yangtingkun發表於2011-09-12

從磁帶中直接恢復歸檔日誌時,出現了這個錯誤資訊。

 

 

歸檔日誌前後備份了兩次,一次是在備份資料庫後做的,另一次是凌晨7點左右進行的,其中第二次備份包含的歸檔日誌比第一次多,最近的歸檔日誌檔案備份資訊如下:

BS Key  Size       Device Type Elapsed Time Completion Time   
------- ---------- ----------- ------------ -------------------
37761   3.18G      SBT_TAPE    00:01:22     2011-08-27 03:22:37
        BP Key: 37761   Status: AVAILABLE  Compressed: NO  Tag: TAG20110827T032114
        Handle: al_43199_1_760245675   Media:

  List of Archived Logs in backup set 37761
  Thrd Seq     Low SCN    Low Time            Next SCN   Next Time
  ---- ------- ---------- ------------------- ---------- ---------
  1    132214  10200825285755 2011-08-27 00:35:39 10200825450980 2011-08-27 00:40:04 
  1    132215  10200825450980 2011-08-27 00:40:04 10200825451525 2011-08-27 00:40:06
  1    132216  10200825451525 2011-08-27 00:40:06 10200826640012 2011-08-27 01:05:42
  1    132217  10200826640012 2011-08-27 01:05:42 10200828085370 2011-08-27 02:08:11
  1    132218  10200828085370 2011-08-27 02:08:11 10200831622590 2011-08-27 03:05:09
  1    132219  10200831622590 2011-08-27 03:05:09 10200831803462 2011-08-27 03:21:02
  1    132220  10200831803462 2011-08-27 03:21:02 10200831803603 2011-08-27 03:21:12

BS Key  Size       Device Type Elapsed Time Completion Time   
------- ---------- ----------- ------------ -------------------
37763   4.22G      SBT_TAPE    00:06:40     2011-08-27 07:12:26
        BP Key: 37763   Status: AVAILABLE  Compressed: NO  Tag: TAG20110827T070545
        Handle: al_43201_1_760259146   Media:

  List of Archived Logs in backup set 37763
  Thrd Seq     Low SCN    Low Time            Next SCN   Next Time
  ---- ------- ---------- ------------------- ---------- ---------
  1    132214  10200825285755 2011-08-27 00:35:39 10200825450980 2011-08-27 00:40:04
  1    132215  10200825450980 2011-08-27 00:40:04 10200825451525 2011-08-27 00:40:06
  1    132216  10200825451525 2011-08-27 00:40:06 10200826640012 2011-08-27 01:05:42
  1    132217  10200826640012 2011-08-27 01:05:42 10200828085370 2011-08-27 02:08:11
  1    132218  10200828085370 2011-08-27 02:08:11 10200831622590 2011-08-27 03:05:09
  1    132219  10200831622590 2011-08-27 03:05:09 10200831803462 2011-08-27 03:21:02
  1    132220  10200831803462 2011-08-27 03:21:02 10200831803603 2011-08-27 03:21:12
  1    132221  10200831803603 2011-08-27 03:21:12 10200839298501 2011-08-27 05:59:17
  1    132222  10200839298501 2011-08-27 05:59:17 10200851993798 2011-08-27 07:05:40
  1    132223  10200851993798 2011-08-27 07:05:40 10200851993847 2011-08-27 07:05:44

而且這兩個備份並不在同一個磁帶中,前面的一份歸檔備份和全庫備份同處於一個磁帶中,因此在恢復的過程中,直接將這盤磁帶取出,在另一臺伺服器上進行恢復。

全庫的還原沒有碰到問題,但是恢復歸檔日誌則碰到了下面的錯誤:

RMAN> run
2> {
3>         ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
4>         SEND 'NB_ORA_SERV=nbusrv, NB_ORA_CLIENT=ccicdbsrv5';
5>         restore archivelog from sequence 132214  until sequence 132220;
6>         RELEASE CHANNEL ch00;
7> }

allocated channel: ch00
channel ch00: sid=1630 devtype=SBT_TAPE
channel ch00: Veritas NetBackup for Oracle - Release 6.5 (2007072323)

sent command to channel: ch00

Starting restore at 2011-09-11 21:03:48

channel ch00: starting archive log restore to default destination
channel ch00: restoring archive log
archive log thread=1 sequence=132214
channel ch00: restoring archive log
archive log thread=1 sequence=132215
channel ch00: restoring archive log
archive log thread=1 sequence=132216
channel ch00: restoring archive log
archive log thread=1 sequence=132217
channel ch00: restoring archive log
archive log thread=1 sequence=132218
channel ch00: restoring archive log
archive log thread=1 sequence=132219
channel ch00: restoring archive log
archive log thread=1 sequence=132220
channel ch00: reading from backup piece al_43201_1_760259146
ORA-19870: error reading backup piece al_43201_1_760259146
ORA-19507: failed to retrieve sequential file, handle="al_43201_1_760259146", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
   Failed to open backup file for restore.
failover to previous backup

channel ch00: starting archive log restore to default destination
channel ch00: restoring archive log
archive log thread=1 sequence=132214
channel ch00: restoring archive log
archive log thread=1 sequence=132215
channel ch00: restoring archive log
archive log thread=1 sequence=132216
channel ch00: restoring archive log
archive log thread=1 sequence=132217
channel ch00: restoring archive log
archive log thread=1 sequence=132218
channel ch00: restoring archive log
archive log thread=1 sequence=132219
channel ch00: restoring archive log
archive log thread=1 sequence=132220
channel ch00: reading from backup piece al_43199_1_760245675
ORA-19870: error reading backup piece al_43199_1_760245675
ORA-19507: failed to retrieve sequential file, handle="al_43199_1_760245675", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
   Failed to process backup file
failover to previous backup

released channel: ch00
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 09/11/2011 21:04:30
RMAN-06026: some targets not found - aborting restore
RMAN-06025: no backup of log thread 1 seq 132220 lowscn 10200831803462 found to restore
RMAN-06025: no backup of log thread 1 seq 132219 lowscn 10200831622590 found to restore
RMAN-06025: no backup of log thread 1 seq 132218 lowscn 10200828085370 found to restore
RMAN-06025: no backup of log thread 1 seq 132217 lowscn 10200826640012 found to restore
RMAN-06025: no backup of log thread 1 seq 132216 lowscn 10200825451525 found to restore
RMAN-06025: no backup of log thread 1 seq 132215 lowscn 10200825450980 found to restore
RMAN-06025: no backup of log thread 1 seq 132214 lowscn 10200825285755 found to restore

由於要恢復的歸檔日誌在兩個備份集中存在,因此RMAN嘗試了兩次進行恢復。第一次尋找al_43201_1_760259146檔案,由於這個檔案不在當前的磁帶中,恢復失敗是正常的,但是al_43199_1_760245675檔案就存放在當前的磁帶中,而仍然出現無法獲取檔案的錯誤就不正常了。

考慮到恢復環境和備份環境並不一致,備份時使用的帶庫而當前僅包含一個磁帶,且磁帶的catalog資訊很可能也沒有匯入,因此對於源資料的查詢可能存在問題。

透過CHANGE BACKUP TAG ‘TAG20110827T070545’ UNAVAILABLE的方式,避免恢復過程中去尋找目前並不存在的備份。再次使用RMAN執行同樣的恢復操作,這次恢復成功。

恢復應該在和備份等同條件下進行,否則至少應該保證帶庫的CATALOG資料匯入,否則就可能出現這種跨磁帶查詢檔案時出現的錯誤,而利用RMAN直接在當前的磁帶中掃描檔案則不受影響。

 

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/4227/viewspace-707217/,如需轉載,請註明出處,否則將追究法律責任。

相關文章