Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL calling external procedures
"Thomas Kyte" <tkyte_at_us.oracle.com> wrote in message
news:a2037l0lor_at_drn.newsguy.com...
> In article <1011037625.323292_at_adsl.fast.net.uk>, "Jeremy says...
> >
> >Hello, I am aware of the ability to call o/s processes as an external
> >procedure.
> >
> >What I would like to be able to do is execute a program on the server but
> >initiated by pl/sql procedure - does the external procedure have to be
> >written in 'c' (as I believe is the case) or could one call e.g. a shell
> >script (as I am hoping but not betting on it!)
> >
> >thanks folks
> >
> >
> >--
> >Jeremy
> >
> see
>
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:952229840
241
> for another way to do it.
>
> external procedures in C are written in C, you would have to write a small
bit
> of C (or java as the above shows) to accomplish this.
>
Hi
I followed the example shown there and that's implemented on my system no problem. I then tried to substitute a shell command instead of the 'ps -ef' however when I run it with my command
17:09:01 SQL> exec rc('/export/home/oracle/testdocs/textext.sh');
PL/SQL procedure successfully completed.
real: 60
17:09:31 SQL>
It doesn't actually do anything though. Permissions are set on the script to
755 and it executes ok from within a normal shell.
If I misspell the script name I get a Java error message (java.security.AccessControlException:) so it seems that some of what I have done is correct.
Clearly I have a gap in my knoweledge here and could do with some help. It still wasn't clear to me whether the remote proc has to be a 'c' or java program or whether a shell script (basically something the o/s can execute) is OK - if the former, then I presume that is why I am unsuccessful in making the above work.
Thanks...
Jeremy
Received on Tue Jan 15 2002 - 11:36:22 CST