[MS4W-Users] Oracle Unable to open datasource
Jeff McKenna
jmckenna at gatewaygeomatics.com
Wed May 30 14:48:54 EST 2012
Hi Simon,
I don't have your answer, but maybe seeing my own local steps (that I
just did right
now to test your issue) may help?
- I test against an Oracle 10g instance (10.2.0.1), which runs on a separate
machine. On my local machine, where MS4W 3.0.6 is installed, I have the
10.2.0.1 client installed. (yes, I suppose I should upgrade to 11g soon)
- For GDAL/MapServer connections I need the SID of the database I'll be
connecting to, so I have configured the SID in my local machine (MS4W
machine), such as:
GEO =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.106)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = GEO)
)
)
That file lives locally at:
D:\oracle\product\10.2.0\client_2\NETWORK\ADMIN\tnsnames.ora
Maybe a better example is at:
http://www.mapserver.org/input/vector/oracle.html#example-of-a-layer
- Now I can attempt to connect through OGR (I've moved the ogr_OCI.dll file
as you mentioned, and which is part of the instructions at
http://www.maptools.org/ms4w/index.phtml?page=README_INSTALL.html#oracle-10g-11g)
ogrinfo --formats
Supported Formats:
-> "OCI" (read/write)
-> "ESRI Shapefile" (read/write)
-> "MapInfo File" (read/write)
...
ogrinfo OCI:jeff/pass at geo
INFO: Open of `OCI:jeff/pass at geo'
using driver `OCI' successful.
1: ESP
2: GREF
3: GREF2
4: GRID50K
5: PARK
- Great, now I am ready to test through MapServer/OracleSpatial. I
moved the libmap.dll file as
mentioned in the instructions, then:
mapserv -v (response contained "INPUT=ORACLESPATIAL")
- my mapfile layer looks like:
LAYER
NAME "park-native"
TYPE POLYGON
STATUS DEFAULT
CONNECTIONTYPE oraclespatial
CONNECTION "jeff/pass at geo"
DATA "ORA_GEOMETRY FROM (SELECT ORA_GEOMETRY FROM PARK)"
CLASS
NAME "Parks"
STYLE
COLOR 255 255 0
OUTLINECOLOR 120 120 120
END
END
PROCESSING "CLOSE_CONNECTION=DEFER"
END # Layer
- shp2img returns a valid map image
Those are my steps. If you think I should upgrade to 11g for this testing
(if you think there is an 11g/MS4W issue) let me know and I will do so.
I am
not sure of what is wrong with your connection. I will keep thinking on
your issue.
-jeff
--
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/
On 12-05-30 3:18 PM, Simon Mercier wrote:
> Hi list
>
> I try to connect "ogrinfo" and Oracle in my ms4w install directory and
> it don't work? I still don't find out what's going on :-(
>
> 1) I use a the last ms4w 3.0.6 build.
>
> 2) I download the Oracle Instantclient 11.2.03 and set ORACLE_HOME. If
> I try to connect via sqlplus, everything work fine (I also try with a
> tnsnames.ora and work fine to)
>
> C:\..\ms4w306>sqlplus dt/dr2011 at LC/GEOSID
>
> SQL*Plus: Release 11.2.0.3.0 Production on Wed May 30 10:46:15 2012
>
> Copyright (c) 1982, 2011, Oracle. All rights reserved.
>
> Connected to:
> Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
> With the Partitioning, OLAP, Data Mining and Real Application Testing
> options
>
> SQL>
>
> 3) But for ogrinfo it just don't work. I moved the ogr_OCI.dll from
> ignored path to /ms4w306/gdalplugins and set all Environment variables.
> A formats option show that OCI driver is support:
>
>
> C:\..\ms4w306>ogrinfo --formats
> Supported Formats:
> -> "OCI" (read/write)
> -> "ESRI Shapefile" (read/write)
> -> "MapInfo File" (read/write)
> -> "UK .NTF" (readonly)
> ...
>
> C:\..\ms4w306>ogrinfo OCI:dt/dr2011 at LC/GEOSID
> ERROR 1: in <unnamed>
> FAILURE:
> Unable to open datasource `OCI:dt/dr2011 at LC/GEOSID' with the following
> driver
> s.
> -> OCI
> -> ESRI Shapefile
> -> MapInfo File
> -> UK .NTF
> -> SDTS
> ...
>
> 4) Same problem with mapserv and shp2img in my ms4w install dir. Where
> should I look now to make it run ?
>
More information about the MS4W-Users
mailing list