Discussion Locked

ODBC Connectivity

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,

While getting ODBC connectivity to oracle backend I am getting problem "TNS cannot be resolved"
I check server connectivity also that is fine. I am using WIN98 as OS and Oracle 7.0 as backend server.
I am using server name ORCL, username and password as SCOTT and TIGER.
If anybody has face same kind of problem please write me the solution.

Bye
Zabin

7 replies

by craig_hochgraef

On the client side, check your Oracle TNSNAMES.ora file.

Depending on the version of Oracle, the TNSNAMES.ORA file is located in

D:\oracle\network\admin

It needs to have an entry like this...

ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = server_name)
(PORT = 1521))
)
(CONNECT_DATA =
(SID = ORCL)
)
)

The HOST can be either the server name or the server IP address.
The port number has to match the port number that the LISTENER is listening on, on the server.

From the server you can query for what the Listener is listening for by using the LSNRCTL command.

Ex: d:\oracle\bin\lsnrctl stat

There are a plethora of other problems that can cause you to have TNS connectivity problems, this is just a start.

by it-sage (bschirf)

Oracle can be a tricky animal. =^)

As already posted, check the Admin directory for the TNSNAMES.ORA file. This file is simply a text file that can be edited via Notepad.

Use the convention mentioned eariler but be very careful about the parenthesis. One missing "(" and the whole thing is blown.

One nice thing is that the TNSNAMES is ready dynamically. This means that once you make a change, you don't have to reboot to make the changes take place.

One utility that I use to varifythat my TNSNAMES.ORA file is working is TNSPING. This is sorta like PING but uses Oracle to test the connectivity. Just jump to a command prompt and run:
TNSPING ORCL
The result will tell you if you have a problem with the TNSNAMES file.

HTH...

by sedison

I agree with response 1 and 2. Remember if you edit the tnsnames.ora file not using the oracle net utility to not use tabs in the file. Oracle will choke on them. use spaces or cut and paste on that already works and edit that one with the right port and sid.

This discussion is closed to new replies.