Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How can I call Unix commnad in pl/sql?

Re: How can I call Unix commnad in pl/sql?

From: Thomas Kyte <tkyte_at_oracle.com>
Date: 6 Mar 2002 17:22:30 -0800
Message-ID: <a66fcm01mrr@drn.newsguy.com>


In article <a6646c$1g7$1_at_bob.news.rcn.net>, "RKG" says...
>
>I saw a post by you on your site and on here... where you said to have a
>Unix process running in the background and to pipe a message to it to
>activate it.
>
>Why isnt that appropriate here?
>

it could be but it is not as "robust" as either

o using java
o using an extproc

there is alot of setup and dependencies in the pipe scenario (which I developed back in the v7.x days -- before extprocs and java in the db). If that pipe daemon isn't running -- neither is your host command and there is no way from inside the database to get the daemon started so your stuck. The java and extproc have no such issues.

>
>"Thomas Kyte" <tkyte_at_oracle.com> wrote in message
>news:a65emh025s1_at_drn.newsguy.com...
>> In article <8882aa3c.0203060729.100e2a8_at_posting.google.com>,
>andyho99_at_yahoo.com
>> says...
>> >
>> >Hello,
>> >
>> >I am trying to call UNIX command (such as cp) in my pl/sql program. I
>> >am using AIX. I think the syntax should be the same for for Unixs. Has
>> >anyone done this before and how? I was surprised that I could not find
>> >in Oracle's pl/sql manual. This should be a baisc requirement. C can
>> >do this pretty easy.
>> >
>> >Thanks, Andrew
>>
>> see
>>
>http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:952229840
>241
>> for one approach in 8i (sigh, never ever a version).
>>
>> In 8.0 you can use external procedures written in C.
>>
>> There are HUGE issues with this -- issues that just don't exist in "C" as
>"C" is
>> a general purpose programming language. First and foremost is that your
>plsql
>> is running as "Oracle" so the addition of a simple host command makes
>"rm -rf
>> /*.dbf" trivial (so be careful with this capability if you add it). "C"
>would
>> not be able to do that unless Oracle itself ran it (or you had it
>setuid())
>>
>> --
>> Thomas Kyte (tkyte@us.oracle.com) http://asktom.oracle.com/
>> Expert one on one Oracle, programming techniques and solutions for Oracle.
>> http://www.amazon.com/exec/obidos/ASIN/1861004826/
>> Opinions are mine and do not necessarily reflect those of Oracle Corp
>>
>
>

--
Thomas Kyte (tkyte@us.oracle.com)             http://asktom.oracle.com/ 
Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Wed Mar 06 2002 - 19:22:30 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US