码迷,mamicode.com
首页 > 数据库 > 详细

Oracle备份前一天的归档

时间:2020-03-31 14:13:15      阅读:100      评论:0      收藏:0      [点我收藏+]

标签:run   bash   ash   home   acl   res   bin   ann   set   

---备份归档
[oracle@db1 ~]$ cat /home/oracle/rmarch.sh
#! /bin/bash
source /home/oracle/.bash_profile
exec >> /home/oracle/delarch`date +%y%m%d%H`.log
$ORACLE_HOME/bin/rman target / <<EOF
crosscheck archivelog all;
delete noprompt expired archivelog all;
crosscheck copy;
run
{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
backup as compressed backupset archivelog until time ‘sysdate-1‘ format ‘/u01/0331backup/arch_%d_%T_%s_%p‘ delete input;
release channel c1;
release channel c2;
release channel c3;
}
delete noprompt force archivelog until time ‘sysdate-1‘;
exit;
EOF

Oracle备份前一天的归档

标签:run   bash   ash   home   acl   res   bin   ann   set   

原文地址:https://www.cnblogs.com/ss-33/p/12604703.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!