Oracle11g配置st_geometry

环境:

Windows Server 2008R2、Oracle11.2.0.4、ArcGIS10.1

1、创建企业级数据库

通过ArcMap或者ArcCatalog注册企业级数据库,注册方式可以参考ArcGIS的官方文档,这里不做重点说明。

imageimage

创建过程如下可能看到如下信息,我们先进行跳过,点击完成即可,这样我们就可以在Oracle中管理空间数据了。

image

但是在部分通过sql直接操作空间数据的时候,可能仍会报相关错误。

2、进行测试

select sde.st_intersects(sde.st_point(11.1, 16.01, 4326),
                         sde.st_polygon('polygon ((10.01 20.01, 20.01 20.01, 20.01 15.04,10.01 15.04,10.01 20.01))',
                                        4326)) as test
  from dual;

image

提示缺少dll,为什么会这样呢,其实在创建企业级数据库时候的绿色提示已经告知我们了,这是因为ST_Geometry 的SQL函数使用通过Oracle外部过程代理(即 extproc)访问 Oracle 的共享库,如果需要使用这些内容,还需要进一步进行配置。

3、将st_shapelib.dll文件拷贝到Oracle安装目录BIN文件夹下

其中st_shapelib.dll可以从安装有Desktop的机器上拷贝,具体路径:D:Program Files (x86)ArcGISDesktop10.1DatabaseSupportOracleWindows64

Oracle目录下BIN文件夹具体路径:D:appAdministratorproduct11.2.0dbhome_1BIN

3、查看并修改st_shapelib.dll指向信息

select * from dba_libraries where library_name='ST_SHAPELIB';

image

如果不是我们拷贝的路径,请登录sde用户,修改路径指向我们拷贝的路径(D:appAdministratorproduct11.2.0dbhome_1BINst_shapelib.dll)

注意一定要在SDE用户下操作:

create or replace library st_shapelib as  'D:appAdministratorproduct11.2.0dbhome_1BINst_shapelib.dll';

最后可以执行先前的语句进行验证:

image

参考:

https://www.pianshen.com/article/7800870355/

https://desktop.arcgis.com/zh-cn/arcmap/latest/manage-data/gdbs-in-oracle/configure-oracle-extproc.htm

原文地址:https://www.cnblogs.com/Jingkunliu/p/14524729.html