NEWBIE: TORASession Unable to connect to oracle instance. :(

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
h.hasenack
Posts: 48
Joined: Tue 20 Jan 2009 12:35

NEWBIE: TORASession Unable to connect to oracle instance. :(

Post by h.hasenack » Tue 20 Jan 2009 13:54

Currently I am evaluating the devart ODAC package, and Im trying to connect a TORASession onto my Oracle DB.

My computername is 'Obelix.sng.lan', my oracle instance (and service) name 'ORCL'

When entering Direct mode and use Obelix.sng.lan as a servername I can connect to my DB, though I don't know how to to pick a particular database instance. It defaults to my ORCL instance, but connects with success.

Whe using indirect mode, I enter ORCL as servername, but when connecting it tells me ORA-12154: TNS:could not resolve the connect identifier specified.

The generated/provided TORASession.connectstring is 'system/secret@ORCL'


TNSPing ORCL

says everyting is ok, 10ms

I can successfully login using sqlplus with these parameters, as well with the 32 bit (jave) oracle enterprise manager.

I'm stuck now, I dont know whether this is a oracle config issue or if I have to change some settings in the TORASession

Using WinXP64, with Oracle64 bit 10g, and 32 bit client (contains 32 bit OCI.DLL), RAD studio 2007

UPDATE 20090121

I have tested the demo app on a 32 bit virtual machine, and there it works just fine. So it's probably related to my Development environment being 64 bit, with 64 bit clients and 32 bits oracle clients installed.

Still no suggestions anyone?

Regards - Hans

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 21 Jan 2009 10:02

In the Direct mode you should set the Server property in the format Host:Port:ServiceName. For example:

OraSession.Server := 'Obelix.sng.lan:1521:ORCL';

For the OCI mode please check that the \network\ADMIN\tnsnames.ora file contains an alias for your database (in the Oracle home for 32-bit client). You should assign this alias name to the Server property.

Please specify whether you have tried SQL*Plus from the 32-bit client.

h.hasenack
Posts: 48
Joined: Tue 20 Jan 2009 12:35

Post by h.hasenack » Wed 21 Jan 2009 10:33

1) Thanks, the direct connection is now up-and-running, and selecting the correct DB is no problem anymore.

2) yup, SQL Plus (32bit client) works like a charm, can login and execute SQL. Also the (32bit) enterprise manager works perfectly.

(logging in using user nam SYSMAN password secret and host string ORCL)

here's my tnsnames.ora:
###################
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = Workhorse1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORCL)
)
)
###################

Any tip on how the oracle home is found (eg using registry or evironment variable?) maybe something got misplaced during al my installations, deinstallations and reinstallations ;)


UPDATE 20080121
Checked environment variables and found ORACLE_HOME to be empty. Changed to "C:\oracle\product\10.2.0\client_2" which is the home for my 32 bit client.

Still no luck :(


Regards

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 22 Jan 2009 10:45

Open the TOraSession design-time editor and check that the 32-bit home is present in the list of the Home combobox. Try to select this home instead of 'Default'.

h.hasenack
Posts: 48
Joined: Tue 20 Jan 2009 12:35

Post by h.hasenack » Fri 23 Jan 2009 13:39

Still no luck on my dev machine. Changing the home string did not make any difference.
Virtual machine works OK in OCI mode, so it MUST be something with my oracle config of my dev machine somehow.

I've added stack trace, session editor info and tnsping results in this post.

Still "ORA-12154: TNS:could not resolve the connect identifier specified" message when using OCI mode.

1) Any idea's what might still be wrong?
2) Do you know of a tool to complete remove and reset all oracle mahem on my dev machine so I can perform a clean oracle client installation?

Thx

Here's stack trace

[07C021EC]{odac105.bpl } Oraclasses.TOCIConnection.OraError + $154
[07C0208E]{odac105.bpl } Oraclasses.TOCIConnection.Check + $2A
[07C02C43]{odac105.bpl } Oraclasses.TOCIConnection.SetupEnvironment + $3DF
[07C03BB8]{odac105.bpl } Oraclasses.TOCIConnection.Connect + $2CC
[07C29BEC]{odac105.bpl } Oraconnectionpool.TOraLocalConnectionPool.CreateNewConnector + $84
[07B28B11]{dac105.bpl } Crconnectionpool.TCRLocalConnectionPool.GetConnection + $185
[07B290ED]{dac105.bpl } Crconnectionpool.TCRConnectionPoolManager.InternalGetConnection + $31
[07C2A29B]{odac105.bpl } Oraconnectionpool.TOraConnectionPoolManager.InternalGetConnection + $2B
[20041974]{rtl100.bpl } SyncObjs.TCriticalSection.Release (Line 351, "common\SyncObjs.pas" + 0) + $4
[07C2A263]{odac105.bpl } Oraconnectionpool.TOraConnectionPoolManager.GetConnection + $67
[07B28324]{dac105.bpl } Crconnectionpool.TCRConnectionParameters + $28
[07C39640]{odac105.bpl } Ora.TOraSession.GetOCIConnection + $228
[07C39232]{odac105.bpl } Ora.TOraSession.CreateIConnection + $16
[07B44403]{dac105.bpl } Dbaccess.TCustomDAConnection.DoConnect + $37
[07C39DAC]{odac105.bpl } Ora.TOraSession.DoConnect + $130
[07B447A3]{dac105.bpl } Dbaccess.TCustomDAConnection.PerformConnect + $37
[07B46633]{dac105.bpl } Dbaccess.TCustomDAConnection.SetConnected + $2AF
[07C3B09C]{odac105.bpl } Ora.TOraSession.SetConnected + $44
[2002AE7E]{rtl100.bpl } TypInfo.SetOrdProp (Line 1316, "common\TypInfo.pas" + 27) + $0
[20D29FD6]{designide100.bpl} DesignEditors.TPropertyEditor.SetOrdValue (Line 841, "DesignEditors.pas" + 2) + $E
[20D2B073]{designide100.bpl} DesignEditors.TEnumProperty.SetValue (Line 1401, "DesignEditors.pas" + 5) + $4
[20D29C8D]{designide100.bpl} DesignEditors.TPropertyEditor.Edit (Line 671, "DesignEditors.pas" + 11) + $14
[20AB55C6]{coreide100.bpl} PropInsp.TPropertyInspector.PropListEditDblClick (Line 855, "PropInsp.pas" + 20) + $5
[20E0ED7D]{vclide100.bpl} IDEInspListBox.TInspListBox.DoEditDblClick (Line 967, "ideinsplistbox.pas" + 2) + $A
[20E10602]{vclide100.bpl} IDEInspListBox.TInspListBox.EditDblClick (Line 1538, "ideinsplistbox.pas" + 0) + $2
[2013CA49]{vcl100.bpl } Controls.TControl.DblClick (Line 5234, "Controls.pas" + 1) + $14
[2013CBAC]{vcl100.bpl } Controls.TControl.WMLButtonDblClk (Line 5275, "Controls.pas" + 4) + $C
[2013C527]{vcl100.bpl } Controls.TControl.WndProc (Line 5146, "Controls.pas" + 83) + $6
[201406A7]{vcl100.bpl } Controls.TWinControl.WndProc (Line 7304, "Controls.pas" + 111) + $6
[20D1972A]{designide100.bpl} DeskUtil.SetFocusHook (Line 435, "DeskUtil.pas" + 4) + $C
[2003203C]{rtl100.bpl } Classes.TThreadList.UnlockList (Line 3359, "common\Classes.pas" + 0) + $4
[200EBAA8]{vcl100.bpl } Graphics.FreeMemoryContexts (Line 5060, "Graphics.pas" + 12) + $5
[2013FDD0]{vcl100.bpl } Controls.TWinControl.MainWndProc (Line 7073, "Controls.pas" + 3) + $6
[20140158]{vcl100.bpl } Controls.TWinControl.IsControlMouseMsg (Line 7176, "Controls.pas" + 9) + $25
[201406A7]{vcl100.bpl } Controls.TWinControl.WndProc (Line 7304, "Controls.pas" + 111) + $6
[20E0DF4B]{vclide100.bpl} IDEInspListBox.TPropInspEdit.WndProc (Line 430, "ideinsplistbox.pas" + 7) + $4
[2013FDD0]{vcl100.bpl } Controls.TWinControl.MainWndProc (Line 7073, "Controls.pas" + 3) + $6
[20040E4C]{rtl100.bpl } Classes.StdWndProc (Line 11583, "common\Classes.pas" + 8) + $0
[20163691]{vcl100.bpl } Forms.TApplication.StopHintTimer (Line 8673, "Forms.pas" + 3) + $6
[201625E8]{vcl100.bpl } Forms.TApplication.ProcessMessage (Line 8103, "Forms.pas" + 21) + $1
[2016262A]{vcl100.bpl } Forms.TApplication.HandleMessage (Line 8124, "Forms.pas" + 1) + $4
[2016291F]{vcl100.bpl } Forms.TApplication.Run (Line 8223, "Forms.pas" + 20) + $3
[0042297A]{bds.exe } bds.bds (Line 195, "" + 7) + $7


Here's what is displayed in the session editor info

OCI: Version 10.2.0.1.0
DLL: C:\oracle\product\10.2.0\client_32bit\BIN\oci.dll
Home [OraClient10g_32bit]: C:\oracle\product\10.2.0\client_32bit
Default Home [OraClient10g_32bit]: C:\oracle\product\10.2.0\client_32bit
Current Home: C:\oracle\product\10.2.0\client_32bit
Call style:
Oracle:

Here's what's displayed when using tnsping

C:\oracle\product\10.2.0\client_32bit\BIN>tnsping AMQMDATA

TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 23-JAN-2
009 14:30:38

Copyright (c) 1997, 2005, Oracle. All rights reserved.

Used parameter files:
C:\oracle\product\10.2.0\client_32bit\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = Workhorse1)(PORT = 1521))) (CONNECT_DATA = (SID = AMQMData)))
OK (30 msec)


Direct mode works fine now. except for inserting data which takes way to much time: I'll start a new thread on that one in a while.

Regards

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 26 Jan 2009 09:54

1) Oracle has a bug: this error message is displayed if the path to your application contains brackets. So make sure that there are no brackets in the path.

2) To completely remove Oracle do the following:
- uninstall Oracle;
- remove C:\Oracle folder;
- remove HKEY_LOCAL_MACHINE\Software\Oracle from the registry.

h.hasenack
Posts: 48
Joined: Tue 20 Jan 2009 12:35

Post by h.hasenack » Mon 26 Jan 2009 10:54

Indeed... De ODAC demo was stored in

C:\Program Files (x86)\Devart\Odac for RAD Studio 2007\Demos\Win32\OdacDemo

Moved the folder to
c:\ODACDemo

and now it also works using OCI mode

Thanks!

:D

But here comes trouble: On Vista64 win Winxp64 customer machines, my app will be installed somwhwere in de program files (x86) subfolders. This means my app won't work from there... Do you know of a workaround to avoid the problem without changing my app location?

Regards - Hans

Post Reply