|
scripts calling scripts calling scripts is the #1 problem. at the end you don't know which env gets sourced.
the easiest and cleanest way is to write a self contained script. don't rely on any other environment scripts, if you don't have to.
e.g.,
5 0 * * 6 /home/xyz/script/exp-db.sh
exp-db.sh:
#!/bin/sh
ORACLE_HOME=....
ORACLE_SID=...
PATH=$ORACLE_HOME/bin:....
export ORACLE_HOME ORACLE_SID PATH
exp PARFILE=exp-db.par FILE=SID.dmp.`date +"%Y%m%d-%H%M"` LOG=SID.log.`date +"%Y%m%d-%H%M"`
(date command might work differently depending on the os)
exp-db.par:
USERID=username/passwd
FULL=Y
if you want to be fancy, add other DIRECT, COMPRESS, BUFFER stuff.
the reason you still need a par file (in stead of putting everything on the exp command) is that you don't want username and passwd show up when someone does a ps.
make sure exp-db.par and exp-db.sh are in the same directory, if not, make sure you specify the full path to the par file.
i guarantee you this method will work, unless of course your database is down  |
|