一、使用以下的命令清理了空间:
1. cd /orabak
2. find . -type f -mtime +30 -exec rm -rf {} \;
二、然后开始使用rman备份的脚本进行备份,备份到最后出现以下报错
-------------------------------------------------------------------------------------------
archive log filename=/oralog/1_20800_812554797.dbf recid=20799 stamp=839154512
archive log filename=/oralog/1_20801_812554797.dbf recid=20800 stamp=839154513
released channel: ch2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ch2 channel at 02/10/2014 10:33:46
ORA-19571: archived-log recid 19009 stamp 837863118 not found in control file
-------------------------------------------------------------------------------------------
三、分析及处理过程
1、当手工删除了归档日志以后,Rman备份会检测到日志缺失,从而无法进一步继续执行。
所以此时需要手工执行crosscheck过程,之后Rman备份可以恢复正常。
2、Crosscheck日志
$ rman target /
RMAN> crosscheck archivelog all;#Oracle 9i及以后的版本用crosscheck archivelog all;
RMAN> change archivelog all crosscheck; #Oracle 8i中用change archivelog all crosscheck;
3、再次运行备份脚本
--
archive log filename=/oralog/1_20887_812554797.dbf recid=20886 stamp=839198925 archive log filename=/oralog/1_20888_812554797.dbf recid=20887 stamp=839198982 archive log filename=/oralog/1_20889_812554797.dbf recid=20888 stamp=839199982 archive log filename=/oralog/1_20890_812554797.dbf recid=20889 stamp=839199982 Finished backup at 10-FEB-14
Starting backup at 10-FEB-14
channel ch2: starting full datafile backupset channel ch2: specifying datafile(s) in backupset including current control file in backupset channel ch2: starting piece 1 at 10-FEB-14 channel ch2: finished piece 1 at 10-FEB-14 piece handle=/orabak/control_11839200079688 tag=TAG20140210T230759 comment=NONE channel ch2: backup set complete, elapsed time: 00:00:01 Finished backup at 10-FEB-14
released channel: ch2
--
完成
4、参考资料
http://www.eygle.com/archives/2004/12/rman_crosscheck.html
5、rman的备份脚本
run{
allocate channel ch2 device type DISK;
backup full filesperset 50
database format'/orabak/full_%c_%p_%t_5s';
sql 'alter system archive log current';
backup filesperset 50 archivelog all
format '/orabak/arch%c%p%t%s' delete input;
backup current controlfile
format '/orabak/control_%c%p%t%s';
release channel ch2;
}