views:

202

answers:

2

I have a SSRS report which is using Business Object Provider. The dll has a connection with Oracle server. Whenever i run the report i keep on getting this error message:

"Oracle.DataAccess.Client.OracleException ORA-12514: TNS:listener does not currently know of service requested in connect descriptor "

Anyone knows why?

+1  A: 

It sounds like you installed the oracle client but have not yet set up your TNS listeners.

There should be a file called "tnsnames.ora" and inside that file you need to add a new listener. If it's a windows install there might also be a network configuration GUI.

Ben
What should i add in a new listener?
sanjeev40084
Connection to an oracle database can be done two ways, one is with a direct connection: ie host + password + port + schema. The other method is via a TNS Name. You store the host+pass+port in a tns file. Set the TNS_ADMIN=/path/to/folder/where/tnsfile/ and you reference said TNS file.
Achille
If you open up the tnsnames.ora file you should see an example and you can copy a profile from another DB and change the informaiton to your server and database.
Ben
@Achille: Connections in Oracle are either via SQL*Net Listener connections ("TNS Name" as you put it, although a TNSnames entry is not absolutely required) or Interprocess Communications (IPC), (Direct Connection). An IPC connection does not require a port specification, as it's not using TCP/IP. IPC connections DO require the client to be on the same system as the database.
DCookie
@DCookie thanks for the clarification
Achille
A: 

A general tnsnames.ora entry would look like this if you choose to go that way:

DBAlias =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = xxx.xxx.xxx.xxx)(PORT = 1521))
    (CONNECT_DATA = (SERVICE_NAME = YourDBServiceName))
  )

Your tnsnames.ora file typically resides in the ORACLE_HOME/network/admin directory.

Technically speaking, you're not "creating a listener", rather, you're defining an alias for an Oracle client network connect string, which will refer to a listener somewhere.

Alternatively, you can specify an EZConnect string, if you don't want to/can't mess with tnsnames.ora entries:

"Data Source=//yourserver:1521/yourDB;User ID=theUser;Password=thePW"

You will need an entry in the sqlnet.ora file to the effect of:

NAMES.DIRECTORY_PATH = (TNSNAMES, EZCONNECT)
DCookie