Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
   
How tnsnames.ora and sqlnet.ora file work together?




By Vinod Udapudi
Oct 19, 2007

Digg! digg!     Print    email to friend Email to Friend

Note: This article was written for educational purpose only. Please refer to the related vendor documentation for detail.




How tnsnames.ora and sqlnet.ora file work together?

I would like to bring an article which explains how useful sqlnet and tnsnames files are and how they work together.

The default domain in the Sqlnet file is used for a example purpose only.

SCENARIO 1:

in tnsnames.ora

dba.world = (....)

in sqlnet.ora file

names.default_domain = world


So, in sqlplus log screen, the following can be typed in: hr/hr@dba

Note the fully qualified dbaworld would not be typed in, because it will be automatically appended to the end of the connect string specified.

SCENARIO 2:

in tnsnames.ora

dba.world = (....)

SCENARIO.NW.NOS.ORALCE.COM = (....)

in sqlnet.ora file

names.default_domain = world

What would happen in the Scenario where multiple domain have been defined in the tnsnames.ora but with only one sqlnet.ora? Just remember, the key is what is defined in the TNSNAMES.ORA file, sqlnet.ora is for convenience. 

The entire connect string can be typed in.

In sqlplus log screen, just type in :

hr/hr@dba <--- should again work

hr/hr@dba.world <--- should again work

hr/hr@SCENARIO <--- should *NOT* work, because in fact it will be SCENARIO.world

hr/hr@SCENARIO.NW.NOS.ORALCE.COM <--- should work

What is being said is that if the domain is added after the name when loginning as defined in the tnsnames.ora file, then don\'t use the default domain that is defined in the sqlnet.ora file.

SCENARIO 3:

In fact a sqlnet.ora file is not really needed for the purposes of login

E.g., in tnsnames.ora

dba = (....) <--- note here, no domain

SCENARIO.NW.NOS.BOEING.COM = (....)

no sqlnet.ora file exists anywhere.

In sqlplus log screen, just type in :

hr/hr@dba <--- should again work

hr/hr@SCENARIO.NW.NOS.BOEING.COM <--- should work

hr/hr@SCENARIO <--- should *NOT* work

hr/hr@dba.world <--- should *NOT* work

 

 
About author:

 




  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor