469,287 Members | 2,479 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,287 developers. It's quick & easy.

Tns name Not Found


I am new To Oracle.When I am trying to log in Sql* Plus , There It is asking for the USername And Password,I Put that Information .After that it ask me Host string.. What should I Put there.When I put there it says "Tns name Not found". what is the concept of Tns what does it represents.

I found the same error when i try to login in PLSQL developer to do my work.

Can anyone help me.
Mar 4 '09 #1
10 4676
13,262 8TB
You need to verify that the credentials you are providing match the ones in the tnsnames.ora file in your oracle directory. If you have the SQL Net Easy Configuration wizard then run it to correct and verify your configuration.
Mar 4 '09 #2
308 256MB
Then what does the host string represents ..?
Mar 4 '09 #3
Hi All,

Thanks for the time you gave to resolve my question .

Anyways madankarmukta,
I am asking Hoststring in the context when we try to login in sql* plus .
Mar 4 '09 #4
8,127 Expert 4TB
host string is the name of the database that you are trying to connect. If you have not specified any other name the default name would be ORCL. If the DB is installed on your pc you need not specify the HOST STRING.
Mar 5 '09 #5
Okay.. SO the host string is basically the IP address of the machine where the database is installed..Please correct me If I am going wrong.

It means if the oraganizantion is having a shared machine with the Db instyalled on it and the one acting as a oracle server , then while accessing database we need to specify that IP in the host string for login in sql* plus which in turn need to specify in tns.ora file.

Please correct me If I am getting wrong.
Mar 5 '09 #6
8,127 Expert 4TB
you need the name of the database not the IP address of the system.
Mar 5 '09 #7
785 Expert 512MB
It represents the host-name, the port number and the database name (= SID, =ServiceID). It can also contain additional non-mandatory parameters.
You can give it directly or you just give a single name as reference.
This single name then is looked up in the tnsnames.ora file.

as direct string:
or as reference:
If you give it as reference, you must have following entry in tnsnames.ora file:
Expand|Select|Wrap|Line Numbers
  1. myOra=
  3.     (ADDRESS_LIST =
  4.        (ADDRESS =
  5.           (PROTOCOL = TCP)
  6.           (HOST = myHostNameOrIp)
  7.           (PORT = 1526)
  8.        )
  9.     )
  10.     (CONNECT_DATA =
  11.        (SID=myOracleDB)
  12.     )
  13.   )
Buy the way, you can use "tnsping" to see if the connection is ok or not.
Mar 9 '09 #8
Host String refers to database name or SID.
Mar 10 '09 #9
Thanks for the detailed and explanatory answer.

So, I need to add the reference in tnsnames.ora file containing protocol ,Host and other information which Oracle server will use during startup.

Thank you very much.
Mar 10 '09 #10
785 Expert 512MB
Not necessarily. It is advised, but sometimes you can't do it because you have no rights to modify this file. You have 2 other options:
1.) give the long string directly
2.) make an entry in database table USER_DB_LINKS. Put the long string there in column HOST
Mar 10 '09 #11

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

11 posts views Thread by Andrew Thompson | last post: by
1 post views Thread by Srini | last post: by
4 posts views Thread by Maarten Verhage | last post: by
17 posts views Thread by sounak | last post: by
11 posts views Thread by Alexander Walker | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.