#. /oracle8/day_export_backup.cron/.profile
에서 #을 빼 주어야 되겠죠.
console에서 실행하면 .profile을 읽어서 oracle 관련 환경변수들이
loading되어서 exp ($ORACLE_HOME/bin)를 찾지만,
cron으로 실행하면 exp가 어디 있는지 찾지를 못해서 입니다.
. /oracle8/day_export_backup.cron/.profile
와 같이 해 주면 될 겁니다.
: 문제: 오라클 사용자(oracle.dba)로 DB Backup을 하기 위해서 Cron을 실행시
: 키려 하는데, export를 하지를 못합니다. 디렉토리는 만들어집니다.디렉토리
: 를 만든후 exp 부터 실행이 되질 않습니다. 그런
: 데, /oracle8/day_export_backup.cron 파일을 cron으로 동작을 시키지 않
: 고, 그냥 ./oracle8/day_export_backup.cron 실행을 시켰을 경우에는 무리없
: 이 잘 동작을 합니다. 고수님들의 많은 답변 부탁드립니다.
:
: Mail 메시지 :
: /var/mail/oracle
:
: produced the following output:
:
: /oracle8/day_export_backup.cron: exp: not found
: /oracle8/day_export_backup.cron: exp: not found
: /oracle8/day_export_backup.cron: exp: not found
:
: mv: cannot access file1.dmp
: mv: cannot access file2.dmp
: mv: cannot access file3.dmp
:
: /var/cron/log 파일 내용
:
: 오라클 사용자 내용
:
: > CMD:/oracle8/day_export_backup.cron
: > oracle 9069 c Mon Jan 6 09:14:00 2003
: < oracle 9069 c Mon Jan 6 09:14:00 2003 rc=2
:
: > CMD:/oracle8/day_export_backup.cron
: > oracle 9150 c Mon Jan 6 09:20:00 2003
: < oracle 9150 c Mon Jan 6 09:20:00 2003 rc=2
:
: > CMD:/oracle8/day_export_backup.cron
: > oracle 10092 c Mon Jan 6 10:15:00 2003
: < oracle 10092 c Mon Jan 6 10:15:00 2003 rc=2
:
: root cron 내용
:
: > CMD:/usr/lib/uucp/uudemon.poll
: > uucp 9629 c Mon Jan 6 10:00:00 2003
: < oracle 9628 c Mon Jan 6 10:00:00 2003 rc=1
: < uucp 9629 c Mon Jan 6 10:00:00 2003
: > CMD:/usr/lib/uucp/uudemon.hour
: > uucp 9959 c Mon Jan 6 10:11:00 2003
: < uucp 9959 c Mon Jan 6 10:11:00 2003
:
: /oracle8/day_export_backup.cron 파일 내용
:
: #!/bin/sh
:
: PATH=$PATH:$ORACLE_HOME/bin; export PATH
:
: BACKUPDIR=`date +%Y%m%d`
:
: #. /oracle8/day_export_backup.cron/.profile > /dev/null ;
: #BACKUPDIR=/oracle8/$BACKUPDATE
:
: # make directory
: mkdir /oracle8/$BACKUPDIR
:
: #DB export
: exp userid=file1/file1 direct=y owner=file1 file=file1.dmp
: exp userid=file2/file2 direct=y owner=file2 file=file2.dmp
: exp userid=file3/file3 direct=y owner=file3 file=file3.dmp
:
: mv file1.dmp /oracle8/$BACKUPDIR
: mv file2.dmp /oracle8/$BACKUPDIR
: mv file3.dmp /oracle8/$BACKUPDIR
:
: crontab -e 의 내용
:
: 15 10 * * * /oracle8/day_export_backup.cron
:
:
: 시스템 환경
:
: OS : SunOS hostname 5.6 Generic_105181-19 sun4u sparc SUNW,Ultra-60
: DB : Oralce 8.1.5