« 3 new discoveries in Oracle Database 11g | Main | Oracle Enterprise Linux 5 can detect USB sound device »

ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA

ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA

After installing the ODT.NET 11g in my F Drive, I found F:appchanmmproduct11.1.0client_1NetworkAdmin does not consist of any file but a directory named Sample. So I did not do anything after installation and straightaway run Visual Studio 2008. When I was creating a new Data Connections I hit the error: ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA.

The fact is, the files in the Sample directory are meant to be edited and put it in the ..NetworkAdmin directory. The sqlnet.ora and tnsnames.ora are the files that need to be edited.

Surprisingly my sqlnet.ora needs to remark a line to let the error gone. The example as below:

SQLNET.AUTHENTICATION_SERVICES= (NTS)

# NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

After I have edited the files sqlnet.ora and tnsnames.ora in Sample directory and copied them from F:appchanmmproduct11.1.0client_1NetworkAdminSample directory to F:appchanmmproduct11.1.0client_1NetworkAdmin then remark one line of sqlnet.ora. Finally I am able to connect from Visual Studio 2008 to Oracle Database 11g.

If you hit the same error then there is no harm to have a try on what I have done. Have a good experience with ODP.NET 11g and Oracle Database 11g.

Note: Thanks to Mark A. William help me to solve the error on ODP.NET forum.


Comments (3)

not work!!!

Santhosh:

Hey I'm still getting the same problem.

Suresh Kumar G:

Shutdown the system and restart it then stop the listener and restart it again.
Check "lsnrctl services" to ensure no SID blocked.

Post a comment

About This Entry

This page contains a single entry from the blog posted on January 27, 2008 12:58 AM.

The previous post in this blog was 3 new discoveries in Oracle Database 11g.

The next post in this blog is Oracle Enterprise Linux 5 can detect USB sound device.

Many more can be found on the main index page or by looking through the archives.

Top Tags

Powered by
Movable Type and Oracle