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,如需轉載請自行聯系原作者