关于ORA-19504 ORA-27038 OSD-04010

今天在做rman backup练习的时候,遇到了问题哦.

 

RMAN>  run {
2>  allocate channel dev1 type disk;
3> backup
4> format '/tmp/rmanbak/bak'
5> database;
6> release channel dev1;
7> }

 

因为对rman确实不熟,照着做,结果错误就出来了:

 

ORA-19504: 无法创建文件"C:\TMP\RMANBAK\BAK"

ORA-27038: 所创建的文件已存在

OSD-04010: 指定了<create>选项,但文件已经存在

 

google了很多, 总感觉没有能既知其然,又知其所以然的方案.

弄了好久终于解决, 分享如下:

 

确保几个因素: 

 

1. 文件大小限制

RMAN> show all

列出了许多配置参数如下:


CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS;
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; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 100 M;
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\ORACLE\ORA92\DATABASE\SNCFOSS.ORA'; # default

 

注意大小限制, 因为如果大小有限制, 其需要再创建第2,3...个备份文件,但名字却是和
第1个一样,而这个时候文件名不能唯一,肯定出错了。如果大小没有限制,应该不会有问题, 有限制则要注意名称唯一性问题了.

 

2.  名称唯一性, 如果名称不唯一, 要写多个文件的时候当然过不去.

下面的是metalink上的Doc ID: 1082911.6的描述:

 

Solution Description:

=====================

Insert a %U into the format portion of the backup script in order to ensure a unique backup file name.

Problem Explanation:

====================

These errors occur because a backup file name already exists by the name specified in you backup script. For instance, if you are using the line “allocate channel c1 type disk format

‘/oracle/database/rman/backup/df_%d_%p_%c’;”, df_%d_%p_%c formats the backupstring like so;

df_ is simply a name. This could be any set of characters. In this case it means

database full.

%d_ is the database sid.

%p_is the backup piece number within the backup set.

%c_ specifies the copy number of the backup piece within a set of duplexed backup pieces.

There needs to be a %U added to the format string.

%U_ specifies a convenient shorthand that guarantees uniqueness in generated backup filenames. So, if the string were “db_%d_%U_%p_%c a unique name would be generated and it would not be necessary to either rename or move the backup file name prior to the next backup.

If the format is changed to include the %U, for instance;

allocate channel c1 type disk format ‘/oracle/database/rman/backup/df_%d_%U_%p_%c’;

The backup file will automatically have a unique name generated like;

df_JTG_0eblfm65_1_1_1_1

The next one would look like;

df_JTG_0fblfm76_1_1_1_1

 

所以只要保证格式中有能唯一区别的格式符即可,像%U, %t,%p 当然组合使用更好.

 

 

 

3. 访问权限限制, 确保对写的文件夹,有写的权限.

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值