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: Start a program from wthin Oracle

Re: Start a program from wthin Oracle

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 29 Dec 2002 00:37:14 -0800
Message-ID: <92eeeff0.0212290037.26fcad57@posting.google.com>


"Moritz Klein" <mklein_at_students.uni-mainz.de> wrote in message news:<auljlm$4jj$1_at_bambi.zdv.Uni-Mainz.DE>...
> Hello NG,
> first of all the general information.
> I am using Windows 2000 Server and Oracle 9.2.
> I am wondering if it is possible in PL/SQL to start programs (like
> batch-scripts, perl-scripts an so on). I am designing an usermanagement with
> Oracle and DHCP/DNS. Our administrators use a webinterface to enter the
> user-information into the Oracle-DB. First we scheduled our scripts to run
> every hour but this brought some problems and i want the scripts to be run
> after every insert, update, or delete. If anyone does have a better solution
> i would be very thankful if told here.
>
> Thanks in advance
> Moritz Klein

To answer first part of your question...You can run external programs from PLSQL *BUT* it's not as easy as you may think it is. There are couple of ways that I can come up with.  

  1. Use external procedure call to interact with the OS. This basically means that you can use a Dll (Dynamic Link Library) to create and register a library in Oracle and use functions in that Dll which may run your scripts. If you do not already have a Dll that can do this then you may have to write one in C. Knowledge of C, Dll's and C compiler required. Furthermore, before running an external procedure, you would have to make some initial entries in tnsnames.ora and listener.ora files. Consult your 9i docs for this.
  2. Use Oracle's java cartridge to interact with the OS. Create a java stored procedure and call it from PLSQL. You would need to have knowledge of java and JNI (Java Native Interface) for this.

You have neglected to mention what excatly these scripts do? Do they run against Oracle or are used to do some other stuff outside of Oracle? It's hard to provide any alternate solutions without knowing the purpose of these scripts.

Regards
/Rauf Sarwar Received on Sun Dec 29 2002 - 02:37:14 CST

Original text of this message

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