Re: Executing UNIX commands from Oracle
Date: Fri, 24 Feb 1995 23:06:08 GMT
Message-ID: <jhalpinD4J1I8.M2C_at_netcom.com>
In article <Thomas.B.Cox.28.2F4E4DCB_at_tek.com> Thomas.B.Cox_at_tek.com (Thomas B Cox) writes:
>>>[...] can i [...] have a stored procedure actually execute
>>>operating system commands?
>>You could not do this directly, as far as I know. The only thing I can think
>>of is to use the ORACLE database pipe packaged procedures to set up
>>a client-server type arrangement. I haven't got the manuals to hand but the
>>concept is that :-
>> 1) A server process (implemented in Pro*C for example) listens on a pipe
>> 2) your stored procedure passes the script details down the pipe
>> 3) the server uses the system() call to execute the script
>
>Step 1 is not as easy as it looks. I recommend using the DBMS_ALERT package.
>(Otherwise you're running a resource-intensive loop of constantly trying to
>grab stuff out of the pipe even when it's empty, which may be most of the
>time.)
The program on the listening end of either the DBMS_PIPE or DBMS_ALERT is blocked waiting for input - no busy loop is required either way.
The difference between the pipe and the alert is that the alert is transaction oriented and won't happen if the transaction doesn't complete.
Joe
-- Joe Halpin jhalpin_at_netcom.com ---------------------------------------------------------------------------Received on Sat Feb 25 1995 - 00:06:08 CET