oracle重启后{oracle dataprovider超时

时间:2018-02-28 13:29:19

标签: c# oracle entity-framework

我有池化机制,它从oracle队列中读取数据。 一切正常,直到我重新启动oracle db。 然后,在调用this.Connection.Open();

时,我总是超时

当我在连接字符串中设置pooling = false时,问题不存在,但我不想这样做。

所以oracle池一定有问题,所以我试过

OracleConnection.ClearPool(this.Connection);
this.CloseConnection();

但是在oracle重新启动之后,这也无济于事,每当我的连接尝试打开时,我只是简单的超时。

public void MyMethod()
{
    try
    {
        this.OpenConnection();
        var oracleQueue = this.GetOracleQueue(queueName);

        return oracleQueue.Listen(null, listenWaitTimeout) != null;
    }
    catch (Exception e)
    {


        Console.WriteLine(e.Message);
    }
    finally
    {
        OracleConnection.ClearPool(this.Connection);
        this.CloseConnection();
    }

    return false;
}

protected void OpenConnection()
{
    if (this.Connection.State != ConnectionState.Open)
    {
        this.Connection.Open();
    }
}

我用:

Oracle.ManagedDataAccess.EntityFramework.12.1.022
Oracle.ManagedDataAccess.12.1.022
product\12.1.0\client_1\odp.net\bin\4\Oracle.DataAccess.dll

程序运行时我停止OracleServiceORCL服务

然后第一次尝试openConnection我得到了:

ORA-03113 end of file on communication channel
我得到了第二次尝试:

ORA-12514 TNS:listenere does not currently know of service requested in connect descriptor

第三个和下一个我得到了Connection request timned out

现在,当我运行OracleServiceORCL时,我的程序仍在抛出异常

当我重新启动程序时,它可以工作。

另外从性能监视器记录的日志中我可以看到类似死连接条目的内容:

TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (TraceFileName : C:\Temp\oracle.txt)
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (TraceLevel : 127)
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (TraceOption : 0)
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (CheckConStatus : 1)
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (UdtCacheSize : 4096)
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (StatementCacheSize : 0)
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (DynamicEnlist : 0)
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (FetchSize : 131072)
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (OCI_EVENTS : 0)
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (StatementCacheWithUdts : 1)
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (MetadataPooling : 1)
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (DBNotificationPort : -1)
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (ThreadPoolMaxSize : -1)
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (DBNotificationRegInterval : 0)
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (DemandOraclePermission : 0)
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (SelfTuning : True)
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (MaxStatementCacheSize : 100)
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (AppEdition : )
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (MetaDataXml : )
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (RevertBatchUpdateErrorHandling : 0)
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (FetchArrayPooling : 1)
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (PerformanceCounters : HardConnectsPerSecond, HardDisconnectsPerSecond, SoftConnectsPerSecond, SoftDisconnectsPerSecond, NumberOfActiveConnectionPools, NumberOfInactiveConnectionPools, NumberOfActiveConnections, NumberOfFreeConnections, NumberOfPooledConnections, NumberOfNonPooledConnections, NumberOfReclaimedConnections, NumberOfStasisConnections)
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (PSPE : 1)
TIME:2018/03/05-13:02:04:981 TID:33bc  (REGISTRY) (PSPESupport : False)
TIME:2018/03/05-13:02:04:983 TID:33bc  (%s) (ThreadPoolMaxSize : %s [Original: %s; Set: %s; Post-Set: %s])
TIME:2018/03/05-13:02:04:992 TID:33bc  (ENTRY) OracleConnection::OracleConnection(2)
TIME:2018/03/05-13:02:05:008 TID:33bc  (EXIT)  OracleConnection::OracleConnection(2)
TIME:2018/03/05-13:02:05:013 TID:33bc  (ENTRY) OracleConnection::Open()
TIME:2018/03/05-13:02:05:014 TID:33bc  (ENTRY) OpsConAllocValCtx()
TIME:2018/03/05-13:02:05:014 TID:33bc  (EXIT)  OpsConAllocValCtx(): RetCode=0 Line=426
TIME:2018/03/05-13:02:05:034 TID:33bc  (ENTRY) OpsConOpen()
TIME:2018/03/05-13:02:05:034 TID:33bc  (HA)    OpsConOpen(): OciEvents=0 Line=1928
TIME:2018/03/05-13:02:05:128 TID:33bc  (ENTRY) OpsConAddRef(): (48a820)=4761632
TIME:2018/03/05-13:02:05:129 TID:33bc  (EXIT)  OpsConAddRef(): RefCount=1 RetCode=0 Line=3688 (48a820)=4761632
TIME:2018/03/05-13:02:05:129 TID:33bc  (ENTRY) OpsErrAllocCtx(): (48a820)=4761632
TIME:2018/03/05-13:02:05:129 TID:33bc  (EXIT)  OpsErrAllocCtx(): RetCode=0 Line=206 (48a820)=4761632
TIME:2018/03/05-13:02:05:129 TID:33bc  (EXIT)  OpsConOpen(): RetCode=0 Line=2561 (48a820)=4761632
TIME:2018/03/05-13:02:05:130 TID:33bc  (ENTRY) OpsConIsOCIAutoTuningEnabled()
TIME:2018/03/05-13:02:05:130 TID:33bc  (EXIT)  OpsConIsOCIAutoTuningEnabled()
TIME:2018/03/05-13:02:05:130 TID:33bc  (GRID) (NON-RLB) (DISP) (inst=orcl)
TIME:2018/03/05-13:02:05:133 TID:33bc  (ENTRY) OpsGetOptimumUsableMemoryInfo()
TIME:2018/03/05-13:02:05:133 TID:33bc  (EXIT)  OpsGetOptimumUsableMemoryInfo(): returnValue=0 Line=1033
TIME:2018/03/05-13:02:05:134 TID:33bc  (ENTRY) OracleTuningAgent::Register()
TIME:2018/03/05-13:02:05:134 TID:33bc  (TUNING) OracleTuningAgent::Register(): Registered pool "user id=***************************************** with pool Id 710390404
TIME:2018/03/05-13:02:05:134 TID:33bc  (TUNING) OracleTuningAgent::Register(): Tuning thread started.
TIME:2018/03/05-13:02:05:134 TID:33bc  (EXIT) OracleTuningAgent::Register()
TIME:2018/03/05-13:02:05:136 TID:33bc  (ENTRY) OpsConAllocValCtx()
TIME:2018/03/05-13:02:05:136 TID:33bc  (EXIT)  OpsConAllocValCtx(): RetCode=0 Line=426
TIME:2018/03/05-13:02:05:138 TID:33bc  (POOL)  New connection pool created for: "user id=****************************************" (id: 710390404)
TIME:2018/03/05-13:02:05:138 TID:33bc  (POOL)  Total number of connection pools: 1
TIME:2018/03/05-13:02:05:139 TID:33bc  (POOL)  Total number of connections for pool (id: 710390404) : 1
TIME:2018/03/05-13:02:05:141 TID:33bc  (EXIT)  OracleConnection::Open()
TIME:2018/03/05-13:02:05:143 TID:33bc  (ENTRY) OpsAQAllocValCtx()
TIME:2018/03/05-13:02:05:143 TID:33bc  (EXIT)  OpsAQAllocValCtx(): RetCode=0 Line=2191
TIME:2018/03/05-13:02:05:144 TID:33bc  (ENTRY) OracleAQQueue::Listen()
TIME:2018/03/05-13:02:05:145 TID:33bc  (ENTRY) OpsConAddRef(): (48a820)=4761632
TIME:2018/03/05-13:02:05:145 TID:33bc  (EXIT)  OpsConAddRef(): RefCount=2 RetCode=0 Line=3688 (48a820)=4761632
TIME:2018/03/05-13:02:05:145 TID:33bc  (ENTRY) OpsErrAllocCtx(): (48a820)=4761632
TIME:2018/03/05-13:02:05:145 TID:33bc  (EXIT)  OpsErrAllocCtx(): RetCode=0 Line=206 (48a820)=4761632
TIME:2018/03/05-13:02:05:145 TID:33bc  (ENTRY) OpsAQListen()
TIME:2018/03/05-13:02:10:326 TID:33bc  (EXIT)  OpsAQListen(): RetCode=0 Line=2591
TIME:2018/03/05-13:02:10:326 TID:33bc  (ENTRY) OpsAQFreeAQAgentCtx()
TIME:2018/03/05-13:02:10:326 TID:33bc  (EXIT)  OpsAQFreeAQAgentCtx(): RetCode=0 Line=2623
TIME:2018/03/05-13:02:12:327 TID:33bc  (ENTRY) OpsAQAllocValCtx()
TIME:2018/03/05-13:02:12:327 TID:33bc  (EXIT)  OpsAQAllocValCtx(): RetCode=0 Line=2191
TIME:2018/03/05-13:02:12:327 TID:33bc  (ENTRY) OracleAQQueue::Listen()
TIME:2018/03/05-13:02:12:327 TID:33bc  (ENTRY) OpsConAddRef(): (48a820)=4761632
TIME:2018/03/05-13:02:12:327 TID:33bc  (EXIT)  OpsConAddRef(): RefCount=3 RetCode=0 Line=3688 (48a820)=4761632
TIME:2018/03/05-13:02:12:327 TID:33bc  (ENTRY) OpsErrAllocCtx(): (48a820)=4761632
TIME:2018/03/05-13:02:12:327 TID:33bc  (EXIT)  OpsErrAllocCtx(): RetCode=0 Line=206 (48a820)=4761632
TIME:2018/03/05-13:02:12:327 TID:33bc  (ENTRY) OpsAQListen()
TIME:2018/03/05-13:02:15:140 TID:2a84  (ENTRY) OpsGetAvailPhysMemory()
TIME:2018/03/05-13:02:15:140 TID:2a84  (EXIT)  OpsGetAvailPhysMemory(): returnValue=0 Line=1068
TIME:2018/03/05-13:02:17:328 TID:33bc  (EXIT)  OpsAQListen(): RetCode=0 Line=2591
TIME:2018/03/05-13:02:17:328 TID:33bc  (ENTRY) OpsAQFreeAQAgentCtx()
TIME:2018/03/05-13:02:17:328 TID:33bc  (EXIT)  OpsAQFreeAQAgentCtx(): RetCode=0 Line=2623
TIME:2018/03/05-13:02:19:328 TID:33bc  (ENTRY) OpsAQAllocValCtx()
TIME:2018/03/05-13:02:19:328 TID:33bc  (EXIT)  OpsAQAllocValCtx(): RetCode=0 Line=2191
TIME:2018/03/05-13:02:19:328 TID:33bc  (ENTRY) OracleAQQueue::Listen()
TIME:2018/03/05-13:02:19:328 TID:33bc  (ENTRY) OpsConAddRef(): (48a820)=4761632
TIME:2018/03/05-13:02:19:328 TID:33bc  (EXIT)  OpsConAddRef(): RefCount=4 RetCode=0 Line=3688 (48a820)=4761632
TIME:2018/03/05-13:02:19:328 TID:33bc  (ENTRY) OpsErrAllocCtx(): (48a820)=4761632
TIME:2018/03/05-13:02:19:328 TID:33bc  (EXIT)  OpsErrAllocCtx(): RetCode=0 Line=206 (48a820)=4761632
TIME:2018/03/05-13:02:19:328 TID:33bc  (ENTRY) OpsAQListen()
TIME:2018/03/05-13:02:24:329 TID:33bc  (EXIT)  OpsAQListen(): RetCode=0 Line=2591
TIME:2018/03/05-13:02:24:329 TID:33bc  (ENTRY) OpsAQFreeAQAgentCtx()
TIME:2018/03/05-13:02:24:329 TID:33bc  (EXIT)  OpsAQFreeAQAgentCtx(): RetCode=0 Line=2623
TIME:2018/03/05-13:02:25:144 TID:2a84  (ENTRY) OpsGetAvailPhysMemory()
TIME:2018/03/05-13:02:25:144 TID:2a84  (EXIT)  OpsGetAvailPhysMemory(): returnValue=0 Line=1068
TIME:2018/03/05-13:02:26:329 TID:33bc  (ENTRY) OpsAQAllocValCtx()
TIME:2018/03/05-13:02:26:329 TID:33bc  (EXIT)  OpsAQAllocValCtx(): RetCode=0 Line=2191
TIME:2018/03/05-13:02:26:329 TID:33bc  (ENTRY) OracleAQQueue::Listen()
TIME:2018/03/05-13:02:26:329 TID:33bc  (ENTRY) OpsConAddRef(): (48a820)=4761632
TIME:2018/03/05-13:02:26:329 TID:33bc  (EXIT)  OpsConAddRef(): RefCount=5 RetCode=0 Line=3688 (48a820)=4761632
TIME:2018/03/05-13:02:26:329 TID:33bc  (ENTRY) OpsErrAllocCtx(): (48a820)=4761632
TIME:2018/03/05-13:02:26:329 TID:33bc  (EXIT)  OpsErrAllocCtx(): RetCode=0 Line=206 (48a820)=4761632
TIME:2018/03/05-13:02:26:329 TID:33bc  (ENTRY) OpsAQListen()
TIME:2018/03/05-13:02:26:329 TID:33bc  (EXIT)  OpsAQListen(): RetCode=0 Line=2591
TIME:2018/03/05-13:02:26:329 TID:33bc  (EXIT)  OpsAQListen(): RetCode=0 Line=2596
TIME:2018/03/05-13:02:26:329 TID:33bc  (ENTRY) OpsAQFreeAQAgentCtx()
TIME:2018/03/05-13:02:26:329 TID:33bc  (EXIT)  OpsAQFreeAQAgentCtx(): RetCode=0 Line=2623
TIME:2018/03/05-13:02:26:333 TID:33bc  (ENTRY) OpsErrGetOpoCtx()
TIME:2018/03/05-13:02:26:333 TID:33bc  (ERROR) Oracle error code=3113; Oracle msg=ORA-03113: end-of-file on communication channel
Process ID: 1612
Session ID: 19 Serial number: 21

TIME:2018/03/05-13:02:26:333 TID:33bc  (EXIT)  OpsErrGetOpoCtx(): RetCode=0 Line=146
TIME:2018/03/05-13:02:26:333 TID:33bc  (ERROR) OpsConCtx=4761632;Message=ORA-03113: end-of-file on communication channel
Process ID: 1612
Session ID: 19 Serial number: 21 
TIME:2018/03/05-13:02:26:348 TID:33bc  (ENTRY) OracleConnection.ClearPool()
TIME:2018/03/05-13:02:26:450 TID:33bc  (EXIT)  OracleConnection::ClearPool()
TIME:2018/03/05-13:02:26:451 TID:33bc  (ENTRY) OracleConnection::Close()
TIME:2018/03/05-13:02:26:459 TID:33bc  (ENTRY) OpsConCheckConStatus(): (48a820)=4761632
TIME:2018/03/05-13:02:26:459 TID:33bc  (VALID) Dead connection
TIME:2018/03/05-13:02:26:460 TID:33bc  (ENTRY) OpsConClose(): (48a820)=4761632
TIME:2018/03/05-13:02:26:460 TID:33bc  (ENTRY) OpsConRelRef(): (48a820)=4761632
TIME:2018/03/05-13:02:26:460 TID:33bc  (EXIT)  OpsConRelRef(): RefCount=4 RetCode=0 Line=3864 (0)=0
TIME:2018/03/05-13:02:26:460 TID:33bc  (EXIT)  OpsConClose(): RetCode=0 Line=1429 (48a820)=4761632
TIME:2018/03/05-13:02:26:460 TID:33bc  (ENTRY) OpsConDispose(): (0)=0
TIME:2018/03/05-13:02:26:460 TID:33bc  (ENTRY) OpsConFreeValCtx()
TIME:2018/03/05-13:02:26:460 TID:33bc  (EXIT)  OpsConFreeValCtx(): RetCode=0 Line=1454
TIME:2018/03/05-13:02:26:460 TID:33bc  (EXIT)  OpsConDispose(): RetCode=0 Line=1507
TIME:2018/03/05-13:02:26:461 TID:33bc  (POOL)  Total number of connections for pool (id: 710390404) : 0
TIME:2018/03/05-13:02:26:461 TID:33bc  (EXIT)  OracleConnection::Close()
TIME:2018/03/05-13:02:28:461 TID:33bc  (ENTRY) OracleConnection::Open()
TIME:2018/03/05-13:02:28:461 TID:33bc  (ENTRY) OpsConAllocValCtx()
TIME:2018/03/05-13:02:28:461 TID:33bc  (EXIT)  OpsConAllocValCtx(): RetCode=0 Line=426
TIME:2018/03/05-13:02:28:469 TID:1f40  (POOL) (ENTRY) ConnectionPool::PopulatePool(): Pool (id: 710390404);
TIME:2018/03/05-13:02:28:469 TID:1f40  (ENTRY) OpsConAllocValCtx()
TIME:2018/03/05-13:02:28:469 TID:1f40  (EXIT)  OpsConAllocValCtx(): RetCode=0 Line=426
TIME:2018/03/05-13:02:28:469 TID:1f40  (ENTRY) OpsConOpen()
TIME:2018/03/05-13:02:28:469 TID:1f40  (HA)    OpsConOpen(): OciEvents=0 Line=1928
TIME:2018/03/05-13:02:28:751 TID:1f40  (ENTRY) OpsConAddRef(): (48aae0)=4762336
TIME:2018/03/05-13:02:28:751 TID:1f40  (EXIT)  OpsConAddRef(): RefCount=1 RetCode=0 Line=3688 (48aae0)=4762336
TIME:2018/03/05-13:02:28:751 TID:1f40  (ENTRY) OpsConClose(): (48aae0)=4762336
TIME:2018/03/05-13:02:28:751 TID:1f40  (ENTRY) OpsConRelRef(): (48aae0)=4762336
TIME:2018/03/05-13:02:28:751 TID:1f40  (EXIT)  OpsConRelRef(): RefCount=0 RetCode=0 Line=3864 (0)=0
TIME:2018/03/05-13:02:28:751 TID:1f40  (EXIT)  OpsConClose(): RetCode=0 Line=1429 (48aae0)=4762336
TIME:2018/03/05-13:02:28:751 TID:1f40  (ENTRY) OpsConDispose(): (0)=0
TIME:2018/03/05-13:02:28:751 TID:1f40  (EXIT)  OpsConDispose(): RetCode=0 Line=1507
TIME:2018/03/05-13:02:28:752 TID:1f40  (ENTRY) OpsConAllocValCtx()
TIME:2018/03/05-13:02:28:752 TID:1f40  (EXIT)  OpsConAllocValCtx(): RetCode=0 Line=426
TIME:2018/03/05-13:02:28:752 TID:1f40  (ENTRY) OpsConOpen()
TIME:2018/03/05-13:02:28:752 TID:1f40  (HA)    OpsConOpen(): OciEvents=0 Line=1928
TIME:2018/03/05-13:02:28:757 TID:33bc  (ENTRY) OpsErrGetOraMesg()
TIME:2018/03/05-13:02:28:757 TID:33bc  (EXIT)  OpsErrGetOraMesg(): RetCode=0 Line=319
TIME:2018/03/05-13:02:28:937 TID:1f40  (ENTRY) OpsConAddRef(): (48aae0)=4762336
TIME:2018/03/05-13:02:28:937 TID:1f40  (EXIT)  OpsConAddRef(): RefCount=1 RetCode=0 Line=3688 (48aae0)=4762336
TIME:2018/03/05-13:02:28:937 TID:1f40  (ENTRY) OpsConClose(): (48aae0)=4762336
TIME:2018/03/05-13:02:28:937 TID:1f40  (ENTRY) OpsConRelRef(): (48aae0)=4762336
TIME:2018/03/05-13:02:28:937 TID:1f40  (EXIT)  OpsConRelRef(): RefCount=0 RetCode=0 Line=3864 (0)=0
TIME:2018/03/05-13:02:28:937 TID:1f40  (EXIT)  OpsConClose(): RetCode=0 Line=1429 (48aae0)=4762336
TIME:2018/03/05-13:02:28:937 TID:1f40  (ENTRY) OpsConDispose(): (0)=0
TIME:2018/03/05-13:02:28:937 TID:1f40  (EXIT)  OpsConDispose(): RetCode=0 Line=1507
TIME:2018/03/05-13:02:28:937 TID:1f40  (ENTRY) OpsConAllocValCtx()
TIME:2018/03/05-13:02:28:937 TID:1f40  (EXIT)  OpsConAllocValCtx(): RetCode=0 Line=426
TIME:2018/03/05-13:02:28:937 TID:1f40  (ENTRY) OpsConOpen()
TIME:2018/03/05-13:02:28:937 TID:1f40  (HA)    OpsConOpen(): OciEvents=0 Line=1928
TIME:2018/03/05-13:02:28:958 TID:33bc  (ENTRY) OracleConnection.ClearPool()
TIME:2018/03/05-13:02:29:061 TID:33bc  (EXIT)  OracleConnection::ClearPool()
TIME:2018/03/05-13:02:29:101 TID:1f40  (ENTRY) OpsConAddRef(): (48aae0)=4762336
TIME:2018/03/05-13:02:29:101 TID:1f40  (EXIT)  OpsConAddRef(): RefCount=1 RetCode=0 Line=3688 (48aae0)=4762336
TIME:2018/03/05-13:02:29:101 TID:1f40  (ENTRY) OpsConClose(): (48aae0)=4762336
TIME:2018/03/05-13:02:29:101 TID:1f40  (ENTRY) OpsConRelRef(): (48aae0)=4762336
TIME:2018/03/05-13:02:29:101 TID:1f40  (EXIT)  OpsConRelRef(): RefCount=0 RetCode=0 Line=3864 (0)=0
TIME:2018/03/05-13:02:29:102 TID:1f40  (EXIT)  OpsConClose(): RetCode=0 Line=1429 (48aae0)=4762336
TIME:2018/03/05-13:02:29:102 TID:1f40  (ENTRY) OpsConDispose(): (0)=0
TIME:2018/03/05-13:02:29:102 TID:1f40  (EXIT)  OpsConDispose(): RetCode=0 Line=1507
TIME:2018/03/05-13:02:29:102 TID:1f40  (ENTRY) OpsConAllocValCtx()
TIME:2018/03/05-13:02:29:102 TID:1f40  (EXIT)  OpsConAllocValCtx(): RetCode=0 Line=426
TIME:2018/03/05-13:02:29:102 TID:1f40  (ENTRY) OpsConOpen()
TIME:2018/03/05-13:02:29:102 TID:1f40  (HA)    OpsConOpen(): OciEvents=0 Line=1928
TIME:2018/03/05-13:02:29:281 TID:1f40  (ENTRY) OpsConAddRef(): (48aae0)=4762336
TIME:2018/03/05-13:02:29:281 TID:1f40  (EXIT)  OpsConAddRef(): RefCount=1 RetCode=0 Line=3688 (48aae0)=4762336
TIME:2018/03/05-13:02:29:281 TID:1f40  (ENTRY) OpsConClose(): (48aae0)=4762336
TIME:2018/03/05-13:02:29:281 TID:1f40  (ENTRY) OpsConRelRef(): (48aae0)=4762336
TIME:2018/03/05-13:02:29:281 TID:1f40  (EXIT)  OpsConRelRef(): RefCount=0 RetCode=0 Line=3864 (0)=0
TIME:2018/03/05-13:02:29:281 TID:1f40  (EXIT)  OpsConClose(): RetCode=0 Line=1429 (48aae0)=4762336
TIME:2018/03/05-13:02:29:281 TID:1f40  (ENTRY) OpsConDispose(): (0)=0
TIME:2018/03/05-13:02:29:281 TID:1f40  (EXIT)  OpsConDispose(): RetCode=0 Line=1507
TIME:2018/03/05-13:02:29:281 TID:1f40  (ENTRY) OpsConAllocValCtx()
TIME:2018/03/05-13:02:29:281 TID:1f40  (EXIT)  OpsConAllocValCtx(): RetCode=0 Line=426
TIME:2018/03/05-13:02:29:281 TID:1f40  (ENTRY) OpsConOpen()
TIME:2018/03/05-13:02:29:281 TID:1f40  (HA)    OpsConOpen(): OciEvents=0 Line=1928
TIME:2018/03/05-13:02:29:440 TID:1f40  (ENTRY) OpsConAddRef(): (48aae0)=4762336
TIME:2018/03/05-13:02:29:440 TID:1f40  (EXIT)  OpsConAddRef(): RefCount=1 RetCode=0 Line=3688 (48aae0)=4762336
TIME:2018/03/05-13:02:29:440 TID:1f40  (ENTRY) OpsConClose(): (48aae0)=4762336
TIME:2018/03/05-13:02:29:440 TID:1f40  (ENTRY) OpsConRelRef(): (48aae0)=4762336
TIME:2018/03/05-13:02:29:440 TID:1f40  (EXIT)  OpsConRelRef(): RefCount=0 RetCode=0 Line=3864 (0)=0
TIME:2018/03/05-13:02:29:440 TID:1f40  (EXIT)  OpsConClose(): RetCode=0 Line=1429 (48aae0)=4762336
TIME:2018/03/05-13:02:29:440 TID:1f40  (ENTRY) OpsConDispose(): (0)=0
TIME:2018/03/05-13:02:29:440 TID:1f40  (EXIT)  OpsConDispose(): RetCode=0 Line=1507
TIME:2018/03/05-13:02:29:440 TID:1f40  (POOL) (EXIT) ConnectionPool::PopulatePool(): Pool (id: 710390404);
TIME:2018/03/05-13:02:31:068 TID:33bc  (ENTRY) OracleConnection::Open()
TIME:2018/03/05-13:02:45:148 TID:2a84  (ENTRY) OpsGetAvailPhysMemory()
TIME:2018/03/05-13:02:45:148 TID:2a84  (EXIT)  OpsGetAvailPhysMemory(): returnValue=0 Line=1068
TIME:2018/03/05-13:02:46:194 TID:33bc  (ENTRY) OracleConnection.ClearPool()
TIME:2018/03/05-13:02:46:294 TID:33bc  (EXIT)  OracleConnection::ClearPool()
TIME:2018/03/05-13:02:48:294 TID:33bc  (ENTRY) OracleConnection::Open()
TIME:2018/03/05-13:03:03:306 TID:33bc  (ENTRY) OracleConnection.ClearPool()
TIME:2018/03/05-13:03:03:406 TID:33bc  (EXIT)  OracleConnection::ClearPool()
TIME:2018/03/05-13:03:05:151 TID:2a84  (ENTRY) OpsGetAvailPhysMemory()
TIME:2018/03/05-13:03:05:152 TID:2a84  (EXIT)  OpsGetAvailPhysMemory(): returnValue=0 Line=1068
TIME:2018/03/05-13:03:05:406 TID:33bc  (ENTRY) OracleConnection::Open()
TIME:2018/03/05-13:03:20:416 TID:33bc  (ENTRY) OracleConnection.ClearPool()
TIME:2018/03/05-13:03:20:516 TID:33bc  (EXIT)  OracleConnection::ClearPool()
TIME:2018/03/05-13:03:22:516 TID:33bc  (ENTRY) OracleConnection::Open()
TIME:2018/03/05-13:03:25:154 TID:2a84  (ENTRY) OpsGetAvailPhysMemory()
TIME:2018/03/05-13:03:25:154 TID:2a84  (EXIT)  OpsGetAvailPhysMemory(): returnValue=0 Line=1068
TIME:2018/03/05-13:03:37:525 TID:33bc  (ENTRY) OracleConnection.ClearPool()
TIME:2018/03/05-13:03:37:625 TID:33bc  (EXIT)  OracleConnection::ClearPool()
TIME:2018/03/05-13:03:39:625 TID:33bc  (ENTRY) OracleConnection::Open()

1 个答案:

答案 0 :(得分:1)

当数据库重新启动时,是使用ClearPool类型API还是Oracle快速连接故障转移(FCF)从池中删除无效连接?如果答案为否,那么当池化时,这可能是导致超时或错误的原因。

无效连接仍保留在池中,应用程序正在接收其中一个连接。

ClearPool API和/或FCF旨在解决此HA问题。遗憾的是,ClearPool是一个手动过程,对于这种特定的HA情况来说,它不是一个很好的解决方案。大多数客户更喜欢使用FCF自动化连接清理。

要使用FCF,您的数据库需要启用快速应用程序通知,然后在服务器端打开FCF。在客户端,您只需在连接字符串中打开HA Events = true,如果您使用的是ODP.NET 12.2,则默认情况下应该已打开。

从添加的跟踪中,您似乎没有启用FCF,这就是您仍然看到问题的原因。