Oracle备份前一天的归档

---备份归档
[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

posted @ 2020-03-31 13:48  钱若梨花落  阅读(448)  评论(0编辑  收藏  举报