Oracle Net Services to use ST_Geometry SQL functions

 

racle Net Services to use ST_Geometry SQL functions

Oracle中使用ST_GeometrySQL  functions可以实现使用通过Sql语句来操作和维护空间数据的功能,所以在一些不想按照AO类库通过AO接口来操作空间数据的地方,这个会很有用,从性能和架构的考虑上,这个也是很有必要的考虑。但按照完SDE,即使通过ArcGIS Desktop可以正常对空间数据库进行访问、修改都是可以的。但一运行报找不到外部程序的错误,错误如下:

Windows系统:

ORA-28595: Extproc agent : Invalid DLL Path.

Windows系统:

ORA-06520: PL/SQL: Error loading external library

ORA-06522:      0509-022 Cannot load module

/home/sde/sdeexe93/lib/libst_shapelib_64.so.

0509-150   Dependent module libsg_64.so could not be loaded.

0509-022 Cannot load module libsg_64.so.

0509-026 System error: A file or directory in the path name does not exist.

0509-022 Cannot load module /home/sde/sdeexe93/lib/libst_shapelib_64.so.

0509-150   Dependent module /home/sde/sdeexe93/lib/libst_shapelib_64.so could

not be loaded.

原因:

要使用OracleST_Geometry这种空间存储类型的SQL functions,它是通过扩展oracleexternal procedure agent或者extproc来实现的。因此需要在Oracle监听中添加外部程序的路径。修改listener.oratnsnames.ora如下:

listener.ora

windows

 

LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS_LIST =

        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))

      )

      (ADDRESS_LIST =

        (ADDRESS = (PROTOCOL = TCP)(HOST = vmserver)(PORT = 1521))

      )

 

    )

  )

 

SID_LIST_LISTENER =

  (SID_LIST =

    (SID_DESC =

      (SID_NAME = PLSExtProc)

      (ORACLE_HOME = C:\oracle\ora92)

(ENVS="EXTPROC_DLLS=C:\ArcSDE\sdeexe93\bin\st_shapelib.dll,PATH=C:\ArcSDE\sdeexe93")(添加的环境变量,记得一定不要忘了PATH环境变量)

      (PROGRAM = extproc)

    )

    (SID_DESC =

      (GLOBAL_DBNAME = orcl)

      (ORACLE_HOME = C:\oracle\ora92)

 

windows

有关ENVS ESRI帮助上的说明:This is a list of environment variables that the extproc uses when it runs. The list is: delimited. This list must include a definition of the environment variable EXTPROC_DLLS (see below) and any other environment variable the extproc needs when it runs, often including LD_LIBRARY_PATH, SHLIB_PATH, or LIBPATH on UNIX and Linux systems or PATH on Windows servers. The path variable often includes the location of the Geometry and Projection Engine libraries.

 

(ENVS = "EXTPROC_DLLS=/home/sde/sdeexe93/lib/libst_shapelib_64.so", LIBPATH= /home/sde/sdeexe93/lib)

提醒:千万不要忘了后面那个Lib的环境变量。

 

tnsnames.ora

EXTPROC_CONNECTION_DATA =

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))

    )

    (CONNECT_DATA =

      (SID = PLSExtProc)

      (PRESENTATION = RO)

    )

  )

 

两个文件添加过程中,要保证KEY值是一样的!
修改完成后需要重启监听,在命令行输入Lsnrctl stop , Lsnrctl start .

 

 

PS: (ENVS = EXTPROC_DLLS=ANY) 也可以。具体看下面的描述。

he optional keywords ANY and ONLY can be used to loosen or restrict the way the extproc uses library files. If you preface the path with ANY, Oracle can load any libraries from the specified path and you don't have to provide a library name. If you preface the path with ONLY, Oracle will only use the specific library you provide in the path.

还有:Linux,Unix下要把$SDEHOME/lib目录添加到oracle用户下的.profile或者.bash_profile的相关环境变量中。


posted @ 2011-05-31 15:31  zhh  阅读(436)  评论(0编辑  收藏  举报