ArcSDE10.1配置Oracle 监听器来使用SQL操作ST_Geometry

以前我们也介绍了相关配置Oracle监听使用SQL操作ST_geometry

http://blog.csdn.net/linghe301/article/details/7102447

今天我们说说ArcSDE10.1的配置方法,因为ArcSDE10.1的安装与ArcSDE10的变化比较大,所以在配置SQL这一块Esri也做了很大的改变。大家都知道,ArcSDE10.1是使用ArcGIS10.1桌面直连创建Schema,那么在桌面文件里面都有相关的针对不同数据库以及操作系统的引用st_shapelib.dll文件

[python] view plain copy print ?
  1. C:\Program Files (x86)\ArcGIS\Desktop10.1\DatabaseSupport>dir  
  2.  驱动器 C 中的卷是 System  
  3.  卷的序列号是 A44A-A2B3  
  4.   
  5.  C:\Program Files (x86)\ArcGIS\Desktop10.1\DatabaseSupport 的目录  
  6.   
  7. 2012-06-12  17:02    <DIR>          .  
  8. 2012-06-12  17:02    <DIR>          ..  
  9. 2012-06-12  17:02    <DIR>          DB2zOS  
  10. 2012-06-12  17:02    <DIR>          Oracle  
  11. 2012-06-12  17:02    <DIR>          PostgreSQL  
  12.                0 个文件              0 字节  
  13.                5 个目录 21,026,869,248 可用字节  
  14.   
  15. C:\Program Files (x86)\ArcGIS\Desktop10.1\DatabaseSupport>cd Oracle  
  16.   
  17. C:\Program Files (x86)\ArcGIS\Desktop10.1\DatabaseSupport\Oracle>dir  
  18.  驱动器 C 中的卷是 System  
  19.  卷的序列号是 A44A-A2B3  
  20.   
  21.  C:\Program Files (x86)\ArcGIS\Desktop10.1\DatabaseSupport\Oracle 的目录  
  22.   
  23. 2012-06-12  17:02    <DIR>          .  
  24. 2012-06-12  17:02    <DIR>          ..  
  25. 2012-06-12  17:02    <DIR>          HPUX_IT64  
  26. 2012-06-12  17:02    <DIR>          IBMAIX64  
  27. 2012-06-12  17:02    <DIR>          Linux64  
  28. 2012-06-12  17:02    <DIR>          SunOS64  
  29. 2012-06-12  17:02    <DIR>          Windows64  
  30.                0 个文件              0 字节  
  31.                7 个目录 21,026,869,248 可用字节  
  32.   
  33. C:\Program Files (x86)\ArcGIS\Desktop10.1\DatabaseSupport\Oracle>cd Windows64  
  34.   
  35. C:\Program Files (x86)\ArcGIS\Desktop10.1\DatabaseSupport\Oracle\Windows64>dir  
  36.  驱动器 C 中的卷是 System  
  37.  卷的序列号是 A44A-A2B3  
  38.   
  39.  C:\Program Files (x86)\ArcGIS\Desktop10.1\DatabaseSupport\Oracle\Windows64 的目录  
  40.   
  41. 2012-06-12  17:02    <DIR>          .  
  42. 2012-06-12  17:02    <DIR>          ..  
  43. 2012-04-05  12:25         5,814,272 st_shapelib.dll  
  44.                1 个文件      5,814,272 字节  
  45.                2 个目录 21,026,869,248 可用字节  
C:\Program Files (x86)\ArcGIS\Desktop10.1\DatabaseSupport>dir
 驱动器 C 中的卷是 System
 卷的序列号是 A44A-A2B3

 C:\Program Files (x86)\ArcGIS\Desktop10.1\DatabaseSupport 的目录

2012-06-12  17:02    <DIR>          .
2012-06-12  17:02    <DIR>          ..
2012-06-12  17:02    <DIR>          DB2zOS
2012-06-12  17:02    <DIR>          Oracle
2012-06-12  17:02    <DIR>          PostgreSQL
               0 个文件              0 字节
               5 个目录 21,026,869,248 可用字节

C:\Program Files (x86)\ArcGIS\Desktop10.1\DatabaseSupport>cd Oracle

C:\Program Files (x86)\ArcGIS\Desktop10.1\DatabaseSupport\Oracle>dir
 驱动器 C 中的卷是 System
 卷的序列号是 A44A-A2B3

 C:\Program Files (x86)\ArcGIS\Desktop10.1\DatabaseSupport\Oracle 的目录

2012-06-12  17:02    <DIR>          .
2012-06-12  17:02    <DIR>          ..
2012-06-12  17:02    <DIR>          HPUX_IT64
2012-06-12  17:02    <DIR>          IBMAIX64
2012-06-12  17:02    <DIR>          Linux64
2012-06-12  17:02    <DIR>          SunOS64
2012-06-12  17:02    <DIR>          Windows64
               0 个文件              0 字节
               7 个目录 21,026,869,248 可用字节

C:\Program Files (x86)\ArcGIS\Desktop10.1\DatabaseSupport\Oracle>cd Windows64

C:\Program Files (x86)\ArcGIS\Desktop10.1\DatabaseSupport\Oracle\Windows64>dir
 驱动器 C 中的卷是 System
 卷的序列号是 A44A-A2B3

 C:\Program Files (x86)\ArcGIS\Desktop10.1\DatabaseSupport\Oracle\Windows64 的目录

2012-06-12  17:02    <DIR>          .
2012-06-12  17:02    <DIR>          ..
2012-04-05  12:25         5,814,272 st_shapelib.dll
               1 个文件      5,814,272 字节
               2 个目录 21,026,869,248 可用字节

那么我们在安装完毕之后,系统会自动将相关的引用dll写入到user_libraries文件里面

[python] view plain copy print ?
  1. SQL> select * from user_libraries;  
  2.   
  3. LIBRARY_NAME  
  4. ------------------------------  
  5. FILE_SPEC  
  6. --------------------------------------------------------------------------------  
  7. D STATUS  
  8. - -------  
  9. ST_SHAPELIB  
  10. c:\progra~2\arcgis\desktop10.1\DatabaseSupport\Oracle\Windows64\st_shapelib.dll  
  11. Y VALID  
SQL> select * from user_libraries;

LIBRARY_NAME
------------------------------
FILE_SPEC
--------------------------------------------------------------------------------
D STATUS
- -------
ST_SHAPELIB
c:\progra~2\arcgis\desktop10.1\DatabaseSupport\Oracle\Windows64\st_shapelib.dll
Y VALID

那么下一步比较熟悉的用户可能就配置相关的Oracle的Listener文件,引用dll了

但是今天我接到用户一个咨询,他们的监听是动态监听,是没有listener.ora文件的,那么这该怎么办呢?

如果用户的Oracle是11g我们可以使用其他办法来解决。

我们进入ORACLE_HOME/hs/admin,

[python] view plain copy print ?
  1. [oracle@redhat6 admin]$ pwd  
  2. /home/oracle/app/oracle/product/11.2.0/dbhome_1/hs/admin  
  3. [oracle@redhat6 admin]$ ls  
  4. extproc.ora  initdg4odbc.ora  listener.ora.sample  tnsnames.ora.sample  
[oracle@redhat6 admin]$ pwd
/home/oracle/app/oracle/product/11.2.0/dbhome_1/hs/admin
[oracle@redhat6 admin]$ ls
extproc.ora  initdg4odbc.ora  listener.ora.sample  tnsnames.ora.sample

打开extproc.ora

[python] view plain copy print ?
  1.   
  2. # extproc.ora is used by extproc in the default Oracle configuration.  
  3. #  
  4. # This is a sample extproc init file that contains a name-value(s) pair which  
  5. # is same as the value of ENVS parameter in listener.ora file.  
  6. #  
  7. # Syntax: SET name=value (environment variable name and value)  
  8.   
  9. # When specifying the EXTPROC_DLLS environment variable to restrict the DLLs   
  10. # that extproc is allowed to load, you may set EXTPROC_DLLS to one of the   
  11. # following values:  
  12.   
  13. # * ONLY (maximum security)   
  14. #  
  15. #   When EXTPROC_DLLS=ONLY:DLL[:DLL], only the specified DLL(s) can be loaded.  
  16.   
  17. #   Syntax: SET EXTPROC_DLLS=ONLY:DLL[:DLL]  
  18. #  
  19. # * NULL (the default value)  
  20. #  
  21. #   When EXTPROC_DLLS=, only the DLL(s) in $ORACLE_HOME/bin and ORACLE_HOME/lib  
  22. #   can be loaded.  
  23. #  
  24. #   Syntax: SET EXTPROC_DLLS=  
  25. #  
  26. # * Colon-seperated list of the DLLs  
  27. #  
  28. #   When EXTPROC_DLLS=DLL[:DLL], the specified DLL(s) and the DLLs in   
  29. #   $ORACLE_HOME/bin and ORACLE_HOME/lib can be loaded.  
  30.   
  31. #   Syntax: SET EXTPROC_DLLS=DLL:DLL  
  32. #  
  33. # * ANY   
  34. #   When EXTPROC_DLLS=ANY, DLL checking is disabled.  
  35.   
  36. #   Syntax: SET EXTPROC_DLLS=ANY  
  37. #  
  38. SET EXTPROC_DLLS=  
# 
# extproc.ora is used by extproc in the default Oracle configuration.
#
# This is a sample extproc init file that contains a name-value(s) pair which
# is same as the value of ENVS parameter in listener.ora file.
#
# Syntax: SET name=value (environment variable name and value)
# 
# When specifying the EXTPROC_DLLS environment variable to restrict the DLLs 
# that extproc is allowed to load, you may set EXTPROC_DLLS to one of the 
# following values:
# 
# * ONLY (maximum security) 
#
#   When EXTPROC_DLLS=ONLY:DLL[:DLL], only the specified DLL(s) can be loaded.
# 
#   Syntax: SET EXTPROC_DLLS=ONLY:DLL[:DLL]
#
# * NULL (the default value)
#
#   When EXTPROC_DLLS=, only the DLL(s) in $ORACLE_HOME/bin and ORACLE_HOME/lib
#   can be loaded.
#
#   Syntax: SET EXTPROC_DLLS=
#
# * Colon-seperated list of the DLLs
#
#   When EXTPROC_DLLS=DLL[:DLL], the specified DLL(s) and the DLLs in 
#   $ORACLE_HOME/bin and ORACLE_HOME/lib can be loaded.
# 
#   Syntax: SET EXTPROC_DLLS=DLL:DLL
#
# * ANY 
#   When EXTPROC_DLLS=ANY, DLL checking is disabled.
# 
#   Syntax: SET EXTPROC_DLLS=ANY
#
SET EXTPROC_DLLS=

我们可以看一下文件的相关说明,只需要修改一个地方

SET EXTPROC_DLLS=ANY即可

重启监听即可。(注意,这种方式只针对Oracle11g以上的版本

如果使用ANY,需要将相关的dll和So文件拷贝到$ORACLE_HOME/bin或者$ORACLE_HOME/lib里面

不过也可以参考后面的帮助文档,直接将相关的绝对物理路径给写上

对Linux操作系统来说,虽然创建SDE的SChema自动写入了user_libraries,但是因为这个引用路径肯定是不对的,需要将用户单独安装一下SDE软件或者将相关的引用so文件拷贝到Linux相关目录,然后修改user_libraries即可

[python] view plain copy print ?
  1. SQL> select * from user_libraries;  
  2.   
  3. LIBRARY_NAME  
  4. ------------------------------  
  5. FILE_SPEC  
  6. --------------------------------------------------------------------------------  
  7. D STATUS  
  8. - -------  
  9. ST_SHAPELIB  
  10. /home/oracle/sdeexe101/lib/libst_shapelib.so  
  11. Y VALID  
SQL> select * from user_libraries;

LIBRARY_NAME
------------------------------
FILE_SPEC
--------------------------------------------------------------------------------
D STATUS
- -------
ST_SHAPELIB
/home/oracle/sdeexe101/lib/libst_shapelib.so
Y VALID

如上所示。

-----------------------------------------------ArcGIS10.1帮助文档---------------------------------

如果您使用的是 Oracle 11g,请编辑 extproc.ora 文件以通过 Oracle 的外部过程框架来调用函数。如果您使用的是 Oracle 10g,请配置 Oracle 监听器。

Oracle 11g

对于 Oracle 11g,Oracle 建议您通过更改 extproc.ora 文件而不是配置监听器来配置 EXTPROC。extproc.ora 文件位于 ORACLE_HOME\hs\admin 目录中。

将 ST_Geometry (st_shapelib) 和/或 ST_Raster 库移动到您的 Oracle 服务器上之后,更改 extproc.ora 文件以指向库的位置。

在 Windows 服务器上,您可添加与以下类似的行:

 

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

 

 

EXTPROC_DLLS=ONLY:C:\\mylibraries\\libst_raster_ora.dll

 

如果您使用两个库,可将它们放在一行上:

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

 

在这些示例中,库放置在名为 mylibraries 的文件夹中,此文件夹在 Oracle 服务器上创建以存储库。

在 Linux 或 UNIX 服务器上:

 

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

 

 

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

 

如果您使用两个库,可将它们放在一行上:

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

 

在这些示例中,库放置在用户的 esrilibs 目录中,此目录在 Oracle 服务器上创建以存储库。

Oracle 10g

还是按照原来的方式修改LISENTER和TNSNAME文件

 -------------------------------------------------------------------------------------------------------
版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!
Blog:               http://blog.csdn.net/linghe301
Weibo:            http://www.weibo.com/linghe301

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

猜你喜欢

转载自ahut9923.iteye.com/blog/1988049