[gdal-dev] oci and oracle express 11
Jukka Rahkonen
jukka.rahkonen at mmmtike.fi
Wed Apr 9 23:53:42 PDT 2014
Martin Landa <landa.martin <at> gmail.com> writes:
>
> Hi all,
>
> I would like to set up connection between OGR and Oracle Express 11g,
> I downloaded Oracle SQL Developer and set up the connection, when I
> try to connect to the database using user/password it works.
>
> When using OGR I entered to command line
>
> ogrinfo -ro OCI:user/password -sql "select count(*) from emp"
>
> but it failed with
>
> ERROR 1: ORA-12560: TNS:protocol adapter error
> in <unnamed>
>
> Thanks in advance for any pointers! Martin
Hi,
The the complete connection string as written into the OCI driver manual page:
When opening a database, it's name should be specified in the form
"OCI:userid/password at database_instance:table,table".
Database_instance is the name that in defined in your tnsnames.ora. The part
:table,table is not necessary but having it can speed up with making the
connection because less metadata is queried from the database.
Perhaps the OCI examples should be edited to use this syntax. It must be an
exception when plain OCI:user/password can work.
-Jukka Rahkonen-
More information about the gdal-dev
mailing list