-1

when I log on some oracle database, I can connect without tnsnames.ora. However, when I try to log on some other database, it reject because of TNS:connection timeout. What is changed? What does TNS file do? Why I have to have this ora file?

Thank you

elifekiz
  • 1,456
  • 13
  • 26

1 Answers1

0

File tnsnames.ora just resolves your database alias to full databases address.

Assume you have an entry as this:

ORA11 =
 (DESCRIPTION = 
   (ADDRESS_LIST =
     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.0)(PORT = 1521))
   )
 (CONNECT_DATA =
   (SERVICE_NAME = ORA12)
 )
)

Then you can start for example SQL*Plus

sqlplus SCOTT@ORA11 

or

sqlplus SCOTT@"(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.0)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORA12)))"

It does the same, the first way is just more convenient.

Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110