系统:CentOS7.4
数据库:11.2.0.4
run块语句如下:
run{
allocate channel c1 device type disk;
allocate channel c2 device type disk;
allocate channel c3 device type disk;
report obsolete;
crosscheck backup;
delete noprompt obsolete;
backup as compressed backupset database format‘/dbbak/db_%U.bak’ plus archivelog format ‘/dbbak/arc_%U.bak’;
backup current controlfile format ‘/dbbak/ctl_%U.bak’;
delete noprompt archivelog until time ‘sysdate-14’;
release channel c1;
release channel c2;
release channel c3;
}
异常描述:在执行rman备份时,报错RMAN-06091,如下所示:
造成此异常是由于rman备份通道被调整为非磁盘通道所致,而默认的通道为磁盘通道,所以delete noprompt obsolete命令不会成功.
查看当前rman通道设置:
RMAN>show all;
CONFIGUREDEFAULT DEVICE TYPE TO DISK; # default
解决方案:
方案1:
在run块外添加allocatechannel for maintenance type disk;
方案2:
在run块里的delete后添加devicetype disk,如下:
delete noprompt obsoletedevice type disk;
delete noprompt archivelog until time ‘sysdate-14’device type disk;