Invalid Service Name using dotConnect for Oracle direct connect

Invalid Service Name using dotConnect for Oracle direct connect

Postby John Liu » Fri 20 Mar 2015 21:19

dotConnect for Oracle version 8.2.90 with EntityFramework 6.0.2

Using the following connection string, I can connect to almost all our Oracle 11g instances
<add name="myDbContext" connectionString="server=10.1.20.86;port=1521;direct=True;service name=CDB;user id=aaa;Password=pppp;" providerName="Devart.Data.Oracle" />

Trying to connect to one of our databases, it gives me the error "Invalid Service Name". But it is ok to connect to it using SID with the following connection string
<add name="myDbContext" connectionString="server=10.1.20.86;port=1521;direct=True;SID=CDB;user id=aaa;Password=pppp;" providerName="Devart.Data.Oracle" />
thanks
JL
John Liu
 
Posts: 60
Joined: Wed 14 Nov 2012 20:58

Re: Invalid Service Name using dotConnect for Oracle direct connect

Postby Pinturiccio » Tue 24 Mar 2015 16:37

The SID and 'Service Name' connection string parameters must specify the SID and Service Name respectively, they are two different connection string parameters, please see:
http://www.devart.com/dotconnect/oracle/docs/?Devart.Data.Oracle~Devart.Data.Oracle.OracleConnection~ConnectionString.html
http://www.devart.com/dotconnect/oracle/docs/?DirectMode.html

Most likely, in your case, these parameters have different values and you use the value of the SID.
Please refer to these posts for more information:
http://www.dba-oracle.com/t_oracle_sid_instance_name_service_name.htm
http://stackoverflow.com/questions/43866/how-sid-is-different-from-service-name-in-oracle-tnsnames-ora
Pinturiccio
Devart Team
 
Posts: 1933
Joined: Wed 02 Nov 2011 09:44


Return to dotConnect for Oracle