[mapserver-users] OGR connection failed - OCI

Jeff McKenna jmckenna at gatewaygeomatics.com
Tue May 23 07:20:37 PDT 2017


On 2017-05-23 11:13 AM, GeoLady wrote:
> Hi,
>
> thank for your reply. I have tried your connect string format before.
> For connect string in this format CONNECTION "OCI:username/password at SID" I
> need TNS_ADMIN defined.
> Instant oracle client has no tnsnames.ora. I created one:
> <addressname> =
>  (DESCRIPTION =
>    (ADDRESS_LIST =
>      (ADDRESS = (PROTOCOL = TCP)(Host = <hostname>)(Port = <port>))
>    )
>  (CONNECT_DATA =
>    (SERVICE_NAME = <service_name>)
>  )
> )
>
> And I set environment variable>
> TNS_ADMIN=d:\oracle\instantclient_12_1-x64\network\admin\
> ORACLE_HOME=d:\oracle\instantclient_12_1-x64\
>
> When I do ogrinfo OCI:username/password at SID, I get error:
>
> C:\Users\admin>ogrinfo OCI:username/password at SID
> ERROR 1:  in <unnamed>
> ERROR 1:  in <unnamed>
> FAILURE:
> Unable to open datasource `OCI:username/password at SID' with the following
> drivers.
>   -> netCDF
>   -> AmigoCloud
>   -> OCI
>   -> PCIDSK
> ....
>
> So I deleted both environment variables and I used connect string
> format:"OCI:user/pass at host:port/SID"
> It works with ogrinfo OCI:user/pass at host:port/SID but it doesn't work with
> MapServer layer.
>
>
>

Please see my previous message, I believe your initial syntax is correct 
(sorry for my initial confusion).

It sounds to me like your web server is not loading that OGR dll.

For something working, you can try MS4W locally and then replicate that 
in another web server environment, as it has good documented steps for 
connecting to Oracle at 
http://ms4w.com/README_INSTALL.html#steps-to-enable-oracle-10g-or-11g-or-12c-support-in-ms4w

-jeff


-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/







More information about the mapserver-users mailing list