host comman on linux [message #480827] |
Wed, 27 October 2010 07:50 |
jai_g
Messages: 23 Registered: July 2009 Location: India
|
Junior Member |
|
|
My database as well as application on linux.
I want to excute this commond on linux.I need equivalent code.
host('cmd /c E:\data\temp\ITC1'.bat');
code of ITC1.bat is
echo off
sqlldr userid=user_name/pass@database control=E:\data\temp\ITC1.ctl log=E:\data\temp\log\ITC1.log
echo ........
control file as well as bat file exist in respective folders.
pl help me.
|
|
|
Re: host comman on linux [message #480833 is a reply to message #480827] |
Wed, 27 October 2010 08:13 |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
jai_g wrote on Wed, 27 October 2010 08:50My database as well as application on linux.
I want to excute this commond on linux.I need equivalent code.
host('cmd /c E:\data\temp\ITC1'.bat');
code of ITC1.bat is
echo off
sqlldr userid=user_name/pass@database control=E:\data\temp\ITC1.ctl log=E:\data\temp\log\ITC1.log
You'll have to change it to use the correct path for linux.
Remove the "cmd /c" part.
I do not see how this could have worked for you as te quotes are unbalanced.
You also have to use the correct path in the shell script.
The shell script has to be executable (chmod 755).
|
|
|
|
Re: host comman on linux [message #480843 is a reply to message #480837] |
Wed, 27 October 2010 09:14 |
jai_g
Messages: 23 Registered: July 2009 Location: India
|
Junior Member |
|
|
Dear,
I tried duly removing "CMD /C", but there is no data loaded in the table.
The host commond is "host('cmd /c E:\data\temp\ITC1.bat');".
|
|
|
|
|
Re: host comman on linux [message #480856 is a reply to message #480844] |
Wed, 27 October 2010 14:22 |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
1. That shell script will have the have execute rights on it (chmod 755).
2. That shell script will have to give linux paths, not windows paths.
3. That shell script will probably have to have ORACLE_HOME, PATH and ORACLE_SID set. Calling an additional shell may not know any of your environment variables.
4. you may need to give full literal path for sqlldr
|
|
|
|
Re: host comman on linux [message #480915 is a reply to message #480869] |
Thu, 28 October 2010 02:26 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
There's lots of things that can go wrong here so:
1) If you call sqlloader directly on the linux box does it work?
2) If you call the shell script directly does it work?
|
|
|
Re: host comman on linux [message #480945 is a reply to message #480915] |
Thu, 28 October 2010 07:11 |
jai_g
Messages: 23 Registered: July 2009 Location: India
|
Junior Member |
|
|
I was sucess.
I insert in begining of shell script as
#!/bin/bash
export ORACLE_SID=my_sid
export ORACLE_HOME=my_home
export PATH=my_home/bin.
thanks for all helping me
|
|
|