Connecting OracleClient + TNSless to .NET

We use System.Data.OracleClient and the abstract base classes DbConnection, DbCommand (etc.) to connect to Oracle.

The connection works great in our development stages. During the phase, we encounter an ORA-12514: TNS error: the listener is currently unaware of the service requested in the connection descriptor.

Our goal was to connect without a TNS record and provide all relevant information in the connection string (www.connectionstrings.com/oracle#19)

I can confirm that SQL plus will connect to the desired schema from an intermediate server (the listener is listening). The TNS record connected to SQLPlus matches all the credentials of the constructed query string.

SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));uid=myUsername;pwd=myPassword;

Is there an installation on the server that we skipped? Is there something we can customize?

Any help is appreciated.

+3
source share
4 answers

SID is not a service name. The service name is usually the fully qualified database name, and the SID is the short identifier.

The service name can be dbname.company.com, and your SID can be the name dbname. An instance can have several service names associated with it, but only one SID.

Change your SERVICE_NAME to SID in the connection string or provide your service name for the SERVICE_NAME option.

+7
source

, , Oracle OracleDbConnection OracleDbCommand. .

0

Oracle 10+, EZCONNECT ( Easy Connect). :

"Data Source=MyHost:MyPort/MyServiceName;User ID=myUserName;Password=myPassword"

Combined with Oracle Instant Client , this makes using Oracle almost professional! ...

0
source

Source: https://habr.com/ru/post/1718813/


All Articles