RMAN备份时报“ORA-19504: failed to create file”和“ORA-27038: created file already exists”
2015-08-11 21:30 abce 阅读(8623) 评论(0) 编辑 收藏 举报RMAN> run { 2> allocate channel ch00 type disk; 3> backup format '/dbbackup/db_%T' database; 4> release channel ch00; 5> }
报出以下错误:
released channel: ch00 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03009: failure of backup command on ch00 channel at 08/11/2015 17:32:39 ORA-19504: failed to create file "/dbbackup/db_20150811" ORA-27038: created file already exists Additional information: 1 RMAN>
原因是控制文件和参数文件需要单独生成一个备份集,不能和数据库共用一个备份集,而在给数据文件指定备份集时又只指定一个单一的文件名,所以报了个文件已经存在的错误。 解决方法是在format里加一个%U,这样就会自动生成不同又唯一的文件名了。
控制文件之所以不能和数据文件共存于一个备份集是因为二者的block size不一样,参看ref2有一段话。
Note: If the control file block size is not equal to the block size for data file 1, then the control file cannot be written into the same backup set as the data file. RMAN writes the control file into a backup set by itself if the block size is different. The V$CONTROLFILE.BLOCK_SIZE column indicates the control file block size, whereas the DB_BLOCK_SIZE initialization parameter indicates the block size of data file 1.
SQL> select name,block_size from v$controlfile; NAME BLOCK_SIZE ------------------------------------------------------------ ---------- /u01/app/oracle/oradata/dbt/control01.ctl 16384 /u01/app/oracle/oradata/dbt/control02.ctl 16384 SQL> show parameter db_block_size NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_block_size integer 8192 SQL>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· .NET10 - 预览版1新功能体验(一)