Re: OCCI connect vs. sqlplus

From: <sybrandb_at_hccnet.nl>
Date: Thu, 30 Apr 2009 22:14:44 +0200
Message-ID: <ue1kv4lpe9uh56oeq6v6hgardc99vpc818_at_4ax.com>



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

>On Apr 2, 1:31 am, usenet2..._at_zacek.de (Viktor Zacek) wrote:
>> Shane <gshanemil..._at_verizon.net> 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 10.2.0.3.0 - 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 =
>(SERVICE_NAME = oradev.bloomberg.com)))
>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
>("smiller","mill99","sundev16:28538");
>
>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:
> (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=sundev16.bloomberg.com)(CID=
>(PROGRAM=yagorcldb.sundev1.tsk)(HOST=sundev18)(USER=smiller)))(ADDRESS=
>(PROTOCOL=TCP)(HOST=172.17.5.23)(PORT=28538)))
>
> VERSION INFORMATION:
> TNS for Solaris: Version 10.2.0.3.0 - Production
> TCP/IP NT Protocol Adapter for Solaris: Version 10.2.0.3.0 -
>Production
> 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
>right.
>
>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