[mapserver-users] oraclespatial connect error

Rodrigo Cabral cabral at yadata.net
Sat Feb 23 12:16:12 EST 2002


Okay, we can sort your application out later on. Let's first make things
work. Not sure if you're using MapServer CGI or MapScript... But either
tnsnames.ora doesn't have your database address defined (but you can use
sqlplus in your clientside, which is strange); or the ORACLE_HOME
environment variable is not defined in the runtime shell mapserver is
executing (but you can access oracle through a CGI program, which is also
strange).

However, the 2nd option is my best guess. My hint comes from the error
message itself -- Error while trying to retrieve text for error ORA-12541 --
which means the client doesn't have access to the error string table which
probably stays in the client within of ORACLE_HOME. Briefly: no ORACLE_HOME
defined, no error message can be retrieved (let alone connecting to the
database).

I'm also running SDO in a Red Hat Linux environment. Becase httpd daemons
usually run in their own shell, we had to setup Apache with an extra section
defining ORACLE variables. This is it:

(in httpd.conf)
<IfModule mod_env.c>
SetEnv ORACLE_SID g10
SetEnv ORACLE_BASE /u01/app/oracle
SetEnv ORACLE_HOME /u01/app/oracle/product/8.1.7
SetEnv ORA_NLS33 /u01/app/oracle/product/8.1.7/ocommon/nls/admin/data
SetEnv NLS_LANG "brazilian portuguese"
</IfModule>

Cheers,
Rod.

----- Original Message -----
From: "Yu-Hsin Chen" <ychen at yorktel.com>
To: "Rodrigo Cabral" <cabral at yadata.net>; "PARVILLERS"
<hugues at parvillers.com>
Cc: <mapserver-users at lists.gis.umn.edu>
Sent: Saturday, February 23, 2002 12:16 PM
Subject: RE: [mapserver-users] oraclespatial connect error


I'm on Mandrake Linux ProSuite 8.0.  Oracle is 8i 8.1.7 for Linux.  I
can access my remote database through sqlplus or a perl cgi program
without problems.  Mapserver was compiled with oraclespatial and the
path was pointing to the correct $ORACLE_HOME path.

I won't be able to try anything until Monday.  So I will create a local
database to see if I at least can conquer the connect problem.

After that I'd have to work with the spatial issues.  I'm not familiar
with Oracle spatial implementation.  My need is simple: I'd like to be
able to retrieve locations from the database based on certain criteria
and plot them on the map.  That's why in my original message I put the
'DATA' statement that way.  I thought I could pull the latitude and
longitude data and plot them as circles (that's how I understood the
Mapserver reference manual) with that statement.  If that's not the
case, Rod, I think I'll need assistance later.

Thanks.

Yu-Hsin


-----Original Message-----
From: Rodrigo Cabral
Sent: Sat 2/23/2002 8:20 AM
To: PARVILLERS; Yu-Hsin Chen
Cc: mapserver-users at lists.gis.umn.edu
Subject: Re: [mapserver-users] oraclespatial connect error

Which binary of mapserver are you using? Windows or Unix? -- just for
curiosity

Also, you could try to track the error by running sqlplus and trying to
connect to the database. You should get the same TNS error when you try
to
connect.

Rod.

----- Original Message -----
From: "PARVILLERS" <hugues at parvillers.com>
Sent: Saturday, February 23, 2002 4:40 AM
Subject: Re: [mapserver-users] oraclespatial connect error


Hello,

don't you have more than one Oracle install on your local server ? May
be
the
Oci don't look in the right tnsnames.ora file ?

Yu-Hsin Chen a écrit :

> Well, my problem is that the database is not on the local machine.  I
> guess I could create the local database and test it out.  If that is
> successful I can always create database link in Oracle to access the
> real data.
>
> Thanks for the tip on DATA.  I will have more questions back on this
> item.
>
> Yu-Hsin
>
> -----Original Message-----
> From:   Rodrigo Cabral
> Sent:   Fri 2/22/2002 7:32 PM
> To:     Yu-Hsin Chen; mapserver-users at lists.gis.umn.edu
> Cc:
> Subject:        Re: [mapserver-users] oraclespatial connect error
>
> Your error means that the Oracle client cannot find the database
> (service)
> to connect. Try using simply 'username/password' for CONNECTION to see
> if
> the default service works.
>
> Also, your DATA statement is not going to work. 'circle' must be in
the
> select list. Like "circle from (select circle...)". BUT, why are you
> doing
> that? Try this:
>
> DATA "circle FROM room_geoloc"
> or
> DATA "circle FROM room_geoloc USING SRID <srid#>" if you have an srid
> number
> defined.
>
> Rod.
>
> ----- Original Message -----
> From: "Yu-Hsin Chen" <ychen at yorktel.com>
> To: <mapserver-users at lists.gis.umn.edu>
> Sent: Friday, February 22, 2002 4:04 PM
> Subject: [mapserver-users] oraclespatial connect error
>
> I've compiled mapserver 3.5 with oraclespatial option on my Mandrake
> Linux 8.0 with Oracle 8.1.7i.  When I run sqlplus at Linux prompt I
can
> get to the database with un/pw at bis login.  However, when I tried it
from
> a map file I get "msOCIConnect() in msOracleSpatialLayerOpen():
> OracleSpatial error. Error while trying to retrieve text for error
> ORA-12541" in my browser.  ORA-12541 is "TNS:could not resolve service
> name".
>
> My map file looks like this:
>
> LAYER
>   NAME "oracle"
>   CONNECTIONTYPE oraclespatial
>   CONNECTION 'un/pw at bis'
>   DATA "circle from (select room_id, longitude, latitude from
> room_geoloc)"
>   TYPE POINT
>   STATUS ON
>     ...
>     ...
> END
>
> Thanks in advance to whoever can help me.
>
> Yu-Hsin Chen
>
>
------------------------------------------------------------------------
>                   Name: winmail.dat
>    winmail.dat    Type: application/ms-tnef
>               Encoding: base64










More information about the mapserver-users mailing list