st_geometry is not available in oracle [ORA-28575: cannot open RPC connection to external procedure agent]

Configure Oracle extproc to access the geodatabase using SQL

In Oracle, the SQL functions of ST_Geometry and ST_Raster use shared libraries accessed through Oracle's external procedure proxy (ie, extproc). To use SQL with ST_Geometry or ST_Raster or to access ArcSDE XML columns in the GDB_ITEMS_VW and GDB_ITEMRELATIONSHIPS_VW views, Oracle must be able to access these libraries. Therefore, these libraries must exist on the Oracle server, and they must be called through Oracle's external procedure framework.

In ArcGIS, ST_Geometry and ST_Raster can be used without setting up Oracle extproc. However, you will not have the full functionality of the ArcGIS client, nor will you have any functionality of the SQL client (eg SQL*Plus). For example, if extproc is not configured, you cannot use SQL functions on ST_Geometry columns in ArcMap's query layers, cannot identify features in database views, cannot version tables that contain ST_Raster columns, cannot delete rows that include ST_Raster columns, Feature services containing ST_Geometry data cannot be published, nor can SQL functions be executed from SQL clients.

Note:

If your Oracle database is installed on a Windows server, you may need to install the Microsoft Visual C++ 2008 SP1 Redistributable Package (x64). If the Microsoft Visual C++ 2008 SP1 Redistributable Package (x64) is not available on the Oracle server, it can be downloaded from the Microsoft website and installed.

If you are using Oracle 11g or 12c, edit the extproc.ora file to call functions through Oracle's external procedure framework. If you are using Oracle 10g, configure the Oracle listener.

Oracle 11g 和 12c

For Oracle 11g and 12c, Oracle recommends that you configure extproc by changing the extproc.ora file instead of configuring the listener. The extproc.ora file is located in the ORACLE_HOME\hs\admin directory.

  1. Create a backup copy of the extproc.ora file on the Oracle server.
  2. Open the extproc.ora file and change it to point to the location of the ST_Geometry (st_shapelib) and/or ST_Raster libraries.

    In this example, the following line has been added on the Windows server to point to the ST_Geometry library in a folder named mylibraries:

    SET EXTPROC_DLLS=ONLY:C:\\mylibraries\\st_shapelib.dll

    If you are using both the ST_Geometry and ST_Raster libraries, put the entries for both on the same line:

    SET EXTPROC_DLLS=ONLY:C:\\mylibraries\\st_shapelib.dll;C:\\mylibraries\\libst_raster_ora.dll

    In this example, the following line has been added on the Linux or UNIX server to point to the ST_Geometry library in the user's esrilibs directory, which was created on the Oracle server to store the library:

    SET EXTPROC_DLLS=ONLY:/user/esrilibs/libst_shapelib.so

    If you are using both the ST_Geometry and ST_Raster libraries, put the entries for both on the same line:

    SET EXTPROC_DLLS=ONLY:/user/esrilibs/libst_shapelib.so:/user/esrilibs/libst_raster_ora.so

  3. Save and close the extproc.ora file.
  4. All clients that need access to the library (including web services) must reconnect to the database.

Oracle 10g

One of the most important aspects of configuring listeners is to tell extproc where to find shared libraries. The listener configuration needs to be modified to specify the location of the shared library and restart the Oracle listener process for the configuration changes to take effect.

This document refers to two standard Oracle listener configuration files: tnsnames.ora and listener.ora. These two files are usually located in ORACLE_HOME/net/admin. This document describes the required configuration settings.

There are several ways to manage settings. Text files can be edited with a text editor, using Oracle Net Manager, or using Oracle Net Configuration Assistant. Oracle provides documentation on how to configure listeners. For more information, see the Oracle Database Network Services Administrator's Guide.

The tnsnames.ora file contains directories for known database services. This file can define services on a local database or a remote server. There is an entry for the local database server to send function calls to extproc via inter-process communication (IPC). This entry is labeled EXTPROC_CONNECTION_DATA. The Key and SID values ​​under this entry can be changed.

These items are used to link the entry to the corresponding information in the listener.ora file. The name of the key can be any abbreviated name, but it must have the same name in the listener.ora file and the tnsnames.ora file. These values ​​are case sensitive. Only listener processes can use these values, not users or applications.

The listener.ora file describes some (not necessarily all) services that the listener listens for for requests.

The values ​​that can be changed in this file include:

  • SID_LIST_LISTENER

    This annotation is the beginning of the list of SIDs to be processed by the listener named LISTENER (the default listener name).

  • SID_LIST 和 SID_DESC

    The SID_DESC entry under the heading SID_LIST is used to define the service. The first entry in the list handles extproc requests and the second entry handles client sessions.

  • SID_NAME

    Its value must correspond to the SID specified for extproc in the file tnsnames.ora.

  • ORACLE_HOME

    Defines the location of the Oracle home page for this service. Load the extproc program files from the folder under this location.

  • PROGRAM

    Specifies the filename of the extproc executable. This case-sensitive name may be extproc or extproc.exe, depending on the type of operating system. The files are located in ORACLE_HOME/bin.

  • ENVS

    This is a list of environment variables used by extproc at runtime. Lists are separated by colons. This list must include definitions of the environment variable EXTPROC_DLLS and any other environment variables that extproc needs at runtime, typically LD_LIBRARY_PATH, SHLIB_PATH, or LIBPATH on UNIX and Linux systems, or PATH on Windows servers. Path variables usually include the location of the geometry and projection engine libraries.

  • EXTPROC_DLLS

    This environment variable is used to define a list of libraries from which extproc can directly load and call functions. The path to the file containing the following libraries must be specified here: the shape library for SQL access to the ST_Geometry type or the GDB_ITEMS_VW and GDB_ITEMRELATIONSHIPS_VW views; the st_raster library for SQL access to the ST_Raster type.

    For Oracle servers installed on UNIX, the list is separated by colons, and for Oracle servers installed on Windows, the list is separated by semicolons. All paths must be absolute and point to a local directory, or a UNC path accessible to Oracle system users. This also means that if you have installed the ArcSDE application server on a non-Oracle server, you must copy the shape and raster libraries from the bin directory in SDEHOME to the Oracle server.

    There is no environment variable substitution.

    The optional keywords ANY and ONLY can be used to relax or restrict the way extproc uses library files. If you put ANY in front of the path, Oracle can load any library from the specified path without having to provide the library name. If you put ONLY in front of the path, Oracle will only use the specific library provided in the path.

  • KEY

    The value set for this entry links this listener to the corresponding service entry in the file tnsnames.ora. This value distinguishes this listener from other IPC listeners that may exist on the same database server. key can be any name abbreviation, but must be the same in the files listener.ora and tnsnames.ora. key is case sensitive.

  1. Before making any changes, back up the tnsnames.ora and listener.ora files.
  2. Open the tnsnames.ora file on the Oracle server.
  3. Change the Key and SID values ​​under EXTPROC_CONNECTION_DATA in the tnsnames.ora file.

    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(Key = EXTPROC1))
        )
        (CONNECT_DATA =
          (SID = PLSExtProc)
          (PRESENTATION = RO)
        )
    )

    This entry must always have the annotation EXTPROC_CONNECTION_DATA. This entry is used by the database server to send function calls to extproc through interprocess communication.

  4. Save the changes and close the tnsnames.ora file.
  5. Open the listener.ora file on the Oracle server.
  6. Change the desired entry to set the server whose requests the listener will accept.

    The first example is for the Windows operating system, the ST_Geometry and ST_Raster libraries are located in a folder called gislibs:

    LISTENER =
    (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS = (PROTOCOL = TCP)(HOST = svr1.dmn1.com)(PORT = 1521))
        )
     )
    
    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (SID_NAME = PLSExtProc)
          (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
          (PROGRAM = extproc)
             (ENVS="EXTPROC_DLLS=C:\gislibs\st_shapelib.dll;C:\gislibs\libst_raster_ora.dll")
     )  
    )

    This example shows an entry for a Linux or UNIX server with the ST_Geometry and ST_Raster libraries stored in  /arcgis/libs :

    LISTENER =
    (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS = (PROTOCOL = TCP)(HOST = svr1.dmn1.com)(PORT = 1521))
        )
    )
    
    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /servit/oracle/product/10.2.0/db_1)
          (PROGRAM = extproc)
             (ENVS="EXTPROC_DLLS=/arcgis/libs/libst_shapelib.so:/arcgis/libs/libst_raster_ora.so")
        )
       )
  7. After changing and saving the listener.ora file, restart the Oracle listener.

  • When the 11G oracle is not configured according to the 11g method, please use the 10g method for configuration.
  • When "DLL is invalid", please copy st_shapelib.dll to any directory, and then " add ST_Geometry type to Oracle database ", and reconfigure oracle exproc.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325774649&siteId=291194637