rman 备份脚本

简介: rman 备份脚本
rman_backup_4T.sh 
source ~/.bash_profile;
back_path="/HS5080";
back_log="/HS5080/log";
rman_bin="/u01/app/oracle/product/11.2.0/db_1/bin";
date_w=`date +%u`;


case $date_w in 
6)

if [ ! -d "$back_path/`date +%m-%d`" ]; then
mkdir $back_path/`date +%m-%d`
fi

$rman_bin/rman  nocatalog log $back_log/level0_`date +%Y-%m-%d`.log <<EOF
connect  target   /
run {
allocate channel d1 type disk maxpiecesize 16g;
allocate channel d2 type disk maxpiecesize 16g;
allocate channel d3 type disk maxpiecesize 16g;
allocate channel d4 type disk maxpiecesize 16g;
backup incremental level 0 database format '$back_path/`date +%m-%d`/DATA_level0_%d_%s_%p_%u.bak'
plus archivelog  format '$back_path/`date +%m-%d`/archivelog_%d_%s_%p_%u.bak' delete all input;
release channel d4;
release channel d3;
release channel d2;
release channel d1;
}
crosscheck backup;
delete noprompt expired backup;
delete noprompt obsolete;
exit;
EOF
;;


1|2|3|4|5|7)

if [ ! -d "$back_path/`date +%m-%d`" ];then
mkdir    $back_path/`date +%m-%d`
fi

$rman_bin/rman  nocatalog log $back_log/level1_`date +%Y-%m-%d`.log <<EOF
connect  target /
run {
allocate channel d1 type disk maxpiecesize 8g;
allocate channel d2 type disk maxpiecesize 8g;
backup incremental level 1 database format '$back_path/`date +%m-%d`/level1_%d_%s_%p_%u.bak' plus archivelog  format '$back_path/`date +%m-%d`/archivelog_%d_%s_%p_%u.bak' delete all input;
release channel d2;
release channel d1;
}
crosscheck backup;
delete noprompt expired backup;
delete noprompt obsolete;
exit;
EOF
;;
esac
相关文章
|
7月前
|
Oracle 关系型数据库 数据库
rman 恢复脚本
rman 恢复脚本
81 1
RMAN备份及恢复归档日志的语法
RMAN备份及恢复归档日志的语法
1054 0
|
SQL otter 关系型数据库
|
Oracle 关系型数据库 Shell
|
Oracle 关系型数据库 数据库

相关实验场景

更多