Determine your ORACLE_HOME value.

The first thing to check is the ORACLE_HOME value. Examine the following key in your Windows registry:

HKEY_LOCAL_MACHINE\Software\ORACLE

There should be an entry for ORACLE_HOME, as well as many other entries. In this case, my ORACLE_HOME on this Windows NT 4.0 box is "D:\ORANT":

[HKEY_LOCAL_MACHINE\Software\ORACLE]
        "ORACLE_HOME"="D:\ORANT"

If you have Oracle 8i, Oracle 9i, or an Oracle product called the "Home Switcher" that gives you the option of changing ORACLE_HOME settings to reconfigure your computer for access to several different types of Oracle databases, then your registry settings will look like this:

[HKEY_LOCAL_MACHINE\Software\ORACLE\ALL_HOMES]
        "HOME_COUNTER"="1"
        "DEFAULT_HOME"="DEFAULT_HOME"
        "LAST_HOME"="0"
[HKEY_LOCAL_MACHINE\Software\ORACLE\HOME0]
        "ID"="0"
        "ORACLE_HOME"="D:\ORANT"
        "ORACLE_HOME_NAME"="DEFAULT_HOME"

When Oracle connects, it will look in ALL_HOMES for the "LAST_HOME" value, which in this case is zero "0". It appends zero to "HOME" to produce "HOME0", then it looks in HKLM\Software\ORACLE\HOME0 for the ORACLE_HOME value.

 

Make sure ORACLE_HOME\bin is in PATH

ORACLE_HOME\bin must be in your PATH environment variable. Go to a DOS prompt, type PATH and see what your path is. It could look like this:

PATH=C:\PROGRA~1\MSOFFICE\OFFICE;C:\WINNT;C:\ORANT\BIN;

You could either go through the Control Panel to alter the PATH, or edit AUTOEXEC.BAT in the root c:\ folder.

 

Make sure that the Oracle interface DLL is in the BIN folder TOAD requires an Oracle interface DLL to connect.

Depending on the database version you are connecting to, it is called ORAxy.DLL, where xy is the database version, e.g., for 7.0 it is called ORA70.DLL, 7.1 it is called ORA71.DLL, etc. For Net8/Oracle 8i, the DLL is called ORACLIENT8.DLL. For Oracle 9i, the DLL is called ORACLIENT9.DLL. If this file is not in the BIN folder, then TOAD cannot connect.

 

Check for TNS_ADMIN value

Check the registry again for:

[HKEY_LOCAL_MACHINE\Software\ORACLE]
        "TNS_ADMIN"="D:\ORANT\network\admin"

"TNS_ADMIN" should equal something like "D:\ORANT\network\admin" for Windows NT machines. TNS_ADMIN can be blank, in which case it will default to the ORACLE_HOME\network\admin or ORACLE_HOME\net8\admin folder. Look in the tnsnames.ora file. Make sure you have an entry for the database alias you are using. After this has been checked, reboot the machine. The connection should succeed.

About the Author

Steve Hilker

Steve Hilker was a Product Manager for Quest Software. Steve has over 35 years technical experience spanning application development, system administration, database management and various management positions at several software companies. Steve was the founder of RevealNet, best known for its desktop knowledge bases and unique database tools such as PL/Formatter. RevealNet was acquired by Quest Software in 2001. He's had the pleasure of being the product manager for many of Quest's database tools.

Start the discussion at forums.toadworld.com