RMAN並行度衝突

lurou發表於2012-04-06

概述:

今天同事在做一個rman備份實驗的時候,遇到一個並行度設定的問題,找到我,我看了下比較簡單,解決得比較快。

[@more@]

解決過程:

相關平臺資訊:

os: su se linux11

db: 10.2.0.4

rman catalog mode

報錯內容如下:

allocated channel: c1
channel c1: sid=637 devtype=DISK

allocated channel: c2
channel c2: sid=633 devtype=DISK

Starting backup at 06-APR-12
using channel ORA_DISK_1
using channel ORA_DISK_2

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 04/06/2012 10:56:31
ORA-01013: user requested cancel of current operation
continuing other job steps, job failed will not be re-run
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_2 channel at 04/06/2012 10:56:31
ORA-01013: user requested cancel of current operation

看到這個資訊,我馬上注意到上面帶先劃線的部分,懷疑是並行度混亂。

接下來我看了下rman的預設引數:

RMAN> show all;

RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 8;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/oracle/rmanbkup/controlautobkup%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/product/10.2/db_1/dbs/snapcf_oratest.f'; # default

注意到上面下劃線部分表明這裡的通道並行度的設定數為 2;

再找來他的備份指令碼看,發現其中的部分內容如下,下劃線部分也設定了通道的並行度分配數目,也為2:
RMAN> RUN {
2> allocate channel c1 type disk;
3> allocate channel c2 type disk;

4>
5> BACKUP FORMAT '/oracle/rmanbkup/orcl_%U_%T' skip inaccessible filesperset 5 DATABASE TAG orcl_hot_db_bk;
6>
7> sql 'alter system archive log current';
8>
9> BACKUP FORMAT '/oracle/rmanbkup/arch_%U_%T' skip inaccessible filesperset 5 ARCHIVELOG ALL DELETE INPUT;
10>
11> backup current controlfile tag='bak_ctlfile' format='/oracle/rmanbkup/ctl_file_%U_%T';
12>
13> backup spfile tag='spfile' format='/oracle/rmanbkup/ORCL_spfile_%U_%T';
14>
15> release channel c2;
16> release channel c1;
17> }

於是,讓他取消其中任意一個並行度設定,再做實驗就沒問題了。

總結:

問題的起因應該是指令碼分配的通道和rman預設分配的通道在備份的時候產生了資源爭搶,具體地說應該是在一開始input datafile的時候就有了檔案爭搶,都想做input datafile的操作,誰也做不了。

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

相關文章