Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

TNS errors when connecting from Proc, despite entries in sys.odbc.ini

malgMar 13 2014 — edited Mar 13 2014

I would be grateful for any tips or advice on the following, as I am not quite sure what to try next


Background

We are evaluating the option to add TimesTen to an existing application which is currently using oracle. We are looking to cache a few tables in TimesTen (AWT Global Cache group) for the purpose of increased performance. We are working on a small Proc-prototype that will initially handle caching of 1 table in a TimesTen Cache. Our application (using embedded SQL in C and C++) needs to connect to both Oracle (for access to non-cached tables) and Timesten (for access to table in AWT Cache group).


Problem

I am running into issue with establishing connection to the TimesTen instance from my prototype.

The following statement fails with error:  ORA-12162: TNS:net service name is incorrectly specified

   EXEC SQL CONNECT internal_dfms IDENTIFIED BY yE5ox;OraclePWD=yE5ox AT MG50_T ;

Changing the “AT” to “USING” only results in a different error:  ORA-12154: TNS:could not resolve the connect identifier specified

   EXEC SQL CONNECT internal_dfms IDENTIFIED BY yE5ox;OraclePWD=yE5ox USING MG50_T ;

Thinking that there is something wrong with my prototype I went back to the Quickstart examples, and tried to run the cursorProc sample program against my own TT instance, just to see if it would connect.

./cursorPROC -user internal_dfms -password yE5ox -service MG50_T

The cursorPROC program gives the same error “ORA-12154: TNS: could not resolve the connect identifier specified” (cursorPROC sample code is connecting with “EXEC SQL CONNECT :user IDENTIFIED BY :pass USING :svc;”)

It is puzzling to me because when I  use the same credentials with TTISQL connection is not a problem:

$ ttisql "dsn=MG50_T;uid=internal_dfms;pwd= yE5ox;oraclepwd= yE5ox "

Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.

Type ? or "help" for help, type "exit" to quit ttIsql.

connect "dsn=MG50_T;uid=internal_dfms;pwd= yE5ox;oraclepwd= yE5ox";

Connection successful: DSN=MG50_T;UID=internal_dfms;DataStore=/home/goodwin/timesten_data/mg50_t;DatabaseCharacterSet=WE8ISO8859P1;C

onnectionCharacterSet=US7ASCII;DRIVER=/home/timesten/installation/TimesTen/cvtt/lib/libtten.so;LogDir=/home/goodwin/timesten_data/mg

50_t_logs;PermSize=40;TempSize=32;TypeMode=0;OracleNetServiceName=MG50;

(Default setting AutoCommit=1)

Command>

My TimesTen instance is running :

$ ttstatus MG50_T

TimesTen status report as of Thu Mar 13 09:49:16 2014

Daemon pid 19137 port 53396 instance cvtt

TimesTen server pid 19146 started on port 53397

------------------------------------------------------------------------

Data store /home/goodwin/timesten_data/mg50_t

There are no connections to the data store

Replication policy  : Manual

Cache Agent policy  : Manual

PL/SQL enabled.

------------------------------------------------------------------------

Accessible by group users

End of report

I have added the following entries in sys.odbc.ini for instance MG50_T

MG50_T=TimesTen 11.2.2 Driver

[MG50_T]

Driver=/home/timesten/installation/TimesTen/cvtt/lib/libtten.so

DataStore=/home/goodwin/timesten_data/mg50_t

LogDir=/home/goodwin/timesten_data/mg50_t_logs

PermSize=40

TempSize=32

DatabaseCharacterSet=WE8ISO8859P1

OracleNetServiceName=MG50

I also later added the following 3 rows, which makes no change

[MG50_T]

TTC_SERVER=ttLocalHost_cvtt

TTC_SERVER_DSN=MG50_T

It is my understanding that a user odbc.ini file should not be needed if entries are available in sys.odbc.ini

Many Thanks

M

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 10 2014
Added on Mar 13 2014
2 comments
2,001 views