0 Replies Latest reply on Jul 26, 2013 9:41 PM by Jibba Jabba

    ORA-28595: Extproc agent : Invalid DLL Path

    Jibba Jabba

      Hello,

      I'm trying to run an external C program and am hitting the "Invalid DLL Path" error.

       

      C code fwiw:

      #include <stdlib.h>

      #include <stdio.h>

      #include <time.h>

      /* A test function */

      void foo()

      {

      }

      /* A log function */

      int log_text(char *arg)

      {

          FILE *f;

          char s[40];

          struct tm *ptm_now;

          time_t time_t_now;

          time_t_now = time(NULL);

          ptm_now = localtime(&time_t_now);

          (void)strftime(s, sizeof(s), "%a, %d %b %Y %H:%M:%S %Z", ptm_now);

          f = fopen("/tmp/extproc-logfile.txt", "a");

          fprintf(f, "%s : %s\n", s, arg);

          fclose(f);

          return(99);

      }

       

      compilation:

       

      cd /cygdrive/c/USERs/j/My Documents/SQL/c

      gcc -c -o test.o test.c

      gcc -shared -o test.so test.o

       

      CREATE LIBRARY, PROCEDURE:

      conn / as sysdba

      grant create library to scott;

      conn scott

      CREATE OR REPLACE LIBRARY C_LIB AS 'C:\Users\J\Documents\SQL\c\test.so';

      CREATE OR REPLACE PROCEDURE c_foo IS

          LANGUAGE C

          LIBRARY C_LIB

          NAME "foo";

       

      SCOTT@ORCL> select * from user_libraries;

       

       

      LIBRARY_NAME

      ------------------------------

      FILE_SPEC

      -----------------------------------------

      -----

      D STATUS

      - -------

      C_LIB

      C:\Users\J\Documents\SQL\c\test.so

      Y VALID

       

      It seems there are two places that you can specify EXTPROC_DLLS: in listener.ora (network\admin) and in extproc.ora (C:\oracleee\product\11.2.0\dbhome_1\hs\admin). I tried

       

      SET EXTPROC_DLLS=C:\\Users\\J\\Documents\\SQL\\c\\test.so

       

      in both (first with single slash then with double slash as seen in an example somewhere on the net) but then just resorted to

       

      ENVS = "EXTPROC_DLLS=ANY" in listener.ora and

       

      SET EXTPROC_DLLS=ANY in extproc.ora

       

      but still no joy.

       

      Can anybody help?

      Thanks in advance.