468,537 Members | 1,994 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

What is the use of tnsnames.ora?

8
I'm writing an application in ASP.NET using C# for code behind and i'm also using oracle 10g. I thought when i retrieve data from the DB first tnsnames.ora is referred. But my experience is that server name given in web.config is directly connected whether or not entry is present in tnsnames.ora. Then why do we need a tnsnames.ora?
Jun 14 '07 #1
7 8159
debasisdas
8,127 Expert 4TB
It defines the application can connect to which database,server address using which port . its for reference of database.
The web.config file is for webpages not for the database.

a typical entry in tnsname.ora file is as follows.
----------------------------------------------------------------------
Expand|Select|Wrap|Line Numbers
  1. OM =
  2.   (DESCRIPTION =
  3.     (ADDRESS = (PROTOCOL = TCP)(HOST = is-18)(PORT = 1521))
  4.     (CONNECT_DATA =
  5.       (SERVER = DEDICATED)
  6.       (SERVICE_NAME = Om)
  7.     )
  8.   )
  9.  
  10. EXTPROC_CONNECTION_DATA =
  11.   (DESCRIPTION =
  12.     (ADDRESS_LIST =
  13.       (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
  14.     )
  15.     (CONNECT_DATA =
  16.       (SID = PLSExtProc)
  17.       (PRESENTATION = RO)
  18.     )
  19.   )
  20.  
  21. MES =
  22.   (DESCRIPTION =
  23.     (ADDRESS_LIST =
  24.       (ADDRESS = (PROTOCOL = TCP)(HOST = 10.35.15.3)(PORT = 1521))
  25.     )
  26.     (CONNECT_DATA =
  27.       (SID = MES)
  28.     )
  29.   )
  30.  
  31. BDCORA =
  32.   (DESCRIPTION =
  33.     (ADDRESS_LIST =
  34.       (ADDRESS = (PROTOCOL = TCP)(HOST = 10.35.12.16)(PORT = 1521))
  35.     )
  36.     (CONNECT_DATA =
  37.       (SERVICE_NAME = orcl1)
  38.     )
  39.   )
  40.  
  41. MESTEST =
  42.   (DESCRIPTION =
  43.     (ADDRESS_LIST =
  44.       (ADDRESS = (PROTOCOL = TCP)(HOST = 10.35.14.155)(PORT = 1521))
  45.     )
  46.     (CONNECT_DATA =
  47.       (SERVICE_NAME = MESTEST)
  48.     )
  49.   )
  50.  
Jun 14 '07 #2
lrg
8
My application is connecting to a server which isn't entered in tnsnames.ora. Why is this happening?
Jun 14 '07 #3
debasisdas
8,127 Expert 4TB
Is that defined in web.config ???
Jun 14 '07 #4
lrg
8
Yes, server name is defined in web.config. But how is it possible to find out the correct server from the name alone? No ip address or port no or any other detail is given.
Jun 14 '07 #5
debasisdas
8,127 Expert 4TB
You can use either IP address OR servername.

Because as there can't be more than one system with same IP address there can't be more than one system by the same in the same network.
Jun 14 '07 #6
lrg
8
thanks a lot. now i'm clear.
Jun 14 '07 #7
debasisdas
8,127 Expert 4TB
Hi
Irg
Welcome to TSDN.

You have reached the right place for knowledge shairing.

Here you will find a vast resource of related topics and code.

Feel free to post more doubts/questions in the forum.

But before that give a try from your side and if possible try to post what/how you have approached to solve the problem.

It will help Experts in the forum in solving/underestanding your problem in a better way.

Please follow the posting guidelines in every new post/reply.

please specify your post/question clearly.

Dont expect others to guess and solve your problem.

Regards

Debasis
Jun 14 '07 #8

Post your reply

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

Similar topics

220 posts views Thread by Brandon J. Van Every | last post: by
699 posts views Thread by mike420 | last post: by
92 posts views Thread by Reed L. O'Brien | last post: by
137 posts views Thread by Philippe C. Martin | last post: by
1 post views Thread by Adam Ruth | last post: by
6 posts views Thread by bdj | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.