Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

I get this error when I tried to connect to Oracle database

Hi all,
Please help it is very urgent.
I get error when I tried to connect oracle database:
Error Type:
OraOLEDB (0x80004005)
ORA-12154: TNS:could not resolve service name
Thanks all in advance.
[228 byte] By [ssss] at [2007-11-9 17:50:34]
# 1 Re: I get this error when I tried to connect to Oracle database
Yes you need the Oracle client installed.

This error means Oracle can't find the name of your database in it's TNSNAMES.ORA
file. When you type in a connect string i.e.

user/password@mydatabase

Oracle looks up the TNS entry to find out what'mydatase' is i.e. machine
name, port no. and instance name

Use the NET8 Assistant to set up a new TNS entry, or edit the file manually.

You should have an entry looking like this:

MYDATABASE.WORLD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 1.2.3.4)(PORT = 1521))
(CONNECT_DATA = (SID = ORCL))
)

the file is located in either:

/Oracle/Network/Admin/tnsnames.ora
or
/oracle/net8/admin/tnsnames.ora

Pants

"ssss" <mike_Mike_8@hotmail.com> wrote:
>
>Hi all,
>Please help it is very urgent.
>
>I get error when I tried to connect oracle database:
>Error Type:
>OraOLEDB (0x80004005)
>ORA-12154: TNS:could not resolve service name
>
>Thanks all in advance.
mister pants at 2007-11-11 23:16:50 >