ITPub博客

首页 > Linux操作系统 > Linux操作系统 > winsow 环境下 rman 备份

winsow 环境下 rman 备份

原创 Linux操作系统 作者:gullvip 时间:2010-12-22 13:22:35 0 删除 编辑

确认是否处于归档模式

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;


在运行计划中添加批处理作业


rman target / CMDFILE 'f:/batch.txt'
LOG 'f:/rman_backup_%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%".log'

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/16313359/viewspace-682330/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-12-20

  • 博文量
    34
  • 访问量
    79960