1.先创建一个rman备份脚本,文件名为rman_backup.rcv ,文件内容如下
run
{allocate channel c1 type disk;
allocate channel c2 type disk;
backup filesperset 2 database format 'H:/oradb/dbback/dbback/rman_bak/rman_backup_all/full_data_%d_%T_%s_%p';
sql 'alter system archive log current';
sql 'alter system archive log current';
sql 'alter system archive log current';
backup archivelog all format 'H:/oradb/dbback/dbback/rman_bak/rman_backup_all/arch_%d_%T_%s_%p' delete input;
backup current controlfile format 'H:/oradb/dbback/dbback/rman_bak/rman_backup_all/ctl_%d_%T_%s_%p';
}
allocate channel for maintenance type disk;
crosscheck backup;
crosscheck archivelog all;
delete noprompt expired backup;
crosscheck copy;
delete noprompt obsolete;
2.创建一个bat批处理脚本,文件名为 orabackup.bat , 文件内容如下
rman target / nocatalog CMDFILE 'H:\oradb\dbback\rman\rman_backup.rcv' log 'H:\oradb\dbback\rman\rman_backup.log'
3.用windows定时功能定时执行orabackup.bat 这个脚本就行了(很简单,百度一下)
4.定期查看H:\oradb\dbback\rman\rman_backup.log日志看备份是否成功,有没有报错。
windows下oracle自动备份
最新推荐文章于 2021-04-12 03:54:24 发布