#!/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:
By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
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.
Related Q&A from Brian Peasland
Oracle expert Brian Peasland answers one reader's question about common pitfalls when connecting Oracle to outside programs.continue reading
One reader asks expert Brian Peasland a question about datafile sizes with the Oracle RMAN duplicate 10g command.continue reading
Managing parent table-child table relations in Oracle SQL environments is key to efficient programming.continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.