本文共 14450 字,大约阅读时间需要 48 分钟。
版本:
SQL> select * from v$version;
BANNER--------------------------------------------------------------------------------Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit ProductionPL/SQL Release 11.2.0.1.0 - ProductionCORE 11.2.0.1.0 ProductionTNS for Linux: Version 11.2.0.1.0 - ProductionNLSRTL Version 11.2.0.1.0 - ProductionSQL>在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:44ORA-19504: failed to create file "/u01/rmanbkp/full01"ORA-27038: created file already existsAdditional 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 16384SQL> show parameter db_block_size 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-13current log archivedusing channel ORA_DISK_1channel ORA_DISK_1: starting archived log backup setchannel ORA_DISK_1: specifying archived log(s) in backup setinput archived log thread=1 sequence=44 RECID=1 STAMP=817054481input archived log thread=1 sequence=45 RECID=2 STAMP=817054522input archived log thread=1 sequence=46 RECID=3 STAMP=817054526input archived log thread=1 sequence=47 RECID=4 STAMP=817054712input archived log thread=1 sequence=48 RECID=5 STAMP=817061936input archived log thread=1 sequence=49 RECID=6 STAMP=817065148input archived log thread=1 sequence=50 RECID=7 STAMP=817065192input archived log thread=1 sequence=51 RECID=8 STAMP=817066777input archived log thread=1 sequence=52 RECID=9 STAMP=817066795input archived log thread=1 sequence=53 RECID=10 STAMP=817066905input archived log thread=1 sequence=54 RECID=11 STAMP=817066934input archived log thread=1 sequence=55 RECID=12 STAMP=817067207input archived log thread=1 sequence=56 RECID=13 STAMP=817067228input archived log thread=1 sequence=57 RECID=14 STAMP=817067257input archived log thread=1 sequence=58 RECID=15 STAMP=817067276input archived log thread=1 sequence=59 RECID=16 STAMP=817067373channel ORA_DISK_1: starting piece 1 at 02-JUN-13channel ORA_DISK_1: finished piece 1 at 02-JUN-13piece handle=/u01/rmanbkp/arch01 tag=FULLBK01 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01Finished backup at 02-JUN-13Starting backup at 02-JUN-13using channel ORA_DISK_1channel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile(s) in backup setinput datafile file number=00001 name=/u01/oracle/oradata/ora11g/system01.dbfinput datafile file number=00002 name=/u01/oracle/oradata/ora11g/sysaux01.dbfinput datafile file number=00003 name=/u01/oracle/oradata/ora11g/undotbs01.dbfinput datafile file number=00005 name=/u01/oracle/oradata/ora11g/ts1.dbfinput datafile file number=00006 name=/u01/oracle/oradata/ora11g/ts2.dbfinput datafile file number=00007 name=/u01/oracle/oradata/ora11g/ts3.dbfinput datafile file number=00008 name=/u01/oracle/oradata/ora11g/ts4.dbfinput datafile file number=00004 name=/u01/oracle/oradata/ora11g/users01.dbfchannel ORA_DISK_1: starting piece 1 at 02-JUN-13channel ORA_DISK_1: finished piece 1 at 02-JUN-13piece handle=/u01/rmanbkp/full01 tag=FULLBK01 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:15channel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile(s) in backup setincluding current control file in backup setincluding current SPFILE in backup setchannel ORA_DISK_1: starting piece 1 at 02-JUN-13RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of backup plus archivelog command at 06/02/2013 19:09:52ORA-19504: failed to create file "/u01/rmanbkp/full01"ORA-27038: created file already existsAdditional information: 1RMAN> 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-13BS 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_1List of Backup PiecesBP Key BS Key Pc# Cp# Status Device Type Piece Name------- ------- --- --- ----------- ----------- ----------25 25 1 1 AVAILABLE DISK /u01/rmanbkp/arch0126 26 1 1 AVAILABLE DISK /u01/rmanbkp/full01deleted backup piecebackup piece handle=/u01/rmanbkp/arch01 RECID=25 STAMP=817067373deleted backup piecebackup piece handle=/u01/rmanbkp/full01 RECID=26 STAMP=817067375Deleted 2 objectsRMAN> list backup;specification does not match any backup in the repositoryRMAN> 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-13current log archivedusing channel ORA_DISK_1channel ORA_DISK_1: starting archived log backup setchannel ORA_DISK_1: specifying archived log(s) in backup setinput archived log thread=1 sequence=44 RECID=1 STAMP=817054481input archived log thread=1 sequence=45 RECID=2 STAMP=817054522input archived log thread=1 sequence=46 RECID=3 STAMP=817054526input archived log thread=1 sequence=47 RECID=4 STAMP=817054712input archived log thread=1 sequence=48 RECID=5 STAMP=817061936input archived log thread=1 sequence=49 RECID=6 STAMP=817065148input archived log thread=1 sequence=50 RECID=7 STAMP=817065192input archived log thread=1 sequence=51 RECID=8 STAMP=817066777input archived log thread=1 sequence=52 RECID=9 STAMP=817066795input archived log thread=1 sequence=53 RECID=10 STAMP=817066905input archived log thread=1 sequence=54 RECID=11 STAMP=817066934input archived log thread=1 sequence=55 RECID=12 STAMP=817067207input archived log thread=1 sequence=56 RECID=13 STAMP=817067228input archived log thread=1 sequence=57 RECID=14 STAMP=817067257input archived log thread=1 sequence=58 RECID=15 STAMP=817067276input archived log thread=1 sequence=59 RECID=16 STAMP=817067373input archived log thread=1 sequence=60 RECID=17 STAMP=817067522channel ORA_DISK_1: starting piece 1 at 02-JUN-13channel ORA_DISK_1: finished piece 1 at 02-JUN-13piece handle=/u01/rmanbkp/arch01_14ob6tg2_1_1 tag=FULLBK01 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01Finished backup at 02-JUN-13Starting backup at 02-JUN-13using channel ORA_DISK_1channel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile(s) in backup setinput datafile file number=00001 name=/u01/oracle/oradata/ora11g/system01.dbfinput datafile file number=00002 name=/u01/oracle/oradata/ora11g/sysaux01.dbfinput datafile file number=00003 name=/u01/oracle/oradata/ora11g/undotbs01.dbfinput datafile file number=00005 name=/u01/oracle/oradata/ora11g/ts1.dbfinput datafile file number=00006 name=/u01/oracle/oradata/ora11g/ts2.dbfinput datafile file number=00007 name=/u01/oracle/oradata/ora11g/ts3.dbfinput datafile file number=00008 name=/u01/oracle/oradata/ora11g/ts4.dbfinput datafile file number=00004 name=/u01/oracle/oradata/ora11g/users01.dbfchannel ORA_DISK_1: starting piece 1 at 02-JUN-13channel ORA_DISK_1: finished piece 1 at 02-JUN-13piece handle=/u01/rmanbkp/full01_15ob6tg3_1_1 tag=FULLBK01 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:15channel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile(s) in backup setincluding current control file in backup setincluding current SPFILE in backup setchannel ORA_DISK_1: starting piece 1 at 02-JUN-13channel ORA_DISK_1: finished piece 1 at 02-JUN-13piece handle=/u01/rmanbkp/full01_16ob6tgi_1_1 tag=FULLBK01 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01Finished backup at 02-JUN-13Starting backup at 02-JUN-13current log archivedusing channel ORA_DISK_1channel ORA_DISK_1: starting archived log backup setchannel ORA_DISK_1: specifying archived log(s) in backup setinput archived log thread=1 sequence=61 RECID=18 STAMP=817067540channel ORA_DISK_1: starting piece 1 at 02-JUN-13channel ORA_DISK_1: finished piece 1 at 02-JUN-13piece handle=/u01/rmanbkp/arch01_17ob6tgk_1_1 tag=FULLBK01 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01Finished backup at 02-JUN-13RMAN> 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-13BS 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.dbfBS 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-13BS 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-13RMAN>1. Specifying a Format for RMAN Backups
2. Backing Up Control Files with RMAN
3. RMAN配置参数解释
转载地址:http://gitai.baihongyu.com/