During the development of a Sitefinity based application that used an Oracle 11g RDBMS as the data repository I ran into the following error:

ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

I had tested the connection using TNSPing which resolved correctly and I tried SQLPlus to try connecting, which failed with the same error as above.

I used following command/syntax for SQLPlus:

sqlplus username/password@addressname[or host name]

We had verified that:

  • The TNS Listener on the server was running.
  • Oracle itself on the server was running.

The solution was to ensure that in tnsnames.ora the SERVICE_NAME was a valid service name in the database.

To find valid service names, you can use the following query in oracle:

select value from v$parameter where name=’service_names’

Once I updated tnsnames.ora to:

TEST =
   (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = *<validhost>*)(PORT = *<validport>*))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = *<servicenamefromDB>*)
    )
)

I then ran the following:

sqlplus user@TEST

It resolved the issue. The listener is basically telling you that whatever SERVICE_NAME you are using isn’t a valid service according to the DB.