Blog dedicated to Oracle Applications (E-Business Suite) Technology; covers Apps Architecture, Administration and third party bolt-ons to Apps

Tuesday, December 16, 2008

Use a single tnsnames.ora on your Windows PC across 8i, 9i and 10g

One of the problems I have encountered over the years is multiple client versions on Windows machines and multiple tnsnames.ora files.  For example, a PC may have Oracle 8i, Oracle 9i and Oracle 10g clients installed.  Each home will use its own tnsnames.ora file.  This causes lot of confusion and sometimes we don't even know which tnsnames.ora file is being used.

An elegant solution to this problem is the environment variable TNS_ADMIN.  In Windows you can set environment variables by following these steps:

Right click on My Computer
Click on Properties
Click on Advanced tab
Click on Environment variables button.

You can set a new System environment variable called TNS_ADMIN and give the value as a common directory which will contain tnsnames.ora file.  For example TNS_ADMIN=c:\tns

Once you set this variable, irrespective of the Oracle client being used, c:\tns\tnsnames.ora will be the single tnsnames.ora file used to resolve oracle names.

3 comments:

Tom said...

Works great for SQL Developer too!

Anonymous said...

This is cool... after doing this all applications (Workflow / Forms and Reports 6i and 10g / TOAD / SQL Developer) all worked!

Anonymous said...

Great.....It worked buddyyy