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: External procedure issue

Re: External procedure issue

From: <slezakp_at_my-deja.com>
Date: Thu, 21 Dec 2000 17:28:19 GMT
Message-ID: <91tej8$epj$1@nnrp1.deja.com>

In article <91s0uo$bk9$1_at_nnrp1.deja.com>,   slezakp_at_billmax.com wrote:
> Yet another question about external procedures.
>
> I have plugged in verbatim the example out of the PL/SQL programming
> book by O'Reilly and I still get the
>
> ORA-28575: unable to open RPC connection to external procedure agent
>
> I started a separate listener using
>
> LSNRCTL> start external_procedure_listener
>
> I turned on trace and saw absolutely no activity when I tried to
> connect.
> I even tried a "tnsping EXTPROC_CONNECTION_DATA"
> and saw no activity in the trace file. Instead I got
> TNS-03506: Failed to create address binding. Don't know if I should
> be able to tnsping this type of resource.
>
> For what it is worth, it is Intel Solaris 2.6, Oracle 8.1.6 with 128
 MB
> RAM.
>
> Thanks in advance for any help you can offer.
>
> Paul
>
> Here are the gory details:
>
> In listener.ora (The only stuff in listener.ora)-
>
> EXTERNAL_PROCEDURE_LISTENER =
> (ADDRESS_LIST =
> (ADDRESS =
> (PROTOCOL=IPC)
> (KEY=extproc)
> )
> )
>
> SID_LIST_EXTERNAL_PROCEDURE_LISTENER =
> (SID_LIST =
> (SID_DESC=
> (SID_NAME=extproc)
> (ORACLE_HOME=/u01/app/oracle/product/8.1.6)
> (PROGRAM=extproc)
> )
> )
>
> In tnsnames.ora (along with two database entries) -
>
> EXTPROC_CONNECTION_DATA =
> (DESCRIPTION =
> (ADDRESS = (PROTOCOL=IPC)
> (KEY=extproc)
> )
> (CONNECT_DATA =(SID=extproc)
> )
>
> And finally the stuff done in sqlplus:
>
> CREATE OR REPLACE LIBRARY libc_1
> AS
> '/lib/libc.so';
>
> CREATE OR REPLACE
> PACKAGE random_utl
> IS
> FUNCTION rand
> RETURN PLS_INTEGER;
> PRAGMA RESTRICT_REFERENCES (rand, WNDS, RNDS, WNPS, RNPS);
>
> PROCEDURE srand
> (seed IN PLS_INTEGER);
> PRAGMA RESTRICT_REFERENCES (srand, WNDS, RNDS, WNPS, RNPS);
>
> END random_utl;
> /
>
> CREATE OR REPLACE
> PACKAGE BODY random_utl
> IS
> /* Tested with: (1) Solaris 2.5.1 and Oracle 8.0.3
> || (2) Windows NT 4.0 and Oracle 8.0.3
> */
> FUNCTION rand RETURN PLS_INTEGER
> /* Return a random number between 1 and (2**16 -1), using
> || the current seed value
> */
> IS EXTERNAL
> LIBRARY libc_1
> NAME "rand"
> LANGUAGE C;
>
> PROCEDURE srand (seed IN PLS_INTEGER)
> /* Store a seed value used by external rand() function */
> IS EXTERNAL
> LIBRARY libc_1
> NAME "srand"
> LANGUAGE C
> PARAMETERS (seed ub4);
> END random_utl;
> /
>
> -- Now call the external function a few times
>
> SET SERVEROUTPUT ON SIZE 1000000
>
> DECLARE
> rnd_value PLS_INTEGER;
> seed PLS_INTEGER;
> BEGIN
> /* Generate a seed value from the current system time. */
> SELECT TO_CHAR(SYSDATE, 'SSSSS') INTO seed FROM DUAL;
>
> /* Call the srand external procedure to store our seed in memory.
 */
> random_utl.srand (seed);
>
> /* Now demonstrate some random numbers. */
> FOR v_cnt IN 1 .. 10 LOOP
> rnd_value := random_utl.rand;
> DBMS_OUTPUT.PUT_LINE ('rand() call #' || v_cnt ||
> ' returns ' || rnd_value);
> END LOOP;
> END;
> /
>
> Sent via Deja.com
> http://www.deja.com/
>

I solved the problem. Unfortunately I did two things at the same time so I am not sure
which solved it. However, for the record. I used the netasst tool to generate the listener.ora file. Note: the documentation says to use "plsextproc" for the SID, but the netasst program rejects it., so I used plsextp. The biggest difference I can see between my typing in the data and the generated files is that the generated file and
examples used lower case. I doubt it is case sensitive but who knows.

The second thing I did was stop and restart the database. I am more inclined to think that solved the problem.

Paul

Sent via Deja.com
http://www.deja.com/ Received on Thu Dec 21 2000 - 11:28:19 CST

Original text of this message

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