external procedures (ORA-28595: Extproc agent : Invalid DLL Path)
594974Dec 4 2007 — edited Dec 6 2007Hi all
Please help me sorting out this error. i have tried a lot n studied a lot material over net but still i'm not able to find out what is the cause for this error.
oracle version: 10.2.0.1.0
os : Windows XP
i have created a package and when i try to run query through this package error occurs:
4. ==================================================
1 DECLARE
2 rnd_value PLS_INTEGER;
3 seed PLS_INTEGER;
4 BEGIN
5 SELECT TO_CHAR(SYSDATE, 'SSSSS') INTO seed FROM DUAL;
6 random_utl.srand (seed);
7 FOR v_cnt IN 1 .. 10 LOOP
8 rnd_value := random_utl.rand;
9 DBMS_OUTPUT.PUT_LINE ('rand() call #' || v_cnt ||' returns ' || rnd_value);
10 END LOOP;
11* END;
12 /
DECLARE
*
ERROR at line 1:
ORA-28595: Extproc agent : Invalid DLL Path
ORA-06512: at "SYS.RANDOM_UTL", line 10
ORA-06512: at line 6
====================================================
this is what i have done
1. ==================================================
CREATE OR REPLACE LIBRARY libc_l
AS
'c:\windows\system32\crtdll.dll';
/
2. ==================================================
CREATE OR REPLACE PACKAGE random_utl
AS
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;
/
3. ==================================================
CREATE OR REPLACE PACKAGE BODY random_utl
AS
FUNCTION rand RETURN PLS_INTEGER
IS
EXTERNAL -- tell PL/SQL that this is an external procedure
LIBRARY libc_l -- specify the library that we created above
NAME "rand" -- function's real name is lowercase
LANGUAGE C; -- we are calling a function written in C
PROCEDURE srand (seed IN PLS_INTEGER)
IS
EXTERNAL
LIBRARY libc_l
NAME "srand" -- srand (lowercase) is function's real name
LANGUAGE C
PARAMETERS (seed ub4); -- map to unsigned four-byte integer
END random_utl;
/
END =================================================
After studying a lot i found out that there's problem in Listener.ora or Tnsnames.ora. So here's both of files:
Listener.ora ============================================
LISTENER =
(ADDRESS_LIST =
(ADDRESS= (PROTOCOL= IPC)(KEY=EXTPROC))
(ADDRESS= (PROTOCOL= TCP)(HOST=ddc01-01-291.GDNINDIA.COM)(PORT=1521))
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = DB)
)
(SID_DESC =
(SID_NAME = PLSExtProc)
(PROGRAM = extproc)
(PROGRAM = extproc)
(ENVS="EXTPROC_DLLS=ANY")
)
)
STARTUP_WAIT_TIME_LISTENER_PROC = 0
CONNECT_TIMEOUT_LISTENER_PROC = 10
TRACE_LEVEL_LISTENER_PROC = OFF
End Listener.ora ========================================
Tnsnames.ora ==========================================
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
(CONNECT_DATA = (SID = PLSExtProc)(SERVER=DEDICATED))
)
DB=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(Host = LOCALHOST)(Port = 1521))
(CONNECT_DATA = (SID = DB))
)
End Tnsnames.ora =======================================
I will be a lot thankful for any solution regarding this.
Thanks
aps
I am surprised to see that no one has solution to my problem. This happened first time, genius people had always helped me in many problems. but now, not even a single reply....????
Message was edited by:
aps