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