Re: OCCI connect vs. sqlplus

From: <>
Date: Thu, 30 Apr 2009 22:14:44 +0200
Message-ID: <>

On Thu, 30 Apr 2009 12:43:39 -0700 (PDT), Shane <> wrote:

>On Apr 2, 1:31 am, (Viktor Zacek) wrote:
>> Shane <> wrote:
>> > But connecting to the same db from the same box with this OCCI C++:
>> > gives
>> >    ORA-01017: invalid username/password; logon denied
>> Different ORACLE_HOME and therefore different tnsnames.ora?
>> I don't know the way the C++ interface works, but hat this trivial case
>> sometimes on notebooks.
>> After renaming/moving databases, some of our notebooks where not able to
>> connect, because for some ORACLE_HOME they had a local tnsnames.ora and
>> not the central one.
>> Simple thing, sometimes hard to find ;-)
>> Best regards,
>> Viktor
>I am at my wits end on this. And the DBAs here are no help at all.
>this command works great:
>$ sqlplus smiller/mill_at_oradev
>A OTL program with the connect string "smiller/mill_at_oradev" connected
>the first time I wrote and every time after that. Easy.
>$tnsping oradev gives:
>TNS Ping Utility for Solaris: Version - Production on 30-
>APR-2009 15:37:12
>Copyright (c) 1997, 2006, Oracle. All rights reserved.
>Used parameter files:
>Used TNSNAMES adapter to resolve the alias
>Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS =
>(PROTOCOL = TCP)(HOST = sundev16)(PORT = 28538))) (CONNECT_DATA =
>OK (30 msec)
>So it seems like a OCCI program which attempts to connect and
>disconnect ala:
> env = Environment::createEnvironment();
> conn = env->createConnection("smiller","mill99","oradev");
> Environment::terminateEnvironment(env);
>would work. but instead I get "database exception occurred: ORA-01017:
>invalid username/password; logon denied". If I do this too many times
>my account will be locked.
>If I change conn line to:
> conn = env->createConnection
>I now get "database exception occurred: ORA-12514: TNS:listener does
>not currently know of service requested in connect descriptor" and,
>weirdly, a file sqlnet.log is left in my CWD and it reads:
>Fatal NI connect error 12514, connecting to:
> TNS for Solaris: Version - Production
> TCP/IP NT Protocol Adapter for Solaris: Version -
> Time: 30-APR-2009 15:41:47
> Tracing not turned on.
> Tns error struct:
> ns main err code: 12564
> TNS-12564: TNS:connection refused
> ns secondary err code: 0
> nt main err code: 0
> nt secondary err code: 0
> nt OS err code: 0
>I cannot help but feeling that some network or .ora file is not setup
>I've been trying to fix this on and off for over 3 weeks.

Using OCCI, you are using a *different* password, aren't you? (mill99 instead of mill)
And I don't think OCCI supports the EZCONNECT method (you'll get 12514 if your service name is NOT in tnsnames.ora). Actually this looks like a typical case of NOT reading documentation to me (and maybe a shortage of coffee and a problem of eyesight)

Sybrand Bakker
Senior Oracle DBA
Received on Thu Apr 30 2009 - 15:14:44 CDT

Original text of this message