intermittent error "NET: Invalid SID"

intermittent error "NET: Invalid SID"

Postby joeu » Wed 05 Jan 2011 12:50

I'm getting "NET: Invalid SID" intermittently. I'm only making 1 connection and it should be closed by the using statement.

Here is my code
Code: Select all
using(OracleConnection conn = new OracleConnection(connectionString))
            {
                OracleCommand command = conn.CreateCommand();
                command.CommandText = sql;
                conn.Open();
                int aff = command.ExecuteNonQuery();                 
            }


Here is my connection string:
Code: Select all
Data Source=MyDbServer;Port=1521;SID=ORCL;Direct=true;User Id=system;Password=myPassword;


Here is the stack trace:
Code: Select all
at Devart.Data.Oracle.DirectUtils.a(Int32 A_0)
   at Devart.Data.Oracle.br.a(String A_0, Int32 A_1, String A_2)
   at Devart.Data.Oracle.y.a(t A_0, av A_1)
   at Devart.Data.Oracle.OracleInternalConnection..ctor(t connectionOptions, OracleInternalConnection proxyConnection)
   at Devart.Data.Oracle.b0.a(l A_0, Object A_1, DbConnectionBase A_2)
   at Devart.Common.DbConnectionFactory.a(DbConnectionPool A_0, l A_1, DbConnectionBase A_2)
   at Devart.Common.DbConnectionPoolGroup.a(DbConnectionPool A_0, DbConnectionBase A_1)
   at Devart.Common.DbConnectionPool.a(DbConnectionBase A_0)
   at Devart.Common.DbConnectionPool.GetObject(DbConnectionBase owningConnection)
   at Devart.Common.DbConnectionFactory.a(DbConnectionBase A_0)
   at Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
   at Devart.Common.DbConnectionBase.Open()
   at Devart.Data.Oracle.OracleConnection.Open()
   at xxx..OracleAdminRepository.ExecuteNonQuery(String sql, String connectionString) in D:\xxx.DAL\OracleAdminRepository.cs:line 223
   at xxx.OracleAdminRepository.CanMakeOracleConnection(String server, Int32 port, String SID, String user, String password, OracleUserConnectionMode connectionMode) in D:\xxx.OracleAdminRepository.cs:line 200
joeu
 
Posts: 9
Joined: Wed 18 Aug 2010 17:12

Postby Shalex » Wed 05 Jan 2011 18:01

1. Please specify your current version (x.xx.xxx) of dotConnect for Oracle. You can find it in the Tools > Oracle > About menu of Visual Studio. Have you tried the latest (6.0.70) build?
2. Does it make difference if pooling is turned off (the "Pooling=false;" connection string parameter)? It is turned on by default.
3. Can this issue be caused by Oracle Server itself (maybe it restarts) or network problems in your environment?
Shalex
Devart Team
 
Posts: 7377
Joined: Thu 14 Aug 2008 12:44

Invalid SID

Postby landerson » Fri 04 Mar 2011 21:41

I have had two users of my application report this same error, 'Error 1 - NET: Invalid SID'

My current version of dotConnect is 6.0.58. I am using VS 2010, .NET Framework 4.0.

This is a connection string from one of my users:
Connection String = "Pooling=false; Password=***; User ID=***; SID=OPRD; Server=***.*.**.*; Port=1521; Direct=true; Trim Fixed Char=false;"

Another connection string for a different user is:
Connection String = "Pooling=false; Password=***; User ID=**; SID=OPRD; Server=*****; Port=1521; Direct=true;"

There are currently no network issues reported from either user.
landerson
 
Posts: 2
Joined: Mon 19 Jul 2010 21:51

Postby Shalex » Mon 07 Mar 2011 11:49

landerson, the 'NET: Invalid SID' error indicates that connection to the specified socket (the server address + port) is established but there is no database instance with the specified SID available at the moment.
The possible reasons:
1) connection string contains an incorrect value for the SID parameter;
2) database instance is not responding (database service is stopped or in the process of restart, there are internal Oracle server's problems).

We recommend you to localize the problem in the following way. When the error occurs again, try to establish connection in the OCI mode with dotConnect for Oracle or using other tools to make sure that database instance is alive and responding. Most probably, connections via other tools will also fail.
Shalex
Devart Team
 
Posts: 7377
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle