Previous Topic

Next Topic

Book Contents

Book Index

Oracle - Diagnosing Connection Problems

If you are having problems connecting to your Oracle database, then you should follow the following steps for diagnosing this:

tnsnames.ora

The information about the Oracle service names, and how to connect to them, is given in the Oracle file tnsnames.ora. In many cases, connection problems have happened because the wrong tnsnames.ora file is being used.

Oracle looks at the following locations for tnsnames.ora:

To complicate matters:

To clear up this uncertainty, it is recommended that the TNS_ADMIN environment variable is set to refer to directory where tnsnames.ora is located. All Oracle products and AQT will then use this tnsnames.ora file.

To view environment variables, open a Windows command window and enter SET. To permanently set an environment variable, go to the Windows Control Panel > System. Click on the Advanced tab and then the Environment Variables button (this is for Windows XP - other Windows versions may have these in a different location).

Running AQT on a 64-bit version of Windows

If you are running AQT on a 64-bit version of Windows, you may fail to connect with message:

TNS could not resolve the connect identifier

This can happen due to a bug in the Oracle client in the 64-bit environment. This is described below.

By default, AQT will be installed into C:\Program Files (x86)\Advanced Query Tool. The Program Files (x86) directory structure is used for 32-bit applications. However there is a bug in the Oracle client - when you run a program which has a bracket in the path, the Oracle client will fail to parse tnsnames.ora correctly, resulting in the above message.

The resolution to this problem is to install AQT into a directory that doesn't have a bracket in the name.