oracle rman冷备shell脚本(我这里是全备份,创建了2个通道c1、c2)可以在这基础上更改
文本:
#!/bin/bash
#Author:wangergui Email:291131893@qq.com 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{
shutdown immediate;
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