Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004
    Posts
    1

    ORA-28575: unable to open RPC connection to external procedure agent

    I am using Gentoo Linux with Oracle9i. I am trynig to execute external procedure. I wrote small lib which has to execute any given command (like ls ps etc), I placed it in /opt/oracle/product/oracle/lib/shell.o
    After that I made some steps in sql client:

    CREATE OR REPLACE LIBRARY shell_lib is '/opt/oracle/product/oracle/lib/shell.o';

    create or replace procedure shellas(cmd IN char) as external name "sh" library shell_lib language C parameters (cmd string);

    And when I am trying:
    exec shellas('ls');
    I get:
    BEGIN shellas('ls'); END;
    *
    ERROR at line 1:
    ORA-28575: unable to open RPC connection to external procedure agent
    ORA-06512: at "LRADVILA.SHELLAS", line 0
    ORA-06512: at line 1
    =======
    I tryed it from server sql client loged as sysdba, and with simple user from ather pc, and I am geting the same result.

    Config listings:
    Server TNSNAMES.ORA:
    Code:

    EXTPROC_CONNECTION_DATA=
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    )
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    )
    )

    MYDB =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = herkus.stml.lan)(PORT = 1521))
    )
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = mydb)
    )
    )



    Server LISTENER.ORA:
    Code:

    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    )
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = herkus.stml.lan)(PORT = 1521))
    )
    )
    )
    )

    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /opt/oracle/product/oracle)
    (PROGRAM = extproc)
    (ENVS = "EXTPROC_DLLS=ANY")
    )
    (SID_DESC =
    (GLOBAL_DBNAME = herkus.stml.lan)
    (ORACLE_HOME = /opt/oracle/product/oracle)
    (SID_NAME = mydb)
    )
    )



    Client TNSNAMES.ORA:
    ===
    Code:

    HERKUS =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = herkus.vtu.lt)(PORT = 1521))
    (CONNECT_DATA = (SID = mydb))
    )

    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    )
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    )
    )


    Some variables from server (export):
    LD_LIBRARY_PATH="/usr/lib:/opt/oracle/product/oracle/lib:/opt/oracle/product/oracle/ctx/lib"
    ORACLE_BASE="/opt/oracle"
    ORACLE_HOME="/opt/oracle/product/oracle"
    ORACLE_SID="mydb"
    ===
    Code:

    oracle@herkus $ lsnrctl start

    LSNRCTL for Linux: Version 9.2.0.1.0 - Production on 10-MAY-2004 00:42:40

    Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.

    Starting /opt/oracle/product/oracle/bin/tnslsnr: please wait...

    TNSLSNR for Linux: Version 9.2.0.1.0 - Production
    System parameter file is /opt/oracle/product/oracle/network/admin/listener.ora
    Log messages written to /opt/oracle/product/oracle/network/log/listener.log
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)) )
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=herkus.s tml.lan)(PORT=1521)))

    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)) )
    STATUS of the LISTENER
    ------------------------
    Alias LISTENER
    Version TNSLSNR for Linux: Version 9.2.0.1.0 - Production
    Start Date 10-MAY-2004 00:42:40
    Uptime 0 days 0 hr. 0 min. 0 sec
    Trace Level off
    Security OFF
    SNMP OFF
    Listener Parameter File /opt/oracle/product/oracle/network/admin/listener.ora
    Listener Log File /opt/oracle/product/oracle/network/log/listener.log
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)) )
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=herkus.s tml.lan)(PORT=1521)))
    Services Summary...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "herkus.stml.lan" has 1 instance(s).
    Instance "mydb", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully


    ===
    PS:
    Server real hostname is herkus.stml.lan (local) it is behind firewall which address is herkus.vtu.lt (global). Client is out side, but whit sqlplus I can work with no problems, because I have forwarded 1521 port.
    ===
    I have red a lot of explainings about this problem, i all of them is sugested to check TNSNAMES.ORA and LISTENER.ORA also variables. I did it a lot of times but it does not helped

  2. #2
    Join Date
    Oct 2004
    Posts
    1
    This shell.o of yours is a shared library or an object file ?
    Libraries use to be called *.so . If your module was not compiled as shared library than you can not call it from anywhere.
    I dont think You are stupid or what but maybe this is one of the problems.

    morti

  3. #3
    Join Date
    Jan 2012
    Posts
    1

    RPC - external procedures

    This post is kind of old, but I thought I'll post a comment and instruction how to set up a RPC connection to external procedures. This is done on a Oracle 11g XE database running on Oracle Linux 6.1 and gcc version 4.4.5

    - Create a shared module and place it in /u01/app/oracle/product/11.2.0/xe/lib directory
    cd /u01/app/oracle/product/11.2.0/xe/lib
    create a c-file that contains the following code:

    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>

    int extprocsh (char *cmd)
    {
    return system (cmd) ;
    }

    - Compile this c-script with the following command:
    gcc -fPIC extprocsh.c -shared -o extprocsh.so

    When the library is created without errors, you may delete your c-file.

    -Modify your listener.ora to:

    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTERNAL))
    )
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = yourhost)(PORT = 1521))
    )
    )
    )

    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = external)
    (ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
    (PROGRAM = extproc)
    (ENVS = "EXTPROC_DLLS= /u01/app/oracle/product/11.2.0/xe/lib/extprocsh.so
    ,LD_LIBRARY_PATH= /u01/app/oracle/product/11.2.0/xe/lib ")
    )
    (SID_DESC =
    (GLOBAL_DBNAME = yourdbname)
    (ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
    (SID_NAME=xe)
    )
    )

    - Modify your tnsnames.ora to:

    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTERNAL))
    )
    (CONNECT_DATA =
    (SID = external)
    (PRESENTATION = RO)
    )
    )

    XE =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = yourhost)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = XE)
    )
    )

    - Restart your listener after the modification

    - Log in as sysdba in your database and create a library and a procedure.
    SQL> create library extprocshell_lib AS '/u01/app/oracle/product/11.2.0/xe/lib/extprocsh.so';
    /

    SQL> create procedure shell (cmd in char)
    AS EXTERNAL
    NAME "extprocsh"
    LIBRARY extprocshell_lib
    LANGUAGE C
    PARAMETERS (cmd STRING);
    /

    - Test if everything is set up correctly:

    exec shell ('ls');

    And that's it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •