dinçer salih kurnaz
Tech. Consultant,
Platform independent senior system administrator.
Servers/Hardware,
Operating Systems/Applications,
Storage,
Networking,
IT Security,
Virtualization,
Cloud Computing/Cloud Management,
Linux
Oracle

rman backup script

cat rmanbackup

#!/bin/bash
export ORACLE_SID=$1
function usage {
    echo “kullanim: rmanbackup <ORACLE_SID> [full|inc] [path]”
}
if [ -z “$1” ]; then
        echo “oracle sid set edin”
    usage
        exit 1;
fi
if [ -z “$2” ]; then
        echo “full veya inc yazin”
    usage
        exit 1;
fi
if [ “$2” != ‘full’ ] && [ “$2” != ‘inc’ ]; then
        echo “full veya inc yazin”
        usage
        exit 1;
fi
if [ “$2” == “full” ]; then
       seviye=0
       echo “yedekleme seviyesi FULL”
        
fi
if [ “$2” == “inc” ]; then
       seviye=1
       echo “yedekleme seviyesi INCREMENTAL”
        
fi
if [ -z “$3” ]; then
       ar=”/backup”
       echo “yedek klasoru $ar.”
else
       ar=$3
       echo “yedek klasoru $ar.”
fi
 
rman target / «EOF
configure controlfile autobackup on;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘$ar/%F’;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO ‘$ar/snapcf_vav.f’;
configure channel 1 device type disk format ‘$ar/%d_%t_%s.rman’;
backup incremental level $seviye database plus archivelog delete all input;
EOF


Comments
blog comments powered by Disqus