早上查看报警邮件的时候发现了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/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22664653/viewspace-705574/