본문 바로가기
OraclE

linux에서 자동 exp스크립

by 타마마임팩트_쫀 2009. 1. 16.

sh 설정하는 부분

----------------------------------------------------------------------------------------------------------

 

export LD_LIBRARY PATH=$ORACLE_HOME/libTH=$PATH:$HOME/bin
TERM=vt100; export TERM
DISPLAY=192.168.0.52:0.0; export DISPLAY
export ORACLE_BASE=/oracle
export ORACLE_HOME=$ORACLE_BASE/db_1
export ORACLE_OWNER=10g
export ORACLE_SID=10g
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
umask 022

 


#backup_name=$(date +'%Y%m%d')".dmp"
#backup_dir="/backup/"
#!/bin/bash
su - 10g  <<EOF
sqlplus /nolog <<EOF

!exp userid=scott/tiger  file='/backup/b.dmp' FULL=Y
~
~
~

 

 

-----------------------------------------------------------------------------------------------------------

crontab -e 설정

 

HELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=10g
07 09 * * * /backup/backup.sh