Manage the Windows tnsnames.ora file location

Article

Manage the Windows tnsnames.ora file location

Kenny Smith

The following is database administration tip #4 from "30 tips in 30 minutes," brought to you by the IOUG. Return to the main page for more tips on this topic.


If you are having trouble with your database connection, you may need to examine which tnsnames file you are using. If you have many tnsnames files on your machine, you may not be reading the one you think you are.

You can have a local version and a system version. When a client connection is requested the service name or parameter is first searched in the local version of this configuration file. If the service is not found in the local version it is searched in the system version.

The system version is located in the "$ORACLE_HOMENET80ADMIN" directory for Oracle8.0 software. The system version is located in the "$ORACLE_HOMENETWORKADMIN" directory for Oracle7, 8i and 9i software. A local version can exist in the current working directory where the application is running. For example, if, on Windows NT you start SQL*Plus in "$ORACLE_HOMEBIN", then Net8 looks for a local TNSNAMES.ORA in "ORANTBIN" before looking for the system version. The connection hassles increase when you have multiple local files in various directories.

Manage only TNSNAMES.ORA file exist and that it be located in a single directory. On Unix platforms, setting

    Requires Free Membership to View

    By submitting your registration information to SearchOracle.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchOracle.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

the environment variable $TNS_ADMIN= will direct Net8 to look for the file in that location. On Windows NT, the TNS_ADMIN in located in the registry. Place the Net8 configuration files in a single directory. Then set the TNS_ADMIN environment variable to point to that one directory.


Get more tips in minutes! Return to the main page.

About the author: Kenny Smith has been working with Oracle technology on HP servers for over a decade. He specializes in Oracle database architecture, database administration and development. He has presented at numerous Oracle conferences on two continents. He has published many articles describing Oracle solutions and has co-authored "Oracle backup and recovery 101" from Oracle Press.

IOUG: Become a member of the IOUG to access the paper referenced here and a repository of technical content created for Oracle users by Oracle users.


Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.