【oracle】ORA-01580 error creating control backup file

楊奇龍發表於2011-08-22
早上檢視報警郵件的時候發現了ORA-01580 error creating control backup file。
通常次錯誤與RMAN 備份控制檔案的策略有關:
比如:
RMAN> backup current controlfile;
Starting backup at 22-AUG-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 08/22/2011 20:05:42
ORA-01580: error creating control backup file /opt/oracle/10.2.0/orcl/dbs
ORA-27056: could not delete file
Linux-x86_64 Error: 21: Is a directory

檢視控制檔案的配置資訊:
RMAN> show all;
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
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 '/opt/oracle/10.2.0/orcl/dbs';
一般snapshot的format應該是一個絕對檔案路徑,而上面的配置則是一個資料夾目錄。修改之後:
RMAN> configure snapshot controlfile name to '/opt/oracle/10.2.0/orcl/dbs/snapcf_orcl.f';

snapshot control file name set to: /opt/oracle/10.2.0/orcl/dbs/snapcf_orcl.f
new RMAN configuration parameters are successfully stored

RMAN> backup current controlfile;

Starting backup at 22-AUG-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
channel ORA_DISK_1: starting piece 1 at 22-AUG-11
channel ORA_DISK_1: finished piece 1 at 22-AUG-11
piece handle=/opt/oracle/flash_recovery_area/ORCL/backupset/2011_08_22/o1_mf_ncnnf_TAG20110822T200628_754kl4of_.bkp tag=TAG20110822T200628 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 22-AUG-11
成功備份!
另外檢視ML上面的資訊:次錯誤還和資料庫的一個和IO相關的引數有關:FILESYSTEMIO_OPTIONS
[oracle@bblsdb bb70]$ rman target / 
Recovery Manager: Release 10.2.0.3.0 - Production on Fri Sep 5 13:44:02 2008 
Copyright (c) 1982, 2005, Oracle. All rights reserved. 
connected to target database: BB70 (DBID=2591586355) 
RMAN> backup current controlfile; 
Starting backup at 05-SEP-08 
using target database control file instead of recovery catalog 
allocated channel: ORA_DISK_1 
channel ORA_DISK_1: sid=499 devtype=DISK 
channel ORA_DISK_1: starting compressed full datafile backupset 
channel ORA_DISK_1: specifying datafile(s) in backupset 
RMAN-00571: =========================================================== 
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== 
RMAN-00571: =========================================================== 
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 09/05/2008 13:44:12 
ORA-01580: error creating control backup file /usr/local/oracle/ora10gR2/dbs/snapcf_bb70.f 
ORA-27044: unable to write the header block of file 
Linux Error: 22: Invalid argument 
Additional information: 7
原因:FILESYSTEMIO_OPTIONS引數在當前的OS系統中沒有設定為正確的方式。一般情況下 此引數被設定為filesystemio_options=SETALL
解決辦法:設定為預設的引數,然後備份控制檔案。
然而在我的測試環境下並沒有重現次錯誤:
SQL> show parameter filesystemio_options

NAME                  TYPE    VALUE
--------------------  --------  -----
filesystemio_options string   none

SQL> alter system set filesystemio_options=setall scope=spfile;
System altered.

--重啟資料庫,然後備份控制檔案:
RMAN> backup current controlfile;
Starting backup at 22-AUG-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=143 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
channel ORA_DISK_1: starting piece 1 at 22-AUG-11
channel ORA_DISK_1: finished piece 1 at 22-AUG-11
piece handle=/opt/oracle/flash_recovery_area/ORCL/backupset/2011_08_22/o1_mf_ncnnf_TAG20110822T200205_754k9xyp_.bkp tag=TAG20110822T200205 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 22-AUG-11
至此,並沒有像ml上所說,會報錯。
附上 FILESYSTEMIO_OPTIONS 引數的介紹:
透過FILESYSTEMIO_OPTIONS可以開啟或者禁止檔案系統上的非同步IO功能!FILESYSTEMIO_OPTIONS的值如下:
asynch:    啟用非同步I/O
directio:  啟用同步I/O
setall:    同時啟用非同步和同步I/O
none:      禁用非同步和同步I/O
這個引數依賴於oracle所在的平臺並且它有一個預設引數,此時它是最適合這個平臺的。
在oracle資料庫中可以動態修改該值,設定是必須指定spfile,否則報錯!
SQL> alter system set filesystemio_options=setall scope=memory;
alter system set filesystemio_options=setall scope=memory
                 *
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified
SQL> alter system set filesystemio_options=setall scope=spfile;
System altered.

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

相關文章