oracle自动备份
来源:网络 责任编辑:栏目编辑 发表时间:2013-07-02 00:43 点击:次
Java代码
#!/bin/bash
source /home/oracle/.bash_profile
export NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss';
$ORACLE_HOME/bin/rman target / msglog=/backup/log/baklog_`date '+%Y%m%d%H%M%S'`.log <<EOF
run{
allocate channel c1 type disk;
backup as compressed backupset incremental level 0 tag 'lv0' database format '/backup/%d-Incr-0-%I-%T-S%s-P%p.rbak';
sql 'alter system archive log current';
backup archivelog all format '/backup/%d-Archlog-%I-%T-S%s-P%p.rbak';
delete noprompt expired backupset of archivelog all;
release channel c1;
}
quit;
EOF
注:以oracle用户执行,crontab定时
作者“szgaea”
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>