Re: HELP! Export command problem

From: Joel Garry <joelga_at_pebble.ml.org>
Date: 1997/12/11
Message-ID: <66q0vc$t5h$1_at_pebble.ml.org>#1/1


In article <348f52a0.6108572_at_news.halcyon.com>, MaGjjC NorthWest <magjjc!!_at_juno.com> wrote:
>Can someone please let me know if it's possible to run the export
>utility inside a shell script? I have tried the following and they
>will not work:
>
>su - oracle -c exp system/manager full=y etc. etc. etc.
><<EOF
>exit
>EOF
>
>or
>
>su - oracle -c exp parfile=param.txt
><<EOF
>exit
>EOF
>
>It comes back to prompt for a username and password. It runs in
>interactive mode.
>
>If I put the <<EOF on the same line as the exp command...
>su - oracle -c exp system/manager full=y etc. <<EOF
>exit
>
>I get an error message.
>

I have a cron job run from a shell script (that specifies the shell I want and the necessary environment variables), and it calls another script that has the following in it on the first line:

exp myuser/mypasswd ROWS=N FILE=table_defs.dmp

Works just fine, also if run online as oracle (and I would expect, as anyone else with a proper environment).

I also have cron sqlplus commands that run like so: sqlplus << EOD
myuser/mypasswd
_at_somesqlscript
EOD This is called the hereis syntax in script terminology.

>If you have successfully run exp inside a shell script, please send me
>the correct syntax or script via email to magjjc_at_juno.com
>

I think the password it is asking you for is the oracle password, and it wouldn't if you started out as root (but you get other weird errors - The hereis syntax doesn't seem to work right with exp).

The cron files I use are created with crontab -e while logged in as oracle.

>Thanks in advance...
>

-- 
These opinions are my own and not necessarily those of Information Quest
jgarry_at_eiq.com                           http://www.informationquest.com
http://ourworld.compuserve.com/homepages/joel_garry
"See your DBA?"  I AM the _at_#%*& DBA!
Received on Thu Dec 11 1997 - 00:00:00 CET

Original text of this message