分别针对表空间,数据和日志的脚本
一、bktbs.sh
su - oracle << EOF
rman target /
run {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE' parms='ENV=(NB_ORA_POLICY=mis_tbs,NB_ORA_SERV=nbu)';
backup
TAG hot_tbs_bk_level0_whole
FORMAT 'df_%s_%p_%t'
tablespace users diskratio=0;
sql 'alter system archive log current';
RELEASE CHANNEL ch00;
}
EOF
二、bklog.sh
su - oracle << EOF
rman target /
run {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE' parms='ENV=(NB_ORA_POLICY=mis_log,NB_ORA_SERV=nbu)';
backup
incremental level 0
skip inaccessible
tag hot_log_bk_level0
FORMAT 'log_%s_%p_%t'
archivelog all delete input diskratio=0;
RELEASE CHANNEL ch00;
}
EOF
三、bkdb.sh
su - oracle << EOF
rman target /
run {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE' parms='ENV=(NB_ORA_POLICY=mis_db,NB_ORA_SERV=nbu)';
backup
incremental level 0
skip inaccessible
tag hot_db_bk_level0
FORMAT 'df_%s_%p_%t'
database diskratio=0;
sql 'alter system archive log current';
RELEASE CHANNEL ch00;
}
EOF