04 April, 2007

Using tnsnames.ora with Oracle XE client

When installing Oralce XE client for Windows tnsnames.ora is not created by default, though it is pretty convenient way of connecting to database.

First, you have to add the variable TNS_ADMIN to your Oracle configuration in the registry.

Start regedit and go to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_XEClient.

Then add a new string named TNS_ADMIN. Set the value to the directory where you want to store the tnsnames.ora file.

tnsnames.ora file looks something like this:


XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)

No comments: