【oracle】ORA-01580 error creating control backup file-阿里云开发者社区

开发者社区> 数据库> 正文
登录阅读全文

【oracle】ORA-01580 error creating control backup file

简介:
早上查看报警邮件的时候发现了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.

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

分享: