Oracle service crashes when i connect in direct mode

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
andreas.desl
Posts: 2
Joined: Wed 15 Sep 2010 07:42

Oracle service crashes when i connect in direct mode

Post by andreas.desl » Wed 15 Sep 2010 08:48

I have following problem:

Sometimes the oracle service terminates without an entry in the alert.log when a connection is established.

Reproduceable with 5.70.152 and 5.35.37 and Oracle 11g (11.1.0.6).
Not reproduceable with Oracle 11.2.0.1
Database and test-code both runs on Windows XP-machines.

The following code produces the problem (not always, but very often):

Code: Select all

      
      int count = 1000;

      for (int i = 0; i < count; i++)
      {
        Console.WriteLine(i);
        try
        {
          OracleConnection connection =
            new OracleConnection(
              "User Id=datadel;Password=datadel;Server=testremn;Pooling=false;Direct=True;Sid=orc1;Port=1521");
          connection.Open();
          connection.Close();
        }
        catch (Exception ex)
        {
          Console.WriteLine(ex.Message);
        }
      }

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 16 Sep 2010 16:21

I cannot reproduce the problem with dotConnect for Oracle v 5.70.152 and Oracle 11g (11.1.0.6). Please give us the following information:
1) call stack of your application when the service terminates. If the Debug mode of Visual Studio you are running your code from doesn't show call stack, you can obtain it by connecting from another instance of Visual Studio (2nd) (Debug | Attach to Proccess) to the first VS. Before attaching don't forget to make these settings in your 2nd Visual Studio: a) in the (Debug | Exceptions) window check Common Language Runtime Exceptions; b) in the (Tools | Options) window, Debugging | General - uncheck Enable Just My Code (Managed Only);
2) the last entries from alert.log (execute select value from v$parameter where name = 'background_dump_dest'; to find the directory with the log files).

andreas.desl
Posts: 2
Joined: Wed 15 Sep 2010 07:42

Post by andreas.desl » Fri 17 Sep 2010 07:30

1) no exception is thrown when the service terminates. only the next try to connect to the database after the service is terminated ends with an OracleException ("NET: Invalid SID")
Here is the callstack:
Devart.Data.Oracle.dll!Devart.Data.Oracle.DirectUtils.a(int A_0 = 0x000000ce) + 0xac Bytes
Devart.Data.Oracle.dll!Devart.Data.Oracle.bq.a(string A_0 = "testremn", int A_1 = 0x000005f1, string A_2 = "orc1") + 0x1a7 Bytes
Devart.Data.Oracle.dll!Devart.Data.Oracle.z.a(Devart.Data.Oracle.u A_0 = {Devart.Data.Oracle.u}, Devart.Data.Oracle.at A_1 = null) + 0x16a Bytes
Devart.Data.Oracle.dll!Devart.Data.Oracle.OracleInternalConnection.OracleInternalConnection(Devart.Data.Oracle.u connectionOptions = {Devart.Data.Oracle.u}, Devart.Data.Oracle.OracleInternalConnection proxyConnection = null) + 0x2c7 Bytes
Devart.Data.Oracle.dll!Devart.Data.Oracle.b0.a(Devart.Common.k A_0 = {Devart.Data.Oracle.u}, object A_1 = null, Devart.Common.DbConnectionBase A_2 = {Devart.Data.Oracle.OracleConnection}) + 0xc6 Bytes
Devart.Data.Oracle.dll!Devart.Common.DbConnectionFactory.a(Devart.Common.DbConnectionBase A_0 = {Devart.Data.Oracle.OracleConnection}, Devart.Common.k A_1 = {Devart.Data.Oracle.u}) + 0xae Bytes
Devart.Data.Oracle.dll!Devart.Common.DbConnectionFactory.a(Devart.Common.DbConnectionBase A_0 = {Devart.Data.Oracle.OracleConnection}) + 0x82 Bytes
Devart.Data.Oracle.dll!Devart.Common.DbConnectionClosed.Open(Devart.Common.DbConnectionBase outerConnection = {Devart.Data.Oracle.OracleConnection}) + 0xd7 Bytes
Devart.Data.Oracle.dll!Devart.Common.DbConnectionBase.Open() + 0xc4 Bytes
Devart.Data.Oracle.dll!Devart.Data.Oracle.OracleConnection.Open() + 0x2e1 Bytes
> Test.exe!Test.Program.Test(string host = "testremn", string sid = "orc1", string user = "datadel", string password = "datadel") Zeile 49 + 0xb Bytes C#
Test.exe!Test.Program.Main(string[] args = {string[0x00000004]}) Zeile 32 + 0x11 Bytes C#
[Übergang von Systemeigen zu Verwaltet]
[Übergang von Verwaltet zu Systemeigen]
mscorlib.dll!System.AppDomain.ExecuteAssembly(string assemblyFile, System.Security.Policy.Evidence assemblySecurity, string[] args) + 0x3a Bytes
Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() + 0x2b Bytes
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) + 0x66 Bytes
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x6f Bytes
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x44 Bytes

2) alert.log since starting of the oracle service

Code: Select all

Fri Sep 17 09:13:55 2010
Instance shutdown complete
Fri Sep 17 09:14:01 2010
Starting ORACLE instance (normal)
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Picked latch-free SCN scheme 2
Using LOG_ARCHIVE_DEST_1 parameter default value as C:\oracle\oracle11g\RDBMS
Autotune of undo retention is turned on. 
IMODE=BR
ILAT =61
LICENSE_MAX_USERS = 0
SYS auditing is disabled
Starting up ORACLE RDBMS Version: 11.1.0.6.0.
Using parameter settings in server-side spfile C:\ORACLE\ORACLE11G\DATABASE\SPFILEORC1.ORA
System parameters with non-default values:
  processes                = 500
  timed_statistics         = TRUE
  memory_target            = 500M
  memory_max_target        = 500M
  control_files            = "C:\ORACLE\ORACLE11G\DATABASE\ORC1\CONTROL01.CTL"
  control_files            = "C:\ORA_DAT\CTL\ORC1\CONTROL02.CTL"
  db_block_size            = 16384
  db_cache_size            = 252M
  compatible               = "11.1.0.0.0"
  fast_start_mttr_target   = 0
  undo_tablespace          = "UNDOTBS01"
  undo_retention           = 10800
  recyclebin               = "OFF"
  sec_case_sensitive_logon = FALSE
  remote_login_passwordfile= "EXCLUSIVE"
  db_domain                = ""
  global_names             = FALSE
  job_queue_processes      = 20
  cursor_sharing           = "FORCE"
  audit_file_dest          = "C:\ORACLE\ORACLE11G\ADMIN\ORC1\ADUMP"
  open_links               = 4
  open_links_per_instance  = 4
  audit_trail              = "NONE"
  db_name                  = "ORC1"
  open_cursors             = 500
  optimizer_mode           = "ALL_ROWS"
  optimizer_index_cost_adj = 30
  optimizer_index_caching  = 80
  optimizer_dynamic_sampling= 2
  diagnostic_dest          = "C:\ORACLE\ORACLE11G"
Fri Sep 17 09:14:02 2010
PMON started with pid=2, OS id=1768 
Fri Sep 17 09:14:02 2010
VKTM started with pid=3, OS id=3364 at elevated priority
Fri Sep 17 09:14:02 2010
DIAG started with pid=4, OS id=504 
VKTM running at (20)ms precision
Fri Sep 17 09:14:02 2010
DBRM started with pid=5, OS id=1408 
Fri Sep 17 09:14:02 2010
PSP0 started with pid=6, OS id=1284 
Fri Sep 17 09:14:02 2010
DSKM started with pid=7, OS id=1068 
Fri Sep 17 09:14:02 2010
DIA0 started with pid=8, OS id=448 
Fri Sep 17 09:14:02 2010
MMAN started with pid=7, OS id=3620 
Fri Sep 17 09:14:02 2010
DBW0 started with pid=9, OS id=592 
Fri Sep 17 09:14:02 2010
LGWR started with pid=10, OS id=3444 
Fri Sep 17 09:14:02 2010
CKPT started with pid=11, OS id=3808 
Fri Sep 17 09:14:02 2010
SMON started with pid=12, OS id=3728 
Fri Sep 17 09:14:02 2010
RECO started with pid=13, OS id=3468 
Fri Sep 17 09:14:02 2010
MMON started with pid=14, OS id=396 
Oracle Data Guard is not available in this edition of Oracle.
ORACLE_BASE from environment = C:\oracle
Fri Sep 17 09:14:02 2010
alter database mount exclusive
Fri Sep 17 09:14:02 2010
MMNL started with pid=15, OS id=3296 
Setting recovery target incarnation to 1
Successful mount of redo thread 1, with mount id 1361875482
Database mounted in Exclusive Mode
Lost write protection disabled
Completed: alter database mount exclusive
alter database open
Thread 1 opened at log sequence 1366
  Current log# 1 seq# 1366 mem# 0: C:\ORACLE\ORACLE11G\DATABASE\ORC1\REDO01.LOG
  Current log# 1 seq# 1366 mem# 1: C:\ORA_DAT\RDLG\ORC1\REDO01.LOG
Successful open of redo thread 1
SMON: enabling cache recovery
Successfully onlined Undo Tablespace 2.
Verifying file header compatibility for 11g tablespace encryption..
Verifying 11g file header compatibility for tablespace encryption completed
Database Characterset is WE8MSWIN1252
Opening with internal Resource Manager plan
Starting background process SMCO
Fri Sep 17 09:14:12 2010
SMCO started with pid=17, OS id=3772 
replication_dependency_tracking turned off (no async multimaster replication found)
SMON: enabling tx recovery
Fri Sep 17 09:14:14 2010
Starting background process QMNC
Fri Sep 17 09:14:14 2010
QMNC started with pid=18, OS id=1528 
Errors in file c:\oracle\oracle11g\diag\rdbms\orc1\orc1\trace\orc1_ora_3632.trc:
ORA-00604: Fehler auf rekursiver SQL-Ebene 1
ORA-27477: "SYS.SCHEDULER_PROCESS_WORKAROUND_1" ist schon vorhanden
ORA-06512: in "SYS.DBMS_ISCHED", Zeile 99
ORA-06512: in "SYS.DBMS_SCHEDULER", Zeile 268
ORA-06512: in Zeile 3
Fri Sep 17 09:14:31 2010
Completed: alter database open
The file c:\oracle\oracle11g\diag\rdbms\orc1\orc1\trace\orc1_ora_3632.trc doesn't exist

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 17 Sep 2010 13:04

Please contact the Oracle support team to find out the reason of the Oracle Service termination. We cannot reproduce the problem in our environment.

lattmann
Posts: 2
Joined: Thu 23 Sep 2010 12:25
Location: Switzerland

Post by lattmann » Thu 23 Sep 2010 12:36

Are there any news on this topic? We get the same error. We run Oracle 10 XE on a 2008 Server. The application is a windows console app using .NET 3.5 SP1. dotConnect Version is 5.70.152.

With very low load, everything runs perfect. As soon as we get more load, we get a lot of these errors.

2010-09-23 09:17:54,595 [8] ERROR SALCOM.Interfaces.Common.Logger.SystemLogger [(null)] - The underlying provider failed on Open.
System.Data.EntityException: The underlying provider failed on Open. ---> Devart.Data.Oracle.OracleException: NET: Invalid SID
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, at A_1)
at Devart.Data.Oracle.OracleInternalConnection..ctor(t connectionOptions, OracleInternalConnection proxyConnection)
at Devart.Data.Oracle.b0.a(j A_0, Object A_1, DbConnectionBase A_2)
at Devart.Common.DbConnectionFactory.a(DbConnectionPool A_0, j A_1, DbConnectionBase A_2)
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 System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
--- End of inner exception stack trace ---
at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
at System.Data.EntityClient.EntityConnection.Open()
at System.Data.Objects.ObjectContext.EnsureConnection()
at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable.GetEnumerator()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at SALCOM.Interfaces.MP.DataAccess.Repositories.ArtikelRepository.GetArtikelByNr(String artikelNr) in C:\daten\wcs\SALCOM.Interfaces.MP\DataAccess\Repositories\ArtikelRepository.cs:line 38
at SALCOM.Interfaces.MP.Domain.FromWorkflows.ArticleDataWorkflow.Process() in C:\daten\wcs\SALCOM.Interfaces.MP\Domain\FromWorkflows\ArticleDataWorkflow.cs:line 78
at SALCOM.Interfaces.MP.Domain.MPInterface.processUnemptyFile(FileArrivedEventArgs e) in C:\daten\wcs\SALCOM.Interfaces.MP\Domain\MPInterface.cs:line 238

lattmann
Posts: 2
Joined: Thu 23 Sep 2010 12:25
Location: Switzerland

Post by lattmann » Thu 23 Sep 2010 20:51

I believe in my case the Oracle XE ran out of connections or any other resource (# of open cursors was very high too).

I properly implemented IDisposable on all repository classes to properly release the Entity Instances and the connections. We are still testing but it looks much better now.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 27 Sep 2010 14:49

Lattman, we cannot reproduce the problem in our environment. If possible, please send us a small test project with the DDL/DML script of database objects to reproduce the issue in our environment.

Post Reply