D盘新建一个文件夹backup_file,里面新建一个文件夹logs
一个文件叫auto_full_one_rman.bat
修改这三处
set oracle_sid=wiicare
rman cmdfile= D:/backup_file/level_full_one_rman.rman msglog= D:/backup_file/logs/full_one_%date:~0,4%%date:~5,2%%date:~8,2%.log
一个叫level_full_one_rman.rman
修改这四处
connect target wiicare/Mdsd123@wiicare
run {
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'D:/backup_file\%F';
allocate channel T1 device type disk;
allocate channel T2 device type disk;
crosscheck archivelog all;
delete noprompt expired archivelog all;
backup database
format 'D:/backup_file\level_full_%d_%T_%s';
backup archivelog all format 'D:/backup_file\arch_%d_%U' ;
release channel T1;
release channel T2;}
allocate channel for maintenance device type disk;
crosscheck backup;
crosscheck archivelog all;
delete noprompt expired backup;
delete noprompt expired archivelog all;
delete noprompt archivelog all completed before 'sysdate -3';
report obsolete;
delete noprompt obsolete;
list backup summary;
release channel;
执行成功