rman备份脚本
#!/bin/bash
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=IPCC1
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
DATE=`date +%Y%m%d-%H:%M:%S`
rman target / <<EOF log /home/oracle/ora_rman.log
run {
allocate channel c1 type disk ;
allocate channel c2 type disk ;
allocate channel c3 type disk ;
delete noprompt obsolete;
crosscheck backupset of database;
delete noprompt expired backupset;
backup full database format '/backup_archive_log/backupdata/full_db_$DATE_%U_%t.bak.bak';
sql 'alter system archive log current';
backup archivelog all format '/backup_archive_log/backupdata/arch_$DATE_full_%U_%t.bak.bak';
release channel c1;
release channel c2;
release channel c3;
}
exit
EOF
创建时间:2022-03-31 20:51
넶浏览量:0