tns-03505:failed to resolve name

when I run  
$tnsping orc
I get the following errot

used parameter files
/u00/app/oracle/product/11.2.0/network/admin/sqlnet.ora
Hi getting this error
TNS-03505 failed to resolve name

taazAsked:
Who is Participating?
 
slightwv (䄆 Netminder) Commented:
The TNS-03505 is not related to the hostname of the host entry in the tnsnames.ora file.

It is due to Oracle not being able to locate the database alias requested.

roughly 90% of the time it is because there are multiple Oracle products installed and the wrong tnsnames.ora file is being used.

Then the second best fix is the default domain settings in the sqlnet.ora file and a mismatch in the tnsnames.ora file.
0
 
slightwv (䄆 Netminder) Commented:
Assuming this is the correct ORACLE_HOME look in /u00/app/oracle/product/11.2.0/network/admin/tnsnames.ora for an entry called orc

Also post the results from a command prompt of: what tnsping
0
 
sdstuberCommented:
please post your sqlnet.ora and tnsnames.ora
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Tomas Helgi JohannssonCommented:
          Hi!

Make sure that the fully qualified hostname in ORACLE_HOSTNAME env variable is in the
/etc/hosts , listener.ora and tnsnames.ora files.

Regards,
    Tomas Helgi
0
 
taazAuthor Commented:

When I runtnsping from the server I get the error
TNS-03505.failed to resolve name
All this files are under $ORALCE_HOME/network/admin
sqlnet.ora
SQLNET.AUTHENTICATION_SERVICES= (TNS)
NAMES.DIRECTORY_PATH=(TNSNAMES,HOSTNAME)


listener.ora

LISTENER =
  (DESCRIPTION_LIST
  (DESCRIPTION =
   (ADDRESS = (PROTOCOL = TCP)(HOST= abc)(PORT=1521))
  )
 )


tnsnames.ora

ORCL
  (DESCRIPTION =
   (ADDRESS = (PROTOCOL = TCP) (HOST = abc) (PORT = 1521)0
  )

  (CONNECT_DATA =
   (SERVER =DEDICATED)
    (SERVICE_NAME = ORCL)

 )
0
 
taazAuthor Commented:
When I runtnsping from the server I get the error
TNS-03505.failed to resolve name
All this files are under $ORALCE_HOME/network/admin
sqlnet.ora
SQLNET.AUTHENTICATION_SERVICES= (TNS)
NAMES.DIRECTORY_PATH=(TNSNAMES,HOSTNAME)


listener.ora

LISTENER =
  (DESCRIPTION_LIST
  (DESCRIPTION =
   (ADDRESS = (PROTOCOL = TCP)(HOST= abc)(PORT=1521))
  )
 )


tnsnames.ora

ORCL
  (DESCRIPTION =
   (ADDRESS = (PROTOCOL = TCP) (HOST = abc) (PORT = 1521)
  )

  (CONNECT_DATA =
   (SERVER =DEDICATED)
    (SERVICE_NAME = ORCL)

 )
0
 
sdstuberCommented:
there's your problem

you're looking for "orc"

but your tns entry is "orcl"
0
 
sdstuberCommented:
also note,  your tnsnames has bad formatting.   there should be an "=" after the ORCL

ORCL=
(DESCRIPTION =
   (ADDRESS = (PROTOCOL = TCP) (HOST = abc) (PORT = 1521)
  )

  (CONNECT_DATA =
   (SERVER =DEDICATED)
    (SERVICE_NAME = ORCL)
 )
0
 
taazAuthor Commented:
When I runtnsping from the server I get the error
TNS-03505.failed to resolve name
All this files are under $ORALCE_HOME/network/admin


sqlnet.ora
SQLNET.AUTHENTICATION_SERVICES= (TNS)
NAMES.DIRECTORY_PATH=(TNSNAMES,HOSTNAME)


listener.ora

LISTENER =
  (DESCRIPTION_LIST
  (DESCRIPTION =
   (ADDRESS = (PROTOCOL = TCP)(HOST= abc)(PORT=1521))
  )
 )


tnsnames.ora

ORCL =
  (DESCRIPTION =
   (ADDRESS = (PROTOCOL = TCP) (HOST = abc) (PORT = 1521)
  )

  (CONNECT_DATA =
   (SERVER =DEDICATED)
    (SERVICE_NAME = ORCL)

 )

can you check it again please as getting same error
0
 
slightwv (䄆 Netminder) Commented:
tnsping orcl?

Is there only one Oracle product on that server?
0
 
Tomas Helgi JohannssonCommented:
      Hi!

You need to provide a SID_LIST_LISTENER in your listener.ora file
describing the ORACLE_HOME etc that belongs to the SID.

Also try to add (if that doesn't work) the param EZCONECT to the
NAMES.DIRECTORY_PATH=(TNSNAMES,HOSTNAME,EZCONNECT)

Regards,
    Tomas Helgi
0
 
taazAuthor Commented:
$tnsping orcl
used parameter files
/u00/app/oracle/product/11.2.0/network/admin/sqlnet.ora
TNS-03505 failed to resolve name
0
 
taazAuthor Commented:
@ID: 37025482

yes

0
 
sdstuberCommented:
and the files above are from

/u00/app/oracle/product/11.2.0/network/admin

?

did you fix the tnsname.ora error I pointed out?

neither "orc" nor "orcl" are defined given the tnsnames.ora you have specified because it has improper content
0
 
taazAuthor Commented:
the typo error were not in the files  it was my mistakes writing it here.




0
 
taazAuthor Commented:
@ID: 37025570

Yes
0
 
slightwv (䄆 Netminder) Commented:
TomasHelgi,

Again, the TNS-03505 is not listener related.
0
 
slightwv (䄆 Netminder) Commented:
from a command prompt post the results of: which tnsping
0
 
taazAuthor Commented:
@ID: 37025670

/u00/app/oracle/product/11.2.0/bin/tnsping
0
 
slightwv (䄆 Netminder) Commented:
One more from a command line:
 ls -al /u00/app/oracle/product/11.2.0/network/admin
0
 
taazAuthor Commented:
i have the following in that directory      ls -al /u00/app/oracle/product/11.2.0/network/admin with
-wr-r--r--

listener.ora
tnsnames.ora
sqlnet.ora
shrept.lst
sqlnet.ora
0
 
slightwv (䄆 Netminder) Commented:
I was looking for the permissions and owners of the individual files not just the files themselves.
0
 
sdstuberCommented:
rather than retyping the output,  please just cut and paste

it should be easier for you and it makes sure the content is preserved
0
 
taazAuthor Commented:

-rw-r--r--  1 oracle oracle  dba  830 set 12  12:12  listener     sameowner for all the files
0
 
slightwv (䄆 Netminder) Commented:
Running out of thinkgs this could be.


From a command prompt post the results of:
export TNS_ADMIN=/u00/app/oracle/product/11.2.0/network/admin
tnsping orcl



Is there a reason you cannot copy/paste the screen results?
0
 
sdstuberCommented:
what is "set 12"  ?
0
 
taazAuthor Commented:
I've requested that this question be deleted for the following reason:

i have got the solution from the previous answers
0
 
slightwv (䄆 Netminder) Commented:
What was the solution?
0
 
taazAuthor Commented:
@slightwv

well you are right i mean absolutely right, "Again, the TNS-03505 is not listener related."
it was a space error in the tnsnames.ora file

I  # the first line

#
ORCL =
   (DESCRIPTION =
         (ADDRESS_LIST =
         (ADDRESS = (PROTOCOL = tcp) (HOST = hostname) (PORT = 1521))
         )

        (CONNECT_DATA =
           (SERVER = DEDICATED)
               (SERVICE_NAME = ORCL)
       )
    )

I really appreciate to slightwv and sdstuber.  You deserve all the points. I should not have requested to delete the question as you put me to the right track to come to the solution.
please accept my appology.
0
 
slightwv (䄆 Netminder) Commented:
If we did not assist in the final answer then we should not get the points.

We were just curious as to the final solution.

Personally I wasn't aware that the tnsnames.ora file needed at least one comment at the top.  I knew it was picky about syntax but not that picky.

Feel free to accept your last post as the answer.  This might help others in the future.
0
 
slightwv (䄆 Netminder) Commented:
Should also mention:  

If you receive the emails from this question saying 'Objection Posted', it is a bug.  No one is objecting to the closure.

A bug has been filed on this issue.
0
 
sdstuberCommented:
I don't understand the explanation.

having a # on a blank line won't hurt your tnsnames.ora

if you had the # on one of the lines in your ORCL stanza then it would mess it up.

I agree with the sentiment above.  
If we were helpful, then split however you feel is appropriate.
If we were not, then don't give either of us points.
0
 
taazAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.