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

Home -> Community -> Usenet -> c.d.o.server -> Re: LD_LIBRARY path for external procedures in Oracle

Re: LD_LIBRARY path for external procedures in Oracle

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Tue, 28 Jul 1998 20:02:22 GMT
Message-ID: <35be2df3.6687275@192.86.155.100>


A copy of this was sent to dspindler_at_my-dejanews.com (if that email address didn't require changing) On Tue, 28 Jul 1998 18:00:31 GMT, you wrote:

>We are running oracle 8.0.4 Enterprise server under solaris. We are trying to
>pass new data to an external program when it is inserted or modified. To do
>this I created a trigger and had it call an external procedure which sends
>the data via a socket to the external program. Oracle has no problem calling
>the external procedure, but when we add the sockets it stops working becasue
>the LD_LIBRARY variable is not set correctly. How do you change the value
>Oracle uses when it calls external procedures in .so files.
>
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum

The external procedure agent is spawned by the listener. The spawned process runs in clean environment which will have only a few platform and Oracle specific environment variables set (e.g. ORACLE_SID, ORACLE_HOME, TNS_ADMIN).   It is possible to use system calls in your C routines to set and get additional environment variables.  

If you want the extproc process to start in an environment which has more than the above mentioned environment variables set, you will have to add the following name value pair to the listener.ora entry of the extproc process:  

(ENVS=envvar1=myvalue1,envvar2=myvalue2)  

Thus, to set the environment variables DISPLAY to my_machine:0.0, and to set EDITOR to vi for the external procedure process with ORACLE_SID extproc, the external procedure entry in listener.ora would look like:  

(SID_DESC=

  (SID_NAME=extproc) 
  (ENVS=DISPLAY=my_machine:0.0,EDITOR=vi) 
  (ORACLE_HOME=/home/oracle) 
  (PROGRAM=extproc) 

)

I haven't tried that for LD_LIBRARY_PATH myself, but it might work...    

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Tue Jul 28 1998 - 15:02:22 CDT

Original text of this message

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