0

I have a weird problem.

I login to a pc using non admin user. Then I installed sqlclient 64 bit for oracle 11.2. Installation went fine, no errors. Then i tried to login using sqlplus from command prompt. It gives out error

"ORA-12545: Connect failed because target host or object does not exist"

Then I try to run the command prompt using windows admin account. Then it works. i can connect to oracle.

Can anyone explain this behavior ? How can i run sqlplus without using windows admin account ?

Here is what i run :

C:\Windows\system32>sqlplus SQL*Plus: Release 11.2.0.1.0 Production on Thu Dec 13 09:52:00 2018 Copyright (c) 1982, 2010, Oracle. All rights reserved.

Enter user-name: username@xxx 
Enter password:

This is my tnsnames.ora :

xxx.domain.yyy = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.255.1.80)(PORT = 1523)) ) (CONNECT_DATA = (SID = xxx) ) ) 

Thanks

  • How do you connect? Please tell us the exact command. – miracle173 Dec 13 '18 at 5:44
  • C:\Windows\system32>sqlplus SQL*Plus: Release 11.2.0.1.0 Production on Thu Dec 13 09:52:00 2018 Copyright (c) 1982, 2010, Oracle. All rights reserved. Enter user-name: username@xxx Enter password: This is my tnsnames.ora : xxx.domain.yyy = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.255.1.80)(PORT = 1523)) ) (CONNECT_DATA = (SID = xxx) ) ) – padjee Dec 13 '18 at 6:52
  • please edit your question an add this information. Format it appropriately. – miracle173 Dec 13 '18 at 7:39
  • OK. done. please kindly re-read again. thanks – padjee Dec 13 '18 at 7:51
  • I think you better use the command sqlplus username/password@xxx to avoid typos. 1. I assume that you use exactly the same command for both accounts. Is this true? 2. do you have more than one Oracle installions on your pc? 3. what type of client do you have installed? The full clent that is installed with Oracle Universal Installer or the instant client,? – miracle173 Dec 13 '18 at 8:21
0

It does not say it cannot resolve the entry (TNS-03505: Failed to resolve name). So it looks like it resolving a wrong way for that another, non-admin user.

You have pointed out you have different clients installed. Each client version usually has its own tnsnames.ora file created. Check the client configuration files content for differences. You can find the client home location at this or similar keys: HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\KEY_home_name\ORACLE_HOME (home_name varies). The tnsnames.ora file can be find in network\admin subdirectory.

You may start with opening command window and running tnsping.exe xxx where xxx is you TNS entry. It resolves the symbolic entry and returns the full TNS string. Most probably the HOST section is not resolvable by DNS (a typo maybe). See the example below:

C:\Users\sg0891757>tnsping mydbname

TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 02-JAN-2

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

Used parameter files:
C:\oracle\product\11.2.0\client_1\network\admin\sqlnet.ora   

Used TNSNAMES adapter to resolve the alias
Attempting to contact
(DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=myhost.mydomain.us)(PORT=1521))
              (CONNECT_DATA=(SERVER=dedicated) (SERVICE_NAME=mydbname_service)))
OK (440 msec)

From the example above you can also figure out the ORACLE_HOME used, it would be C:\oracle\product\11.2.0\client_1 in this case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.