Home » SQL & PL/SQL » SQL & PL/SQL » Need Help: Calling shell script through external procedure
Need Help: Calling shell script through external procedure [message #205649] Sun, 26 November 2006 23:40 Go to next message
soumikoracle
Messages: 1
Registered: November 2006
Location: bangalore
Junior Member

Hi All,

I am trying to call a shell script through external procedure. To summarize the steps that I followed:

Placed the library file,i.e., the .so file in bin folder of the database server. I have not compiled the .c file and created this. I have taken this from another application.

Then I logged into the sqlplus. Created one library pointing this .so file.

create or replace library ext_proc as '/ngs/app/ivndrptd/bin/execute_cmdlib.so';

After this created the external procedure. This got compiled without any errors.

SQL> create or replace procedure ext_proc_wrapper(in_script IN varchar2)
as external
library ext_proc
NAME "execute_cmd"
parameters (in_script string);
/

Procedure created.

I am trying to execute a script test.ksh which contains a touch command to create a test.txt file.

However irrespective of the procedure running successfully the script is not getting called. I tried several ways of calling the script which are as follows

SQL> exec ext_proc_wrapper('sh /ngs/app/ivndrptd/test.sh');

PL/SQL procedure successfully completed.

SQL>

SQL> exec ext_proc_wrapper('/ngs/app/ivndrptd/test.sh');

PL/SQL procedure successfully completed.

SQL>

SQL> exec ext_proc_wrapper('/ngs/app/ivndrptd/test.ksh');

PL/SQL procedure successfully completed.

SQL>

Can any body please let me know where I am going wrong?

I will be thankful if somebody helps me in this regard.

Thanks & Regards,
Soumik Ghosh
Re: Need Help: Calling shell script through external procedure [message #205807 is a reply to message #205649] Mon, 27 November 2006 12:34 Go to previous messageGo to next message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
I'm not sure - but think you need to configure your server's listener for the external procedure. The way external commands are run is usually using a Java stored proc.
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:952229840241
Re: Need Help: Calling shell script through external procedure [message #588773 is a reply to message #205649] Fri, 28 June 2013 05:01 Go to previous messageGo to next message
Yuvraaj
Messages: 122
Registered: January 2011
Location: California, USA
Senior Member
Hi,

I'm facing the same, the above link is not opening. Can any one share a link to resolve the issue.

Thanks in advance.


Thanks,
YJ
Re: Need Help: Calling shell script through external procedure [message #588816 is a reply to message #588773] Fri, 28 June 2013 10:49 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Oracle version?

Regards
Michel
Re: Need Help: Calling shell script through external procedure [message #588998 is a reply to message #588816] Mon, 01 July 2013 05:00 Go to previous messageGo to next message
Yuvraaj
Messages: 122
Registered: January 2011
Location: California, USA
Senior Member
Sorry for late response!

Version: 11.2.0.3.0
Re: Need Help: Calling shell script through external procedure [message #589006 is a reply to message #588998] Mon, 01 July 2013 07:17 Go to previous message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You can use DBMS_SCHEDULER feature for that.

Regards
Michel
Previous Topic: REPLACING DOUBLE SPACES WITH SING SPACE AND REMOVING UNWANTED CHARACTERS
Next Topic: how print the multiple output statements in single output
Goto Forum:
  


Current Time: Fri Dec 02 18:45:17 CST 2016

Total time taken to generate the page: 0.23163 seconds