database - Oracle DB backup script not running -


i trying make backup using crontab on linux machine.

i have short script :

#!/bin/bash export oracle_home=<oracle_home_directory> date=`date +%f_%h-%m-%s`  echo $date  /u01/app/oracle/product/11.2.0/dbhome_1/bin/expdp system/oramanager full=y parallel=4 directory=data_pump_dir dumpfile=prod1-ecmdb1-$date.dmp logfile=prod-ecmdb1-$date.log compression=all 

i have placed script in crontab such:

02 17 * * * cd /u01/app/oracle/admin/ecmdb1/dpdump/ && /u01/app/oracle/admin/ecmdb1/dpdump/backup.sh > /tmp/test.out 

but script not run. says in logs :

ude-12162: operation generated oracle error 12162 ora-12162: tns:net service name incorrectly specified 

if run whole script line manually, works fine. doesnt work fine using cron. need setup variables ?

add export oracle_sid=<...> , make sure cron set under same user, not root.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -