重庆思庄Oracle、KingBase、PostgreSQL、Redhat认证学习论坛

标题: rman_backup_del;win备份脚本 [打印本页]

作者: Inkcup    时间: 7 天前
标题: rman_backup_del;win备份脚本
rman_backup_del.bat
--------------------------
rman target / cmdfile=rman_backup_del.rcv log=backup.log

+++++++++++++++++++

rman_backup_del.rcv
--------------------------
configure retention policy to recovery window of 7 days;
configure backup optimization on;
configure device type disk parallelism 4;
configure compression algorithm 'MEDIUM';
configure channel device type disk format 'D:\RMANBACKUP\bakset\%d_%T_%U';

run {
    allocate channel c1 device type disk;
    allocate channel c2 device type disk;
    allocate channel c3 device type disk;
    allocate channel c4 device type disk;

    crosscheck archivelog all;
    crosscheck backup;
   
    delete noprompt expired archivelog all;
    delete noprompt expired backup;
   

    sql 'alter system archive log current';
    sql 'alter system archive log current';

    backup as compressed backupset
        incremental level 0
        database
        tag 'DB_FULL_%date%'
        format 'D:\RMANBACKUP\bakset\db0_%d_%T_%U'
        include current controlfile
        plus archivelog
        delete input;

    backup as compressed backupset
        spfile
        tag 'SPFILE_%date%'
        format 'D:\RMANBACKUP\bakset\spfile_%d_%T_%U';
   
    delete noprompt obsolete;

    release channel c1;
    release channel c2;
    release channel c3;
    release channel c4;
}

list backup summary;
report obsolete;





欢迎光临 重庆思庄Oracle、KingBase、PostgreSQL、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2