backup

@echo off
chcp 1251
rman target / @backup.txt > backup_%date%.log
rem в планировщике нужно указать рабочую папку
rem pause Press any key to exit
exit  
exit  
run {

    CONFIGURE RETENTION POLICY TO REDUNDANCY 14;
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    #CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'C:\FRA\%d\AUTOBACKUP\CF_%d_%F';
    CONFIGURE BACKUP OPTIMIZATION ON;
    CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET;
    
	crosscheck archivelog all;
	crosscheck backup;
	crosscheck copy;
	backup as compressed backupset database plus archivelog delete all input;

     # format 'D:\backup\%d_datafile_%s_%p.bak'
     # tag 'backup_name';
   
    delete noprompt obsolete;

    #sql "create PFILE = ''c:\PFILE.ora'' from SPFILE";
    
    #CONFIGURE BACKUP OPTIMIZATION CLEAR;
    #CONFIGURE RETENTION POLICY CLEAR;
    #CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK CLEAR;

}