oracle rman冷备shell脚本(我这里是全备份,创建了2个通道c1、c2)可以在这基础上更改
<a href="http://s4.51cto.com/wyfs02/M00/86/18/wKioL1e0fHyRO_TTAABgkcV8Mm0539.png-wh_500x0-wm_3-wmp_4-s_2228178479.png" target="_blank"></a>
文本:
#!/bin/bash
#Author:wangergui Email:[email protected] Date:2016-08-17
#Function:oracle_rman_cold_backup ( Full backup )
[ "${USER}" == "oracle" ] || exit 2
[ ! -d ${ORACLE_BASE}/myrman ] && mkdir ${ORACLE_BASE}/myrman
rman target / <<END
shutdown immediate;
startup mount;
run{
startup mount;
allocate channel c1 type disk;
allocate channel c2 type disk; #通道只能在run块儿中定义,不能单独定义,所以要使用run块儿!
backup database format '${ORACLE_BASE}/myrman/%d_%s.bak';
alter database open;
release channel c1;
release channel c2;
}
END
本文转自 wangergui 51CTO博客,原文链接:http://blog.51cto.com/wangergui/1839737,如需转载请自行联系原作者