确认是否处于归档模式
sqlplus / as sysdba
SQL>shutdown immediate
SQL>startup mount
SQL>alter database archivelog
SQL>alter database open;
启用控制文件自动备份
RMAN>CONFIGURE CONTROLFILE AUTOBACKUP ON;
制作批处理文件
------level0
run {
allocate channel d1 type disk;
allocate
channel d2 type disk;
backup incremental level 0 database format
'G:\rman_backup\level0_%d_%s_%p_%u.bak' tag='level 0' include current
controlfile;
sql 'alter system archive log current';
backup
archivelog all format 'G:\rman_backup\log_%d_%s_%p_%u.bak' delete all
input;
release channel d2;
release channel d1;
}
crosscheck
backup;
delete noprompt expired backup;
delete noprompt obsolete;
exit
------level1
run {
allocate channel d1 type disk;
allocate channel d2 type disk;
backup incremental level 1 database format
'G:\rman_backup\level1_%d_%s_%p_%u.bak' tag='level 1' include current
controlfile;
sql 'alter system archive log current';
backup archivelog all format 'G:\rman_backup\log_%d_%s_%p_%u.bak' delete
all input;
release channel d2;
release channel d1;
}
crosscheck backup;
delete noprompt expired backup;
delete noprompt obsolete;
在运行计划中添加批处理作业
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/16313359/viewspace-682330/ ,如需转载,请注明出处,否则将追究法律责任。