Linux Oracle 데이터 백업

914 단어 Oacle
#! /bin/sh
# bakdata.sh
source /home/oracle/.bash_profile
rq=`date +"%d"`
fname=/home/oracle/back/weatherdb$rq
rm -f $fname.dmp
rm -f $fname.log
exp web_usr/web_usr123 owner=web_usr rows=y indexes=y CONSTRAINTS=y compress=n buffer=65536 feedback=100000 file=$fname.dmp log=$fname.log
da=`date +%d -d"-7 day"`
fna=/home/oracle/back/weatherdb$da
rm -f $fna.dmp
rm -f $fna.log
[www@nmc backup]$ more back.sh 
#! /bin/sh
source /home/oracle/.bash_profile
da=`date +"%Y%m%d"`
expdp wsdsp/123456 directory=dpump_dir dumpfile=wsdsp$da.dmp schemas=wsdsp logfile=wsdsp$da.log
dat=`date +"%Y%m%d" -d"-14 day"`
file=/usr/local/oracle/backup/wsdsp$dat
rm -f $file.dmp
rm -f $file.log

[www@nmc backup]$

좋은 웹페이지 즐겨찾기