RMAN备份时报“ORA-19504: failed to create file”和“ORA-27038: created file already exists”的一种情况和解决办法
来源:互联网 发布:安卓小众软件 编辑:程序博客网 时间:2024/06/05 15:59
版本:
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE11.2.0.1.0Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL>
在RMAN中使用如下两条命令备份时,
backup database include current controlfile format '/u01/rmanbkp/full01' tag 'fullbk01';
backup database format '/u01/rmanbkp/full01' tag 'fullbk01';
均会出现如下错误:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 06/02/2013 19:16:44
ORA-19504: failed to create file "/u01/rmanbkp/full01"
ORA-27038: created file already exists
Additional information: 1
原因是控制文件和参数文件需要单独生成一个备份集,不能和数据库共用一个备份集,而在给数据文件指定备份集时又只指定一个单一的文件名,所以报了个文件已经存在的错误,解决方法是在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/oracle/oradata/ora11g/control01.ctl 16384
/u01/oracle/flash_recovery_area/ora11g/control02.ctl 16384
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_block_size integer 8192
SQL>
测试:
RMAN> backup database include current controlfile format '/u01/rmanbkp/full01' tag 'fullbk01' plus archivelog format '/u01/rmanbkp/arch01' tag 'fullbk01';
Starting backup at 02-JUN-13
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=44 RECID=1 STAMP=817054481
input archived log thread=1 sequence=45 RECID=2 STAMP=817054522
input archived log thread=1 sequence=46 RECID=3 STAMP=817054526
input archived log thread=1 sequence=47 RECID=4 STAMP=817054712
input archived log thread=1 sequence=48 RECID=5 STAMP=817061936
input archived log thread=1 sequence=49 RECID=6 STAMP=817065148
input archived log thread=1 sequence=50 RECID=7 STAMP=817065192
input archived log thread=1 sequence=51 RECID=8 STAMP=817066777
input archived log thread=1 sequence=52 RECID=9 STAMP=817066795
input archived log thread=1 sequence=53 RECID=10 STAMP=817066905
input archived log thread=1 sequence=54 RECID=11 STAMP=817066934
input archived log thread=1 sequence=55 RECID=12 STAMP=817067207
input archived log thread=1 sequence=56 RECID=13 STAMP=817067228
input archived log thread=1 sequence=57 RECID=14 STAMP=817067257
input archived log thread=1 sequence=58 RECID=15 STAMP=817067276
input archived log thread=1 sequence=59 RECID=16 STAMP=817067373
channel ORA_DISK_1: starting piece 1 at 02-JUN-13
channel ORA_DISK_1: finished piece 1 at 02-JUN-13
piece handle=/u01/rmanbkp/arch01 tag=FULLBK01 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 02-JUN-13
Starting backup at 02-JUN-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/oracle/oradata/ora11g/system01.dbf
input datafile file number=00002 name=/u01/oracle/oradata/ora11g/sysaux01.dbf
input datafile file number=00003 name=/u01/oracle/oradata/ora11g/undotbs01.dbf
input datafile file number=00005 name=/u01/oracle/oradata/ora11g/ts1.dbf
input datafile file number=00006 name=/u01/oracle/oradata/ora11g/ts2.dbf
input datafile file number=00007 name=/u01/oracle/oradata/ora11g/ts3.dbf
input datafile file number=00008 name=/u01/oracle/oradata/ora11g/ts4.dbf
input datafile file number=00004 name=/u01/oracle/oradata/ora11g/users01.dbf
channel ORA_DISK_1: starting piece 1 at 02-JUN-13
channel ORA_DISK_1: finished piece 1 at 02-JUN-13
piece handle=/u01/rmanbkp/full01 tag=FULLBK01 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 02-JUN-13
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup plus archivelog command at 06/02/2013 19:09:52
ORA-19504: failed to create file "/u01/rmanbkp/full01"
ORA-27038: created file already exists
Additional information: 1
RMAN> list backup;
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
25 24.60M DISK 00:00:01 02-JUN-13
BP Key: 25 Status: AVAILABLE Compressed: NO Tag: FULLBK01
Piece Name: /u01/rmanbkp/arch01
List of Archived Logs in backup set 25
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 44 1628668 02-JUN-13 1637132 02-JUN-13
1 45 1637132 02-JUN-13 1637150 02-JUN-13
1 46 1637150 02-JUN-13 1637154 02-JUN-13
1 47 1637154 02-JUN-13 1637223 02-JUN-13
1 48 1637223 02-JUN-13 1641689 02-JUN-13
1 49 1641689 02-JUN-13 1643658 02-JUN-13
1 50 1643658 02-JUN-13 1643685 02-JUN-13
1 51 1643685 02-JUN-13 1644335 02-JUN-13
1 52 1644335 02-JUN-13 1644352 02-JUN-13
1 53 1644352 02-JUN-13 1644493 02-JUN-13
1 54 1644493 02-JUN-13 1644513 02-JUN-13
1 55 1644513 02-JUN-13 1644664 02-JUN-13
1 56 1644664 02-JUN-13 1644681 02-JUN-13
1 57 1644681 02-JUN-13 1644718 02-JUN-13
1 58 1644718 02-JUN-13 1644737 02-JUN-13
1 59 1644737 02-JUN-13 1644818 02-JUN-13
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
26 Full 1.00G DISK 00:00:09 02-JUN-13
BP Key: 26 Status: AVAILABLE Compressed: NO Tag: FULLBK01
Piece Name: /u01/rmanbkp/full01
List of Datafiles in backup set 26
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 1644824 02-JUN-13 /u01/oracle/oradata/ora11g/system01.dbf
2 Full 1644824 02-JUN-13 /u01/oracle/oradata/ora11g/sysaux01.dbf
3 Full 1644824 02-JUN-13 /u01/oracle/oradata/ora11g/undotbs01.dbf
4 Full 1644824 02-JUN-13 /u01/oracle/oradata/ora11g/users01.dbf
5 Full 1644824 02-JUN-13 /u01/oracle/oradata/ora11g/ts1.dbf
6 Full 1644824 02-JUN-13 /u01/oracle/oradata/ora11g/ts2.dbf
7 Full 1644824 02-JUN-13 /u01/oracle/oradata/ora11g/ts3.dbf
8 Full 1644824 02-JUN-13 /u01/oracle/oradata/ora11g/ts4.dbf
(从上面可以看到控制文件、参数文件和收尾的归档日志都没备份,注意和接下来备份成功的情况比较一下)
RMAN> delete noprompt backup;
using channel ORA_DISK_1
List of Backup Pieces
BP Key BS Key Pc# Cp# Status Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
25 25 1 1 AVAILABLE DISK /u01/rmanbkp/arch01
26 26 1 1 AVAILABLE DISK /u01/rmanbkp/full01
deleted backup piece
backup piece handle=/u01/rmanbkp/arch01 RECID=25 STAMP=817067373
deleted backup piece
backup piece handle=/u01/rmanbkp/full01 RECID=26 STAMP=817067375
Deleted 2 objects
RMAN> list backup;
specification does not match any backup in the repository
RMAN> backup database include current controlfile format '/u01/rmanbkp/full01_%U' tag 'fullbk01' plus archivelog format '/u01/rmanbkp/arch01_%U' tag 'fullbk01';
Starting backup at 02-JUN-13
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=44 RECID=1 STAMP=817054481
input archived log thread=1 sequence=45 RECID=2 STAMP=817054522
input archived log thread=1 sequence=46 RECID=3 STAMP=817054526
input archived log thread=1 sequence=47 RECID=4 STAMP=817054712
input archived log thread=1 sequence=48 RECID=5 STAMP=817061936
input archived log thread=1 sequence=49 RECID=6 STAMP=817065148
input archived log thread=1 sequence=50 RECID=7 STAMP=817065192
input archived log thread=1 sequence=51 RECID=8 STAMP=817066777
input archived log thread=1 sequence=52 RECID=9 STAMP=817066795
input archived log thread=1 sequence=53 RECID=10 STAMP=817066905
input archived log thread=1 sequence=54 RECID=11 STAMP=817066934
input archived log thread=1 sequence=55 RECID=12 STAMP=817067207
input archived log thread=1 sequence=56 RECID=13 STAMP=817067228
input archived log thread=1 sequence=57 RECID=14 STAMP=817067257
input archived log thread=1 sequence=58 RECID=15 STAMP=817067276
input archived log thread=1 sequence=59 RECID=16 STAMP=817067373
input archived log thread=1 sequence=60 RECID=17 STAMP=817067522
channel ORA_DISK_1: starting piece 1 at 02-JUN-13
channel ORA_DISK_1: finished piece 1 at 02-JUN-13
piece handle=/u01/rmanbkp/arch01_14ob6tg2_1_1 tag=FULLBK01 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 02-JUN-13
Starting backup at 02-JUN-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/oracle/oradata/ora11g/system01.dbf
input datafile file number=00002 name=/u01/oracle/oradata/ora11g/sysaux01.dbf
input datafile file number=00003 name=/u01/oracle/oradata/ora11g/undotbs01.dbf
input datafile file number=00005 name=/u01/oracle/oradata/ora11g/ts1.dbf
input datafile file number=00006 name=/u01/oracle/oradata/ora11g/ts2.dbf
input datafile file number=00007 name=/u01/oracle/oradata/ora11g/ts3.dbf
input datafile file number=00008 name=/u01/oracle/oradata/ora11g/ts4.dbf
input datafile file number=00004 name=/u01/oracle/oradata/ora11g/users01.dbf
channel ORA_DISK_1: starting piece 1 at 02-JUN-13
channel ORA_DISK_1: finished piece 1 at 02-JUN-13
piece handle=/u01/rmanbkp/full01_15ob6tg3_1_1 tag=FULLBK01 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 02-JUN-13
channel ORA_DISK_1: finished piece 1 at 02-JUN-13
piece handle=/u01/rmanbkp/full01_16ob6tgi_1_1 tag=FULLBK01 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 02-JUN-13
Starting backup at 02-JUN-13
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=61 RECID=18 STAMP=817067540
channel ORA_DISK_1: starting piece 1 at 02-JUN-13
channel ORA_DISK_1: finished piece 1 at 02-JUN-13
piece handle=/u01/rmanbkp/arch01_17ob6tgk_1_1 tag=FULLBK01 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 02-JUN-13
RMAN> list backup tag fullbk01;
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
27 24.85M DISK 00:00:00 02-JUN-13
BP Key: 27 Status: AVAILABLE Compressed: NO Tag: FULLBK01
Piece Name: /u01/rmanbkp/arch01_14ob6tg2_1_1
List of Archived Logs in backup set 27
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 44 1628668 02-JUN-13 1637132 02-JUN-13
1 45 1637132 02-JUN-13 1637150 02-JUN-13
1 46 1637150 02-JUN-13 1637154 02-JUN-13
1 47 1637154 02-JUN-13 1637223 02-JUN-13
1 48 1637223 02-JUN-13 1641689 02-JUN-13
1 49 1641689 02-JUN-13 1643658 02-JUN-13
1 50 1643658 02-JUN-13 1643685 02-JUN-13
1 51 1643685 02-JUN-13 1644335 02-JUN-13
1 52 1644335 02-JUN-13 1644352 02-JUN-13
1 53 1644352 02-JUN-13 1644493 02-JUN-13
1 54 1644493 02-JUN-13 1644513 02-JUN-13
1 55 1644513 02-JUN-13 1644664 02-JUN-13
1 56 1644664 02-JUN-13 1644681 02-JUN-13
1 57 1644681 02-JUN-13 1644718 02-JUN-13
1 58 1644718 02-JUN-13 1644737 02-JUN-13
1 59 1644737 02-JUN-13 1644818 02-JUN-13
1 60 1644818 02-JUN-13 1645261 02-JUN-13
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
28 Full 1.00G DISK 00:00:08 02-JUN-13
BP Key: 28 Status: AVAILABLE Compressed: NO Tag: FULLBK01
Piece Name: /u01/rmanbkp/full01_15ob6tg3_1_1
List of Datafiles in backup set 28
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 1645267 02-JUN-13 /u01/oracle/oradata/ora11g/system01.dbf
2 Full 1645267 02-JUN-13 /u01/oracle/oradata/ora11g/sysaux01.dbf
3 Full 1645267 02-JUN-13 /u01/oracle/oradata/ora11g/undotbs01.dbf
4 Full 1645267 02-JUN-13 /u01/oracle/oradata/ora11g/users01.dbf
5 Full 1645267 02-JUN-13 /u01/oracle/oradata/ora11g/ts1.dbf
6 Full 1645267 02-JUN-13 /u01/oracle/oradata/ora11g/ts2.dbf
7 Full 1645267 02-JUN-13 /u01/oracle/oradata/ora11g/ts3.dbf
8 Full 1645267 02-JUN-13 /u01/oracle/oradata/ora11g/ts4.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
29 Full 9.36M DISK 00:00:01 02-JUN-13
BP Key: 29 Status: AVAILABLE Compressed: NO Tag: FULLBK01
Piece Name: /u01/rmanbkp/full01_16ob6tgi_1_1
SPFILE Included: Modification time: 02-JUN-13
SPFILE db_unique_name: ORA11G
Control File Included: Ckp SCN: 1645271 Ckp time: 02-JUN-13
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
30 3.00K DISK 00:00:00 02-JUN-13
BP Key: 30 Status: AVAILABLE Compressed: NO Tag: FULLBK01
Piece Name: /u01/rmanbkp/arch01_17ob6tgk_1_1
List of Archived Logs in backup set 30
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 61 1645261 02-JUN-13 1645277 02-JUN-13
RMAN>
1. Specifying a Format for RMAN Backups
http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmbckba.htm#CEGBCICH
2. Backing Up Control Files with RMAN
http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmbckba.htm#i1009642
3. RMAN配置参数解释
http://www.itpub.net/thread-1586529-1-1.html
- RMAN备份时报“ORA-19504: failed to create file”和“ORA-27038: created file already exists”的一种情况和解决办法
- RMAN备份时出现ORA-27038: created file already exists
- rman异地和本地备份---ORA-19504
- 只有spfile和控制文件情况下进行rman恢复时报ORA-00312 ORA-00313错误
- Oracle: failed to parse tnsnames.ora file
- ORA-28759: Failed to open file
- ORA-17503 ksfdopn2 Failed to open file .....
- Oracle: ORA-09817: Write to audit file failed 的解决方法
- ORA-09817: Write to audit file failed 的解决方法
- ORA-09817: Write to audit file failed 的解决
- ORA-00245 control file backup operation failed 分析和解决
- oracle 11g 错误之ORA-09925: Unable to create audit trail file解决办法之一!
- Oracle 11g RAC RMAN ORA-00245 control file backup operation failed 错误 与 控制文件备份 说明
- Oracle 11g RAC RMAN ORA-00245 control file backup operation failed 错误 与 控制文件备份 说明
- ORA-09925: Unable to create audit trail file
- ORA-09925: Unable to create audit trail file
- ora-09925 unable to create audit trail file
- ORA-09925: Unable to create audit trail file汇总
- 消除iphone拨号键盘的拨号音
- 网页文本框只读readonly与不可用disabled区别
- TopCoder 250 points 20-SRM 153 DIV 2 216.58/250 86.63%
- TopCoder 550 points 1-SRM 144 DIV 1 165/550 30%
- 2013ACM/ICPC长沙邀请赛G题 (求解)
- RMAN备份时报“ORA-19504: failed to create file”和“ORA-27038: created file already exists”的一种情况和解决办法
- Windows下安装Python SSH模块及其使用
- csapp2e 家庭作业 3.66
- 十四周
- Windows核心编程 - 进程
- 灰帽子python学习(2)--ctypes的了解
- 基本数据结构 java表示(未完)
- 20130602 oracle 存储过程
- 谷歌阻止苹果,谁来阻止谷歌