Search code examples
odp.net

ODP.NET Error when trying to open connection (ORA-1153 Encountered)


I have the following code:

string conString = ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString;
OracleConnection con = new OracleConnection {ConnectionString = conString};
con.Open();

With the following entry in the app.config (actual values removed where #)

<add name="MyConnectionString" connectionString="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=#myhost#)(PORT=#MyPort#)))(CONNECT_DATA=(SERVICE_NAME=#MyServiceName#));User Id=#UserId#;Password=#Password#; Pooling=false;" providerName="System.Data.OracleClient" />

When I hit the con.Open() I get the following error:

Oracle error ORA-1153 encountered

Solution

  • The problem here ended up being my host name was not fully qualified. I had servername and it should have been servername.domainstuff.domainstuff