[MS4W-Users] Oracle - Unable to open datasource

Smith, Michael ERDC-CRREL-NH Michael.Smith at usace.army.mil
Wed May 30 19:22:06 EST 2012


Jeff,

I tested out ms4w with the 11gR2 Instant Client (it was the full client
installer and I just installed the instant client). I had no problems
accessing and oracle database.

Note that I did not use a TNS connection. I used the Oracle EZConnect
syntax, which is username/password at servername:port/service_name. Note that
the port can be dropped if it is the default 1521. I moved the ogr_OCI.dll
file to the C:\ms4w\gdalplugins directory. Then verified that the Oracle
client was on the path.

----
Test run


C:\ms4w>set
Path=C:\app\Administrator\product\11.2.0\client_1;C:\WINDOWS\system32;C:\WI
NDOWS
...

C:\ms4w>setenv.bat
GDAL, mapserv, mapcache, PROJ, and shapelib dll
GDAL_DATA path set
GDAL_DRIVER_PATH set
PROJ_LIB set
CURL_CA_BUNDLE set
C:\ms4w>ogrinfo --formats
Supported Formats:
  -> "OCI" (read/write)
  -> "ESRI Shapefile" (read/write)
 ...
 
   -> "SEGY" (readonly)

C:\ms4w>ogrinfo 
oci:myuser/mypass at dbname.army.mil/servicename.army.mil:esri.states
INFO: Open of 
`oci:myuser/mypass at dbname.army.mil/servicename.army.mil:esri.states'
      using driver `OCI' successful.
1: esri.states

C:\ms4w>set CPL_DEBUG=on

C:\ms4w>ogrinfo 
oci:myuser/mypass at dbname.army.mil/servicename.army.mil:esri.states
OGR: Auto register \ms4w\gdalplugins\ogr_OCI.dll using RegisterOGROCI.
OCI: Userid=myuser, Password=mypass,
Database=dbname.army.mil/servicename.army.mil
OCI: Prepare(ALTER SESSION SET NLS_DATE_FORMAT='YYYY/MM/DD'
NLS_TIME_FORMAT='HH24:MI:SS' NLS_TIME_TZ_FORMAT='HH2
4:MI:SS TZHTZM'         NLS_TIMESTAMP_FORMAT='YYYY/MM/DD HH24:MI:SS'
  NLS_TIMESTAMP_TZ_FORMAT='YYYY/MM/DD HH24:MI
:SS TZHTZM')
OCI: Prepare(SELECT COUNT(*) FROM ALL_SDO_GEOM_METADATA u,
TABLE(u.diminfo) t  WHERE u.table_name = 'states' AND u.colu
mn_name = 'SHAPE')
OCI: get dim based of existing data or index failed.
OCI: Prepare(SELECT SRID FROM ALL_SDO_GEOM_METADATA WHERE TABLE_NAME =
UPPER('states') AND COLUMN_NAME = UPPER('SHAPE')
AND OWNER = 'esri')
OGR: 
OGROpen(oci:myuser/mypass at dbname.army.mil/servicename.army.mil:esri.states/
022F38D8) succeeded as OCI.

INFO: Open of 
`oci:myuser/mypass at dbname.army.mil/servicename.army.mil:esri.states'
      using driver `OCI' successful.

-- 
Michael Smith

US Army Corps
Remote Sensing GIS/Center





On 5/30/12 4:18 PM, "Jeff McKenna" <jmckenna at gatewaygeomatics.com> wrote:

>With Mike's debug trick I do see more info when I pass a bad SID to
>OGR/GDAL:
>
>ogrinfo OCI:jeff/marvin at geo2
>  OGR: Auto register \ms4w\gdalplugins\ogr_OCI.dll using RegisterOGROCI.
>  OCI: Userid=jeff, Password=marvin, Database=geo2
>  ERROR 1: ORA-12154: TNS:could not resolve the connect identifier
>specified
>   in <unnamed>
>  OCI: Userid=jeff, Password=marvin, Database=geo2
>  ERROR 1: ORA-12154: TNS:could not resolve the connect identifier
>specified
>   in <unnamed>
>  FAILURE:
>  Unable to open datasource `OCI:jeff/marvin at geo2' with the following
>drivers.
>    -> OCI
>    -> ESRI Shapefile
>    -> MapInfo File
>    -> UK .NTF
>
>-jeff
>
>
>
>
>-- 
>Jeff McKenna
>MapServer Consulting and Training Services
>http://www.gatewaygeomatics.com/
>
>
>_______________________________________________
>MS4W-Users mailing list
>MS4W-Users at lists.maptools.org
>http://lists.maptools.org/mailman/listinfo/ms4w-users



More information about the MS4W-Users mailing list