Wednesday, November 19, 2014

TNS-03505: Failed to resolve name

Recently I have installed a client on a local machine and I was trying to connect the database. I know I have everything right but still I was getting this error.

C:\Users\localhost>tnsping orcl

TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 19-NOV-2
014 15:22:45

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

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

TNS-03505: Failed to resolve name

C:\Users\localhost>

  I went back to check the Tnsnames.ora file to see if there is anything wrong in it. But no luck I couldn't find anything.
 
  Sample Tnsnames.ora on my machine.
 
  orcl =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = orcl)
    )
  )
 
  Wondered what could have gone wrong.
Then figured that there was a simple mistake that I made. There was a empty space in front of the orcl.  I deleted the empty space and everything worked.

No comments:

Post a Comment