天天看点

windows下rman全库备份脚本

windows下rman全库备份脚本

run

{

allocate channel ch1 type disk;

allocate channel ch2 type disk;

backup database filesperset 5 tag='full_bak' format 'D:\backup\fullbak_%d_%s_%p';  

sql 'alter system archive log current';

backup archivelog all tag='arc_bak' format='D:\backup\arch_%U_%T' skip inaccessible  filesperset 5 not  backed up 1 times  delete input;

backup current controlfile tag='bak_ctlfile' format='D:\backup\ctl_file_%U_%T';

release channel ch1;                                  

release channel ch2; 

}

crosscheck backup;                                              

delete noprompt obsolete;

delete noprompt expired backup;

 用一下代码做个批处理每天执行备份脚本:

rman target / msglog D:\dmpbackup\logs\%date:~0,10%.log cmdfile=D:\benfenjiaoben\backup.rman

继续阅读