#cat db_bak0.rman
run
{
configure controlfile autobackup on;
configure controlfile autobackup format for device type disk to '/u01/oracle/rmanbak/%F';
configure channel device type disk format '/u01/oracle/orabak/inc0_%d_%s_%p_%u_%T';
backup as compressed backupset incremental level 0 database;
}
创建用户
sql>create user rmanadmin identified by rmanadmin
sql>grant sysdba to rmanadmin
#cat exe_0_bak.sh
export ORACLE_HOSTNAME=orcl
export ORACLE_BASE=/u01/oracle
export ORACLE_SID=orcl
export ORACLE_HOME=/u01/oracle/db_1
export PATH=/usr/sbin:$ORACLE_HOME/bin:$PATH
#export DATE=$(date +%Y_%m_%d)
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
/u01/oracle/db_1/bin/rman target rmanadmin/rmanadmin cmdfile=/u01/oracle/rmanbak/db_bak0.rman log=/u01/oracle/rmanbak/rman+$DATE.log append
原文链接:https://www.f2er.com/oracle/211895.html