Page 1 of 1

Ora 10 xe windows 10/64

Posted: 13.10.2016, 22:38
by xutanou
Good evening everybody, I'm still trying to connect to ora 10 xe from zeos, now I have migrated all my system to win 10/64, I'm using Lazarus 1.6 and Zeos 7.1.4

All my system is 64 bit
Oracle 10 xe is 32 bit and it is installed in the server.
I can connect to the server with different oracle admin tools
I CAN'T connect to oracle from zeos from the server nor from any client

I Can (using the same zeos components) connect to a Postgresql 9.5 server and a Firebird 2.5 server on the same server machine from the server itself or from any of the client computers.

From the clients i've just added the correct libraryes to the executable path and/or defined the path where the libraryes reside in the "library path" fiels of the component, and the connections work fine. Althoug I've an application that works with connections to both databases...

My problems ara only with oracle 10 xe :cry:

I've tryied a lot of things and i'm not able to connect to it, I have tryed with oci library 32 and 64 bits, with all configurations on component and nothing, the response is always:

"OCI ERROR 12154 tns could not resolve the connect identifier specified"

I'm trying to get this connection working from 2013 without fortune, any help will be apreciated.

P.s.: I can't move to ora 11 xe, the aplication that runs on my 10 xe doesen't work in 11 xe

thanks in advance

Re: Ora 10 xe windows 10/64

Posted: 17.10.2016, 16:06
by marsupilami
Hello xutanou,

it has been some time since I had my last experience with oracle I wasn't an expert in that. I seem to remember that I had to keep the host name empty and just specify the database name for things to work with Zeos. The database name itself was the tns connet identifier, if I remember correctly.

How did you set up your TZConnection object?

Witzh best regards,

Jan

Re: Ora 10 xe windows 10/64

Posted: 24.10.2016, 15:27
by xutanou
Hy marsupilami,
thanks for your response, here are my parameters in the zconnection component:

DATABASE= XE
HOSTNAME= empty
PASSWORD= mypassword
PORT=1521
PROTOCOL= ORACLE
USER= myuser

apart I have the Library location pointing to where the appropiate oci.dll is

The response is:
Error.png

Re: Ora 10 xe windows 10/64

Posted: 24.10.2016, 15:43
by xutanou
I didn't mention that I can connect with sqlplus from a client to my database on the server using the connection string as below:

sqlplus myuser/mypassword@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=muhostIP)(Port=1521))(CONNECT_DATA=(SID=XE)))

thanks :wink:

Re: Ora 10 xe windows 10/64

Posted: 24.10.2016, 20:10
by marsupilami
Duh - so I have to grab a copy of Oracle... Honestly I hoped to be able to evade that particular system for some time ;o)

Give me some time, I will try to check it and would have to set it up eventually anyway...

With best regards,

Jan

Re: Ora 10 xe windows 10/64

Posted: 24.10.2016, 21:06
by miab3
@xutanou

Try:

Database=<HostName>
or
Database=<HostIP>

Michal

Re: Ora 10 xe windows 10/64

Posted: 24.10.2016, 21:54
by marsupilami
Hello xutanou,

sooo - I downloaded and installed the current version of Oracle XE (11g?). The following code works for me:

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
begin
  ZConnection1.Protocol := 'oracle-9i';
  ZConnection1.User := 'SYSTEM';
  ZConnection1.Password := 'password';
  ZConnection1.Database := 'XE';
  ZConnection1.ClientCodepage := 'UTF8';
  ZConnection1.Connect;
  ShowMessage('Connected');
end;
Youe error message ('TNS: could not resolve the connect identifier specified') leads me towards thinking that your tnsnames.ora file might be incorrect. Is your server on a separate computer or on the same computer as your application?

Addendum: I get exactly the same error message that you get if I try to connect to a database that is not configured in my tnsnames.ora file. This error message is shown if I change my database name from XE to XE2:
---------------------------
Project1
---------------------------
SQL Error: OCI_ERROR: ORA-12154: TNS:could not resolve the connect identifier specified

---------------------------
OK
---------------------------

So - plaese check your tnsnames.ora file. Mine is in C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN. In my test environment the Oracle Server and Delphi and the application are all on the same machine.

With best regards,

Jan

Re: Ora 10 xe windows 10/64

Posted: 28.10.2016, 14:44
by xutanou
Good evening,

Miab3, I tryed your suggestion some time ago and it didn't work, I have tryied just now and it doesen't work either.

Marsupilami, my application and Lazarus are in the same machine as the oracle server is installed, in fact I have tryed in the same machine and in a remote computer in the same network.

Unfortunately your code do not work for me, the error message is still de same :cry:

I copy/paste the contents of my tnsnames.ora and listener.ora files below (original ones, no modifications done on them), but I think they are correct

any more ideas?, thanks

tnsnames.ora:

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

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

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


and listener.ora:

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
(PROGRAM = extproc)
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(ADDRESS = (PROTOCOL = TCP)(HOST = myservername)(PORT = 1521))
)
)

DEFAULT_SERVICE_LISTENER = (XE)

Re: Ora 10 xe windows 10/64

Posted: 09.05.2017, 19:27
by xutanou
Good evening Everibody :D

I'm glad to explain that at last I have found a solution !!! :idea: after a lot of googling and trying as many combinations as I could today I found a post that helped me, so I write down here my solution for others with the same problem:

in the Tconnection component:

Database: your.server.ip:1521/XE
Host Name: Nothing (empty field)
Library Location: The full path to your driver "D:\Lazarus\proves\zeosdef\llibreries\oci.dll" in my case.
Password: your password
User: Your username
Port: 0
Protocol: Oracle or Oracle9i (Both works :love: )

A VERY IMPORTANT thing is that the path must not contain any space, if it contains spaces won't work, if you use "c:test lazarus\oci.dll" won't work, you have to use "c:test_lazarus\oci.dll" or "c:testlazarus\oci.dll".

I have tested my connection program compiled in Win10/64 and in Win XP, in both cases with success using Lazarus 1.6.4 and zeos 7.1.4 :v: :v: :v:

Re: Ora 10 xe windows 10/64

Posted: 11.05.2017, 20:50
by marsupilami
Hello Hello xutanou,

thank you for sharing your solution :D

With best regards,

Jan

Re: Ora 10 xe windows 10/64

Posted: 26.10.2019, 16:12
by maiconsaraiva
Thank You xutanou, this work's for me.

Reforçando para os brasileiros que precisarem de ajuda para resolver esse problema:

01. A propriedade HostName deverá ficar vazia;
02. A propriedade Port deverá ser "0";
03. A propriedade Database é quem irá conter esses dados sendo composto da seguinte forma:
HostName (IP ou Nome do PC) + ":" + Porta + "/" + Nome do Banco.
Ex: 192.168.1.10:1521/XE (XE = nome do banco)

04. Não esquecer de apontar o caminho da LibraryLocation (sem espaços e/ou caracteres especiais).
Ex: 'C:\Oracle\instantclient_11_2\oci.dll'

Re: Ora 10 xe windows 10/64

Posted: 26.10.2019, 16:13
by maiconsaraiva
Obs: My test Work with Zeos 7.2.4-stable