Home » RDBMS Server » Server Administration » run exp cmd in shell scripts (10g ,Linux AS 4)
run exp cmd in shell scripts [message #298722] Thu, 07 February 2008 05:56 Go to next message
airother
Messages: 27
Registered: February 2006
Junior Member
hi all,
How to run export command in shell scripts which is run through CRONTAB or at command.
Re: run exp cmd in shell scripts [message #298723 is a reply to message #298722] Thu, 07 February 2008 06:02 Go to previous messageGo to next message
MarcS
Messages: 312
Registered: March 2007
Location: Antwerp
Senior Member
airother wrote on Thu, 07 February 2008 12:56
hi all,
How to run export command in shell scripts which is run through CRONTAB or at command.



First of all: try to figure out which command line arguments you can pass to the export command. Then select the ones you're going to need.
Have a go at the command line with some of those command line arguments (PARFILE is a nice one)

If you succeed in running exp with command line arguments without exp asking you for more, then you just have to put the command line with its arguments in a shell script.

All this and much more you'll find in the manuals Wink
Re: run exp cmd in shell scripts [message #298727 is a reply to message #298723] Thu, 07 February 2008 06:13 Go to previous messageGo to next message
airother
Messages: 27
Registered: February 2006
Junior Member
when i am running the exp command in $prompt it work
when i put that same exp command in .sh scripts it also work in
$prompt e.g. $sh expc.sh this will work.
But when i put the same .sh script in CRONTAB is nor woring
Re: run exp cmd in shell scripts [message #298728 is a reply to message #298727] Thu, 07 February 2008 06:15 Go to previous messageGo to next message
MarcS
Messages: 312
Registered: March 2007
Location: Antwerp
Senior Member
And how do you know it's not working?
Do you get an error? If so: what error would that be?

Re: run exp cmd in shell scripts [message #298731 is a reply to message #298728] Thu, 07 February 2008 06:28 Go to previous messageGo to next message
airother
Messages: 27
Registered: February 2006
Junior Member
Dump file is not create
error is exp:command not found
Re: run exp cmd in shell scripts [message #298733 is a reply to message #298722] Thu, 07 February 2008 06:32 Go to previous messageGo to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
Post your shell script.
Re: run exp cmd in shell scripts [message #298735 is a reply to message #298731] Thu, 07 February 2008 06:37 Go to previous messageGo to next message
MarcS
Messages: 312
Registered: March 2007
Location: Antwerp
Senior Member
airother wrote on Thu, 07 February 2008 13:28
Dump file is not create
error is exp:command not found


And what does command not found tells you ?

I guess you're running Unix (or any flavour of Unix).

Scripts started from within CRONTAB behaves a bit different than the ones you start at the command line.

Some start-up stuff that's executed when you log in at the system, isn't executed when a crontab-job is started.
When you log in the ORACLE_HOME is set, as long with the PATH evironment variable.
And that's what missing in your script so it can be run succesfully via crontab.

Ask your unix-administrator to help you out on this.
Re: run exp cmd in shell scripts [message #298739 is a reply to message #298733] Thu, 07 February 2008 06:42 Go to previous messageGo to next message
airother
Messages: 27
Registered: February 2006
Junior Member
No Message Body
  • Attachment: test.sh
    (Size: 0.14KB, Downloaded 273 times)
Re: run exp cmd in shell scripts [message #298747 is a reply to message #298735] Thu, 07 February 2008 08:08 Go to previous messageGo to next message
joy_division
Messages: 4642
Registered: February 2005
Location: East Coast USA
Senior Member
Adding to Marc's answer, crontab runs with NO environment. You have to set all variables including your PATH.
Try just creating a dummy script to select sysdate from dual, set it to run 1 minute from now, and then see the output and fix accordingly.
Re: run exp cmd in shell scripts [message #299109 is a reply to message #298747] Sat, 09 February 2008 08:09 Go to previous message
Mohammad Taj
Messages: 2412
Registered: September 2006
Location: Dubai, UAE
Senior Member

something like
http://dbataj.blogspot.com/2006/12/export-backup.html
Previous Topic: Urgent: Removing tablespace
Next Topic: ORA-27121: unable to determine size of shared memory segment
Goto Forum:
  


Current Time: Wed Dec 07 22:30:48 CST 2016

Total time taken to generate the page: 0.08335 seconds