MapServer 4.6 on Mac OS X and Oracle Spatial 10g

Fernando Simon fsimon at UNIVALI.BR
Sun Jun 19 20:16:56 PDT 2005


Hi,
    The correct way how to connect Oracle Spatial is using: 
"user/pass at sid". Other ways don't work.
    This problem can be related with variables (shell). Generally I set 
the Httpd variables too. You need the to set the ORACLE_HOME and 
ORACLE_BASE correctly to access Oracle Spatial from Mapserver, for shell 
and httpd.conf. You can see this page, as example, how to set this 
Oracle variables: 
http://www.puschitz.com/InstallingOracle10g.shtml#SettingOracleEnvironments
    The user that will run Mapserver need to see (read permission) the 
ORACLE_HOME directory.
    Thanks.


------------------------------------------------------------------------
Fernando Simon
Mapserver and Oracle Spatial developer
G10 - Laboratorio de Computacao Aplicada - Brazil
http://g10.cttmar.univali.br - UNIVALI/CTTMAR
------------------------------------------------------------------------


Marco Marsella wrote:

> Hi all,
>
> I am trying to get MapServer use an OracleSpatial 10g DB running on a  
> SUN box. I have installed Oracle Instant Client on the Mac and I can  
> use sqlplus to connect and query the DB.
>
> Then I have built MS using the Oracle SDK and tried to connect.  
> However, MS reports a problem with the creation of the OCI handlers:
>
> [Tue Jun 14 15:38:30 2005] [error] PHP Warning:  [MapServer Error]:  
> msDrawMap(): Failed to draw layer named 'Oracle'.\n in /Users/ 
> marsella/Sites/mserve/htdocs/common/wrapper/drawmap.php on line 533
> [Tue Jun 14 15:38:30 2005] [error] PHP Warning:  [MapServer Error]:  
> msOracleSpatialLayerOpen(): Cannot create OCI Handlers. Connection  
> failure. Check the connection string. Error: .\n in /Users/marsella/ 
> Sites/mserve/htdocs/common/wrapper/drawmap.php on line 533
> [Tue Jun 14 15:38:30 2005] [error] PHP Notice:  Use of undefined  
> constant MS_CHILDERR - assumed 'MS_CHILDERR' in /Users/marsella/Sites/ 
> mserve/htdocs/common/wrapper/drawmap.php on line 668
>
> - I have set the following shell variables:
>
> export DYLD_LIBRARY_PATH="/usr/local/oracle/lib"
> export LD_LIBRARY_PATH="/usr/local/oracle/lib"
> export JAVA_HOME=/Library/Java/Home
> export SQLPATH=/usr/local/oracle
> export TNS_ADMIN=/Users/marsella/Sites/mserve/eclo/etc
>
> - I have tried SQL*Plus and it works using the following command:
>
> /usr/local/oracle/sqlplus scott/tiger at locustgis1:1521/ECLO2
>
> Then I have set the following SetEnvIf clauses in httpd.conf:
>
> SetEnvIf Request_URI ".*" TNS_ADMIN "/Users/marsella/Sites/mserve/ 
> eclo/etc"
> SetEnvIf Request_URI ".*" SQLPATH "/usr/local/oracle"
> SetEnvIf Request_URI ".*" LD_LIBRARY_PATH "/usr/local/oracle/lib"
> SetEnvIf Request_URI ".*" DYLD_LIBRARY_PATH "/usr/local/oracle/lib"
>
> I have checked that the tnsnames.ora file is readable by any user.  
> The tnsnames.ora file is:
> ECLO2 =
>   (DESCRIPTION =
>     (ADDRESS = (PROTOCOL = TCP)(HOST = locustgis1)(PORT = 1521))
>     (CONNECT_DATA =
>       (SERVER = DEDICATED)
>       (SERVICE_NAME = ECLO2)
>     )
>   )
>
>
> The layer is as follows:
>
>     LAYER
>         NAME "Oracle"
>         TYPE POINT
>         STATUS OFF
>         CONNECTIONTYPE oraclespatial
>         CONNECTION "scott/tiger@//locustgis1:1521/ECLO2" (I also  
> tried "scott/tiger at ECLO2" with the same result)
>         DATA "shape FROM OPS$LOCUST.test USING SRID 8307"
>         CLASS
>             NAME "Hoppers"
>             SYMBOL "circle"
>             COLOR 0 255 0
>         END
>     END
>
> and the table test is:
>
> SQL*Plus: Release 10.1.0.3.0 - Production on Tue Jun 14 15:32:18 2005
> Copyright (c) 1982, 2004, Oracle.  All rights reserved.
> Connected to:
> Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit  
> Production
> With the Partitioning, OLAP and Data Mining options
>
> SQL> describe OPS$LOCUST.test;
> Name               Null?   Type
> ------------------- -------- ----------------------------
> GA                                 NUMBER(38)
> SHAPE                         OPS$LOCUST.SDO_GEOMETRY
>
> Is there anything you see wrong ?
>
> Thank you very much.
>
> Marco
>



More information about the MapServer-users mailing list