#!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:. ; export PATH ORACLE_SID=ris ; export ORACLE_SID ORACLE_BASE=/oracle/app/oracle ; export ORACLE_BASE ORACLE_HOME=/oracle/app/oracle/product/10.2.0/RIS ; export ORACLE_HOME ORACLE_OWNER=oracle ; export ORACLE_OWNER ORACLE_GROUP=dba ; export ORACLE_GROUP PATH=$PATH:$ORACLE_HOME/bin ; export PATH CLASSPATH=$ORACLE_HOME/DBCreate/oradev/classes/orapts.jar: $ORACLE_HOME/jdbc/lib/classes12.zip:$CLASSPATH ; export CLASSPATH LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH ; export LD_LIBRARY ORAENV_ASK=NO TNS_ADMIN=$ORACLE_HOME/network/admin ; export TNS_ADMIN TERM=vt100 ; export TERM NLS_LANG=AMERICAN_AMERICA.US7ASCII ; export NLS_LANG exp USERID="username/password@SID" FILE=/oracle/app/oracle/dump/test.DMP LOG=/oracle/app/oracle/dump/test.LOG COMPRESS=Y DIRECT=Y ROWS=Y CONSISTENT=Y FULL=Y # END
Next, I would run the above script in its own shell, mimicking what crontab does. To do so, use the following:
sh -x scriptname
This will execute the script in its own environment, not yours. You will often see things not obvious to you when you run the script yourself.
Dig deeper on Oracle database backup and recovery
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.