oracle基础~rman备份脚本
时间:2021-07-01 10:21:17
帮助过:36人阅读
零 环境
RMAN 已设置 自动备份控制文件和初始化文件参数
一 全备
#设置环境变量
export ORACLE_BASE=/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=hncdfpos001
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export PATH=$ORACLE_HOME/bin:$PATH
rman target / log /backup/hncdfpos001/rman_full.log append<<EOF
run
{
#分配通道
allocate channel c1 type disk;
allocate channel c2 type disk;
#删除旧备份
crosscheck backup;
crosscheck archivelog all;
delete noprompt expired backup;
delete noprompt expired archivelog all;
#切换日志
sql ‘alter system archive log current‘;
#备份
backup database plus archivelog delete input format ‘/backup/hncdfpos001/full_%d_%T_%s_%p‘;
#释放通道
release channel c1;
release channel c2;
}
EOF
oracle基础~rman备份脚本
标签:man 基础 app prompt current sys 切换 bsp data