oracle windows rman backup
博客专区 > 易野 的博客 > 博客详情
oracle windows rman backup
易野 发表于2个月前
oracle windows rman backup
  • 发表于 2个月前
  • 阅读 8
  • 收藏 0
  • 点赞 0
  • 评论 0

华为云·免费上云实践>>>   

1.备份

备份包括2个脚本

----------------------------------------
1.备份脚本 backup_file.sql
2.执行脚本 run_bak.bat

--------------------------------------  
  
backup_file.sql
 
  run
{

configure retention policy to recovery window of 30 days;
allocate channel ch1 type disk;
allocate channel ch2 type disk;
allocate channel ch3 type disk;
allocate channel ch4 type disk;

backup database  tag='full_bak' format 'E:\backup\orcl_dbbak\fullbak_%d_%s_%p';  
sql 'alter system archive log current';
backup archivelog all tag='arc_bak' format='E:\backup\orcl_dbbak\arch_%U_%T'  delete all input;
backup current controlfile tag='bak_ctlfile' format='E:\backup\orcl_dbbak\ctl_file_%U_%T';
 
release channel ch1;                                   
release channel ch2;
release channel ch3;                                   
release channel ch4; 
}
report obsolete;
crosscheck backup;                                               
delete noprompt obsolete;
delete noprompt expired backup;

delete noprompt expired backup;
delete noprompt obsolete recovery window of 30 days;
delete noprompt archivelog until time 'SYSDAY-180';


run_bak.bat  
  
E:
cd E:\backup\script
set ORACLE_SID=orcl
rman target / cmdfile='E:\backup\script\backup_file.sql' log='E:\backup\dzjz_dbbak\dbbak_orcl_%date:~0,10%.log' 

 

 

 

 

 

标签: Oracle
共有 人打赏支持
粉丝 0
博文 79
码字总数 65351
×
易野
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: