[gdal-dev] [EXTERNAL] oci and oracle express 11

Martin Landa landa.martin at gmail.com
Thu Apr 10 14:33:00 PDT 2014


Hi,

2014-04-10 21:47 GMT+02:00 Mateusz Łoskot <mateusz at loskot.net>:
> On 10 April 2014 21:39, Martin Landa <landa.martin at gmail.com> wrote:
>> C:\oraclexe\app\oracle\product\11.2.0\server\hs\admin\tnsnames.ora
>>
>> The file contains:
>>
>> XE  =
>>   (DESCRIPTION=
>>     (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))
>
> Try changing to HOST=127.0.0.1 and restart Oracle

I modified the file:

XE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
    )
  )

EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )

ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

Then from cmd:

C:\OSGeo4W_oci>echo %TNS_ADMIN%
C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN\tnsnames.ora

C:\OSGeo4W_oci>ogrinfo -ro OCI:user/passwd at 127.0.0.1:1251/xe -sql
"select count(*) from emp"
OGR: Auto register C:\OSGeo4W_oci\\bin\gdalplugins\ogr_OCI.dll using RegisterOGR
OCI.
OCI: Userid=landa, Password=stratos5, Database=127.0.0.1:1251/xe
ERROR 1: ORA-12154: TNS:could not resolve the connect identifier specified
 in <unnamed>
FAILURE:
Unable to open datasource `OCI:landa/stratos5 at 127.0.0.1:1251/xe' with the follow
ing drivers.

On this PC is running older Oracle 9i (but it's broken, the person who
installed it some months ago told me that he didn't managed to install
it correctly, MS Windows 2008 hasn't been supported by Oracle 9i
AFAIU). It was the reason that I installed Oracle 11g Express on this
machine. I can connect to XE using sqldeveloper or sqlplus, but not
via OGR. That's strange. It's my first experience with Oracle, so I am
sure where could be the problem. From debug message there is nothing
what could help. Any idea where to get more relevant info (Oracle
logs)?

Thanks, Martin

-- 
Martin Landa * http://geo.fsv.cvut.cz/gwiki/Landa


More information about the gdal-dev mailing list