[gdal-dev] Oracle Connection issues
Mateusz Loskot
mateusz at loskot.net
Thu Jul 17 11:46:17 EDT 2008
Clay, Bruce wrote:
> Two questions and one lesson learned passed on
>
> 1. I built an application using GDAL 1.5.2 and Oracle 9.2 client
> tools. Everything works fine on my development system. When I take
> the application to the customer system I can not connect to the
> Oracle database and I am not getting an error that explains why. The
> target system does have Oracle 10.2 client tools installed. Do
> versions have a match between the development system and the target
> system to work with Oracle?
Bruce,
The versions mix seems to be an issue here.
Re-linking may be required, see "Statically-Linked and
Dynamically-Linked Applications" sections here
http://www.acs.ilstu.edu/docs/oracle/appdev.101/b10779/oci01int.htm#421861
http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28395/oci01int.htm#i421879
> And if so what patch level in the version do wehave to match? For
> example, there are 4 digits in the Oracle version number. Do all 4
> digits have to be the same as what is compiled into GDAL for GDAL to
> be able to connect?
AFAIK, basic OCI API is compatible across 8,9, 10 and 11 (not counting
new functions introduced in subsequent releases).
The issue is that in most cases you need to relink your software with
new version of OCI library.
> 2. There seems to be a long pause when I connect to Oracle. I used
> the debugger to follow the process and it looks like an internal
> structure is created in GDAL memory space that contains information
> about all of the tables in Oracle including the field names and data
> types. We have a database with several tables so this takes a while
> to build. Is there a way to get GDAL to do a quick connect without
> building this structure every time I connect?
You may try to request only selected table(s)
See [1] how to provide list of tables
[1] http://gdal.org/ogr/drv_oci.html
> Lesson learned.
>
> It seems that Microsoft has removed normal C++ support form the
> operating system and starting with programs built with Visual Studio
> 2005 a separate redistributable patch (link shown below) has to be
> applied to the operating system to add the libraries required to run
> C++ based applications.
Yes
> This also applies to C# applications that call DLLs such as GDAL.
> The error message that you will see will not be very helpful but may
> include a mention of “side-by-side”. More typically it will just say
> the application can not run and reinstallation may help.
> Additionally, debug versions of the program will not run on a
> computer that does not have Visual Studio and the Microsoft rules
> state that debug versions of their libraries can not be distributed.
Yes, exactly.
> So the lesson learned: build GDAL and all of it’s dependent libraries
> in release mode before trying to move off of the development system.
Yes, that's the only option.
Greetings
--
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
More information about the gdal-dev
mailing list