PROBLEM:
i hade below error when tried to run shell script in cron job.
the script included sqlplus command.
scripts:
!/bin/bash
sqlplus DB_USER/DB_PASSWORD @SQL_SCRIPT_PATH/SQL_SCRIPTS.sql
The script did not run.
Crontab hade error when tried to run script in log file.
error:
script_path/script.sh: sqlplus: not found
SOLUTION:
you must change the script:
!/bin/bash
export ORACLE_SID=<SID_NAME>
export ORACLE_HOME=<ORACLE_HOME path>
export PATH=$ORACLE_HOME/bin:$PATH
sqlplus -s /nolog <<EOF
connect <DB_user/DB_password>
@SQL_SCRIPT_PATH/SQL_SCRIPTS.sql
spool off
EOF
good luck...
Showing posts with label unix. Show all posts
Showing posts with label unix. Show all posts
Wednesday, May 28, 2014
Monday, March 10, 2014
how to start / stop netbackup services in unix
Stop:
/usr/openv/netbackup/bin/goodies/netbackup stop
/usr/openv/netbackup/bin/goodies/netbackup stop
Start:
/usr/openv/netbackup/bin/goodies/netbackup start
/usr/openv/netbackup/bin/goodies/netbackup start
Subscribe to:
Posts (Atom)