Pages

Friday, September 30, 2011

RMAN backup script.

#!/bin/bash
SHELL=/bin/bash
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
export ORACLE_SID=xxx

#wd=`date +%Y_%m_%d`
#mkdir -p /orabackup/test_backup/$wd

rman target backup/backup "two less than simbole" EOF
run {
set controlfile autobackup format for device type disk to '/backup/%F';
allocate channel c1 device type disk format='/backup/%d_%T_%U';
backup database;
sql 'alter system archive log current';
backup archivelog all;
delete noprompt archivelog all completed before 'SYSDATE-7';
release channel c1;
}
EOF

No comments:

Post a Comment