Connect to standby database with Oracle.ManagedDataAccess.Client — oracle-tech

    Forum Stats

  • 3,715,654 Users
  • 2,242,820 Discussions
  • 7,845,479 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Connect to standby database with Oracle.ManagedDataAccess.Client

3546385
3546385 Member Posts: 3
edited April 2019 in ODP.NET

Hi,

In powershell I try to connect to a standby database with the following code.

function Get-OracleResultRdr
{
    try {
        $con = New-Object Oracle.ManagedDataAccess.Client.OracleConnection($conString)
        $cmd=$con.CreateCommand()
        $cmd.CommandText= $sqlString
        $con.Open()

        $rdr=$cmd.ExecuteReader()


        $columnNames=$rdr.GetSchemaTable() | Select-Object -ExpandProperty ColumnName

  
        while ($rdr.Read()) {

            $result=[ordered]@{}

            for ($i=0; $i -lt $rdr.FieldCount; $i++) {

            # 0..($rdr.FieldCount-1) | %{

               $result.Add($columnNames[$i], $rdr.GetOracleValue($i))

            }

            [pscustomobject]$result

        }

    } catch {

        Write-Error ($_.Exception.ToString())

    } finally {

         if ($con.State -eq 'Open') { $con.close() }

    }

    $resultSet

}


$conString = "DBA Privilege=SYSDBA;User Id=sys;Password=xxxx;Data Source=yyyyy;"

[email protected]'
select * from v_$session

Get-OracleResultRdr $conString $sqlString|Out-GridView -wait

After the $con.Open() powershell gives the following exception :

Get-OracleResultRdr : System.Management.Automation.MethodInvocationException: Exception calling "Open" with "0" argumen

t(s): "Waarde kan niet null zijn.

Parameternaam: key" ---> System.ArgumentNullException: Waarde kan niet null zijn.

Parameternaam: key

   bij System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)

   bij System.Collections.Generic.Dictionary`2.FindEntry(TKey key)

   bij OracleInternal.Common.SyncDictionary`2.ContainsKey(K k)

   bij OracleInternal.ConnectionPool.PoolManager`3.CreateServiceCtx(PR pr)

   bij OracleInternal.ConnectionPool.PoolManager`3.PutNewPR(PR pr, Boolean bForPoolPopulation)

   bij OracleInternal.ConnectionPool.PoolManager`3.CreateNewPR(Int32 reqCount, Boolean bForPoolPopulation, ConnectionSt

ring csWithDiffOrNewPwd, OracleConnection connRefForCriteria, String instanceName, List`1 switchFailedInstNames)

   bij OracleInternal.ConnectionPool.PoolManager`3.Get(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, OracleC

onnection connRefForCriteria, String affinityInstanceName, Boolean bForceMatch)

   bij OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString csWithNewPassword, Boolean bGetForApp, Orac

leConnection connRefForCriteria, String affinityInstanceName, Boolean bForceMatch)

   bij OracleInternal.ConnectionPool.OracleConnectionDispenser`3.Get(ConnectionString cs, PM conPM, ConnectionString pm

CS, SecureString securedPassword, SecureString securedProxyPassword, OracleConnection connRefForCriteria)

   bij Oracle.ManagedDataAccess.Client.OracleConnection.Open()

   bij CallSite.Target(Closure , CallSite , Object )

   --- Einde van intern uitzonderingsstackpad ---

   bij System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception e

xception)

   bij System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)

   bij System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)

   bij System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)

I've tried the following Data Providers :

2.0.120:20180726Beta

4.122.1.1.20170524

4.121.2.20160624

The 4.121.2.20160624 gives an ORA-01219.

Regards,

Hans

michel kamp3599931

Best Answer

«13

Answers

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,751 Employee
    edited August 2018

    You may want to first try connecting using Easy Connect or using the full connect descriptor in the Data Source attribute. It's not clear if you are doing that already. It will eliminate any issues around ODP.NET "finding" the tnsnames.ora file.

  • 3546385
    3546385 Member Posts: 3
    edited August 2018

    Hi,

    I'm using tnsnames.ora and that works well. As I mentioned with version 4.121.2.20160624 I get an ORA-01219 which shows that a connection has been made. If I change the connection to the primary everything works.

    I've got several standy databases and they all give the same problem.

    Regards

    Hans

  • Mark Williams
    Mark Williams Member Posts: 67 Blue Ribbon
    edited August 2018

    Hi,

    Apologies that I have not fully tested this before posting... I don't have a standby database available just now.

    However, I suspect what is happening here is related to the standby not being "fully open". When ODP connects to a database it executes several SQL statements to get NLS values.

    Here's an example:

    SELECT VALUE from nls_session_parameters where PARAMETER='NLS_CALENDAR';

    My suspicion is that these queries are failing with the ORA-01219 error. You could test this by connecting to the standby using SQL*Plus as the same user and executing the above statement.

    Regards,

    Mark

    Alex Keh-Oracle
  • 3546385
    3546385 Member Posts: 3
    edited August 2018

    Hi Mark,

    The query on nls_sessions_parameters gives the ORA-01219 when connected as sys in the standby database with SQL*Plus.

    The same error (ORA-01219) occurs in powershell when I use an old data provider (4.121.2.20160624) but with new data providers I don't get a proper message and it looks that the connection is not even made.

    Regards,

    Hans

  • Mark Williams
    Mark Williams Member Posts: 67 Blue Ribbon
    edited August 2018

    Hi Hans,

    I don't know what remedy would be available as I am not aware of any method to disable the initial queries that ODP executes during the connection process.

    For the versions that are not raising the exception I can suggest enabling ODP tracing and that might reveal a clue.

    Here's a sample that can be adapted for the config file in your ODP client application:

    <oracle.manageddataaccess.client>    <version number="*">      <settings>        <setting name="TraceLevel" value="7" />        <setting name="TraceOption" value="0"/>        <setting name="TraceFileLocation" value="C:\Temp"/>      </settings>    </version></oracle.manageddataaccess.client>

    Here's a sample of the sort of thing you might be able to see in the trace file (created when attempting to connect to a database in mount state using ODP 4.122.1.1.20170524):

    2018-08-10 08:31:50.634192 TID:1   (PUB) (ERR) OracleConnection.Open() (txnid=n/a) Oracle.ManagedDataAccess.Client.OracleException (0x80004005): ORA-01033: ORACLE initialization or shutdown in progress   at OracleInternal.ConnectionPool.PoolManager`3.Get(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, CriteriaCtx criteriaCtx, String affinityInstanceName, Boolean bForceMatch)   at OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString csWithNewPassword, Boolean bGetForApp, CriteriaCtx criteriaCtx, String affinityInstanceName, Boolean bForceMatch)   at OracleInternal.ConnectionPool.OracleConnectionDispenser`3.Get(ConnectionString cs, PM conPM, ConnectionString pmCS, SecureString securedPassword, SecureString securedProxyPassword, CriteriaCtx criteriaCtx)   at Oracle.ManagedDataAccess.Client.OracleConnection.Open()

    You probably would want to look for the "(ERR)" token in the trace file initially.

    Hopefully a trace will reveal some interesting information.

    Regards,

    Mark

  • michel kamp
    michel kamp Member Posts: 21
    edited August 2018

    Hi ,

    I have the exact same issue while connecting to a hot standby instance (startup mount)

    I enabled the debug params in the app.config of the test project. (oracle please update the docs on the tracefilelocation usage).

    See below for the trace output:

    <oracle.manageddataaccess.client>

    <version number="*">

    <dataSources>

    <dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=oralinux07)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=DB11G07)));User Id=sys;Password=*****;DBA Privilege=SYSDBA;Pooling=False;"/>

    </dataSources>

      <settings>

        <setting name="TraceLevel" value="7" />

        <setting name="TraceOption" value="1"/>

        <setting name="PerformanceCounters" value="4095" />

        <setting name="TraceFileLocation" value="c:\temp\"/>

      </settings>

    </version>

    </oracle.manageddataaccess.client>

    2018-08-13 15:45:07.298153 TID:10  (CFG) (ENV)      Machine Name : DEVMKA03

    2018-08-13 15:45:07.312153 TID:10  (CFG) (ENV)      User Name : michel

    2018-08-13 15:45:07.312153 TID:10  (CFG) (ENV)      OS Version : Microsoft Windows NT 6.2.9200.0

    2018-08-13 15:45:07.312153 TID:10  (CFG) (ENV)      64-bit OS : True

    2018-08-13 15:45:07.312153 TID:10  (CFG) (ENV)      64-bit Process : True

    2018-08-13 15:45:07.312153 TID:10  (CFG) (ENV)      .NET Runtime Version : 4.0.30319.42000

    2018-08-13 15:45:07.312153 TID:10  (CFG) (ENV)      Application Directory : C:\Data\VSTS01\SysCtr-OraclePOOLING\Develop\Common\OraConnectionTestUI\OraConnectionTestUI\bin\Debug

    2018-08-13 15:45:07.312153 TID:10  (CFG) (VER)      Oracle Data Provider for .NET, Managed Driver Version : 4.122.1.0

    2018-08-13 15:45:07.313151 TID:10  (CFG) (VER)      Oracle Data Provider for .NET, Managed Driver Informational Version : 4.122.1.20170524

    2018-08-13 15:45:07.313151 TID:10  (CFG) (.NET)     TraceOption : 1

    2018-08-13 15:45:07.313151 TID:10  (CFG) (.NET)     TraceFileLocation : c:\temp\

    2018-08-13 15:45:07.313151 TID:10  (CFG) (.NET)     TraceLevel : 7

    2018-08-13 15:45:07.313151 TID:10  (CFG) (.NET)     PerformanceCounters : 4095

    2018-08-13 15:45:07.313151 TID:10  (CFG) (.NET)     Resolved Trace File Location: c:\temp\

    2018-08-13 15:45:07.319153 TID:10  (CFG) (SQLNET)   FilePath : (null)

    2018-08-13 15:45:07.319153 TID:10  (CFG) (TNSNAMES) FilePath : (null)

    2018-08-13 15:45:07.319153 TID:10  (PUB) (ENT) OracleConnection.ctor()

    2018-08-13 15:45:07.327189 TID:10  (PRI) (ENT) (CP) ConnectionString.GetCS()

    2018-08-13 15:45:07.331191 TID:10  (PRI) (ENT) (CP) ConnectionString.ctor()

    2018-08-13 15:45:07.350208 TID:10  (PRI) (ENT) (CP) ConnectionString.Parse()

    2018-08-13 15:45:07.362172 TID:10  (PRI) (ENT) (CP) ConnectionString.SetProperty()

    2018-08-13 15:45:07.362172 TID:10  (PRI) (EXT) (CP) ConnectionString.SetProperty()

    2018-08-13 15:45:07.362172 TID:10  (PRI) (ENT) (CP) ConnectionString.SetProperty()

    2018-08-13 15:45:07.363155 TID:10  (PRI) (EXT) (CP) ConnectionString.SetProperty()

    2018-08-13 15:45:07.363155 TID:10  (PRI) (ENT) (CP) ConnectionString.SetProperty()

    2018-08-13 15:45:07.363155 TID:10  (PRI) (EXT) (CP) ConnectionString.SetProperty()

    2018-08-13 15:45:07.363155 TID:10  (PRI) (ENT) (CP) ConnectionString.SetProperty()

    2018-08-13 15:45:07.363155 TID:10  (PRI) (EXT) (CP) ConnectionString.SetProperty()

    2018-08-13 15:45:07.363155 TID:10  (PRI) (ENT) (CP) ConnectionString.SetProperty()

    2018-08-13 15:45:07.364156 TID:10  (PRI) (EXT) (CP) ConnectionString.SetProperty()

    2018-08-13 15:45:07.364156 TID:10  (PRI) (EXT) (CP) ConnectionString.Parse()

    2018-08-13 15:45:07.365157 TID:10  (PRI) (EXT) (CP) ConnectionString.ctor()

    2018-08-13 15:45:07.365157 TID:10  (PRI) (EXT) (CP) ConnectionString.GetCS()

    2018-08-13 15:45:07.366157 TID:10  (PUB) (EXT) OracleConnection.ctor()

    2018-08-13 15:45:09.613244 TID:10  (PUB) (ENT) OracleConnection.Open() (conid=54636159) (state=Closed) (sessid=0) (implid=0) (pooling=F) (txnid=n/a)

    2018-08-13 15:45:09.619240 TID:10  (PRI) (ENT) (CP) OracleConnectionDispenser`3..cctor()

    2018-08-13 15:45:09.620279 TID:10  (PRI) (EXT) (CP) OracleConnectionDispenser`3..cctor()

    2018-08-13 15:45:09.620279 TID:10  (PRI) (ENT) (CP) OracleConnectionDispenser`3.Get()

    2018-08-13 15:45:09.627323 TID:10  (PRI) (ENT) (CP) PoolManager`3.ctor()

    2018-08-13 15:45:09.631303 TID:10  (PRI) (EXT) (CP) PoolManager`3.ctor()

    2018-08-13 15:45:09.637290 TID:10  (PRI) (ENT) (CP) PoolManager`3.Initialize() (constr=Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=oralinux07.contoso.com)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=DB11G07)));User Id=sys;DBA Privilege=SYSDBA;Pooling=False;)

    2018-08-13 15:45:09.640241 TID:10  (PRI) (ENT) (CP) ConnectionString.Secure()

    2018-08-13 15:45:09.641244 TID:10  (PRI) (EXT) (CP) ConnectionString.Secure()

    2018-08-13 15:45:09.655244 TID:10  (PRI) (EXT) (CP) PoolManager`3.Initialize() (pmid=47633461) (constr=Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=oralinux07.contoso.com)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=DB11G07)));User Id=sys;DBA Privilege=SYSDBA;Pooling=False;)

    2018-08-13 15:45:09.657243 TID:10  (PRI) (BUF) (OBP.CTOR) (poolid:63130991) (OracleConnectionDispenser`3.GetPM)

    2018-08-13 15:45:09.665244 TID:10  (PRI) (ENT) (CP) OraclePoolManager.Get()

    2018-08-13 15:45:09.760245 TID:10  (PRI) (ENT) (CP) PoolManager`3.Get() (txnid=n/a) (bForceMatch=F)

    2018-08-13 15:45:09.763243 TID:10  (PRI) (ENT) (CP) PoolManager`3.Get() MultiTenant : Searching for a idle connection, retryCountWithoutAffinity: 0

    2018-08-13 15:45:09.764247 TID:10  (PRI) (ENT) PoolManager`3.ProcessCriteriaCtx_NonEnlistedConnection()

    2018-08-13 15:45:09.764247 TID:10  (PRI) (EXT) PoolManager`3.ProcessCriteriaCtx_NonEnlistedConnection()

    2018-08-13 15:45:09.781248 TID:10  (PRI) (ENT) (CP) PoolManager`3.CreateNewPR() (txnid=n/a)

    2018-08-13 15:45:10.261268 TID:10  (PRI) (ENT) TimeStamp.GetLocalTZOffset()

    2018-08-13 15:45:10.261268 TID:10  (PRI) (EXT) TimeStamp.GetLocalTZOffset()

    2018-08-13 15:45:10.275352 TID:10  (PRI) (ENT) (CP) ConnectionString.GetStringFromSecureString()

    2018-08-13 15:45:10.276266 TID:10  (PRI) (EXT) (CP) ConnectionString.GetStringFromSecureString()

    2018-08-13 15:45:10.962294 TID:10  (PRI) (ENT) PoolResource`3.ProcessCriteriaCtx()

    2018-08-13 15:45:10.966293 TID:10  (PRI) (SVC) (EXT) PoolResource`3.ProcessCriteriaCtx()

    2018-08-13 15:45:10.969293 TID:10  (PRI) (ENT) (CP) PoolManager`3.PutNewPR() (aff=n/a) (inst=) (affmatch=n/a) (pr.service=) (pr.pdb=) (pr.edition=) (sessid=27:3018) (F;F;F;;N) (pmid=47633461)

    2018-08-13 15:45:10.978435 TID:10  (PRI) (ENT) PoolManager`3.PutNewPR()

    2018-08-13 15:45:10.981295 TID:10  (PRI) (ERR) (CP) PoolManager`3.PutNewPR() (txnid=n/a) System.ArgumentNullException: Value cannot be null.

    Parameter name: key

       at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)

       at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)

       at OracleInternal.Common.SyncDictionary`2.ContainsKey(K k)

       at OracleInternal.ConnectionPool.PoolManager`3.CreateServiceCtx(PR pr)

       at OracleInternal.ConnectionPool.PoolManager`3.PutNewPR(PR pr, Boolean bForPoolPopulation)

    2018-08-13 15:45:10.982296 TID:10  (PRI) (EXT) PoolManager`3.PutNewPR()

    2018-08-13 15:45:10.982296 TID:10  (PRI) (EXT) (CP) PoolManager`3.PutNewPR() (aff=n/a) (inst=) (affmatch=n/a) (pr.service=) (pr.pdb=) (pr.edition=) (sessid=27:3018) (F;F;F;;N) (pmid=47633461)

    2018-08-13 15:45:10.982296 TID:10  (PRI) (ENT) PoolManager`3.CreateNewPR()

    2018-08-13 15:45:10.982296 TID:10  (PRI) (ERR) (CP) PoolManager`3.CreateNewPR() (txnid=n/a) System.ArgumentNullException: Value cannot be null.

    Parameter name: key

       at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)

       at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)

       at OracleInternal.Common.SyncDictionary`2.ContainsKey(K k)

       at OracleInternal.ConnectionPool.PoolManager`3.CreateServiceCtx(PR pr)

       at OracleInternal.ConnectionPool.PoolManager`3.PutNewPR(PR pr, Boolean bForPoolPopulation)

       at OracleInternal.ConnectionPool.PoolManager`3.CreateNewPR(Int32 reqCount, Boolean bForPoolPopulation, ConnectionString csWithDiffOrNewPwd, CriteriaCtx criteriaCtx, String instanceName, List`1 switchFailedInstNames)

    2018-08-13 15:45:10.983296 TID:10  (PRI) (EXT) PoolManager`3.CreateNewPR()

    2018-08-13 15:45:10.983296 TID:10  (PRI) (EXT) (CP) PoolManager`3.CreateNewPR() (aff=n/a) (inst=) (affmatch=n/a) (pr.service=) (pr.pdb=) (pr.edition=) (sessid=27:3018) (F;F;F;;N) (pmid=47633461)

    2018-08-13 15:45:10.983296 TID:10  (PRI) (EXT) (CP) PoolManager`3.Get() (txnid=n/a) PM.Get(aff=;force=F) returning (null)

    2018-08-13 15:45:10.983296 TID:10  (PRI) (ENT) OraclePoolManager.Get()

    2018-08-13 15:45:10.984296 TID:10  (PRI) (ERR) (CP) OraclePoolManager.Get() (txnid=n/a) System.ArgumentNullException: Value cannot be null.

    Parameter name: key

       at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)

       at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)

       at OracleInternal.Common.SyncDictionary`2.ContainsKey(K k)

       at OracleInternal.ConnectionPool.PoolManager`3.CreateServiceCtx(PR pr)

       at OracleInternal.ConnectionPool.PoolManager`3.PutNewPR(PR pr, Boolean bForPoolPopulation)

       at OracleInternal.ConnectionPool.PoolManager`3.CreateNewPR(Int32 reqCount, Boolean bForPoolPopulation, ConnectionString csWithDiffOrNewPwd, CriteriaCtx criteriaCtx, String instanceName, List`1 switchFailedInstNames)

       at OracleInternal.ConnectionPool.PoolManager`3.Get(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, CriteriaCtx criteriaCtx, String affinityInstanceName, Boolean bForceMatch)

       at OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString csWithNewPassword, Boolean bGetForApp, CriteriaCtx criteriaCtx, String affinityInstanceName, Boolean bForceMatch)

    2018-08-13 15:45:10.984296 TID:10  (PRI) (EXT) OraclePoolManager.Get()

    2018-08-13 15:45:10.984296 TID:10  (PRI) (EXT) (CP) OraclePoolManager.Get() (txnid=n/a)

    2018-08-13 15:45:10.989295 TID:10  (PRI) (ENT) OracleConnectionDispenser`3.Get()

    2018-08-13 15:45:10.989295 TID:10  (PRI) (ERR) (CP) OracleConnectionDispenser`3.Get() (txnid=n/a) System.ArgumentNullException: Value cannot be null.

    Parameter name: key

       at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)

       at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)

       at OracleInternal.Common.SyncDictionary`2.ContainsKey(K k)

       at OracleInternal.ConnectionPool.PoolManager`3.CreateServiceCtx(PR pr)

       at OracleInternal.ConnectionPool.PoolManager`3.PutNewPR(PR pr, Boolean bForPoolPopulation)

       at OracleInternal.ConnectionPool.PoolManager`3.CreateNewPR(Int32 reqCount, Boolean bForPoolPopulation, ConnectionString csWithDiffOrNewPwd, CriteriaCtx criteriaCtx, String instanceName, List`1 switchFailedInstNames)

       at OracleInternal.ConnectionPool.PoolManager`3.Get(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, CriteriaCtx criteriaCtx, String affinityInstanceName, Boolean bForceMatch)

       at OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString csWithNewPassword, Boolean bGetForApp, CriteriaCtx criteriaCtx, String affinityInstanceName, Boolean bForceMatch)

       at OracleInternal.ConnectionPool.OracleConnectionDispenser`3.Get(ConnectionString cs, PM conPM, ConnectionString pmCS, SecureString securedPassword, SecureString securedProxyPassword, CriteriaCtx criteriaCtx)

    2018-08-13 15:45:10.989295 TID:10  (PRI) (EXT) OracleConnectionDispenser`3.Get()

    2018-08-13 15:45:10.990293 TID:10  (PRI) (EXT) (CP) OracleConnectionDispenser`3.Get() (txnid=n/a)

    2018-08-13 15:45:10.990293 TID:10  (PRI) (ENT) OracleConnection.Open()

    2018-08-13 15:45:10.990293 TID:10  (PUB) (ERR) OracleConnection.Open() (txnid=n/a) System.ArgumentNullException: Value cannot be null.

    Parameter name: key

       at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)

       at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)

       at OracleInternal.Common.SyncDictionary`2.ContainsKey(K k)

       at OracleInternal.ConnectionPool.PoolManager`3.CreateServiceCtx(PR pr)

       at OracleInternal.ConnectionPool.PoolManager`3.PutNewPR(PR pr, Boolean bForPoolPopulation)

       at OracleInternal.ConnectionPool.PoolManager`3.CreateNewPR(Int32 reqCount, Boolean bForPoolPopulation, ConnectionString csWithDiffOrNewPwd, CriteriaCtx criteriaCtx, String instanceName, List`1 switchFailedInstNames)

       at OracleInternal.ConnectionPool.PoolManager`3.Get(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, CriteriaCtx criteriaCtx, String affinityInstanceName, Boolean bForceMatch)

       at OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString csWithNewPassword, Boolean bGetForApp, CriteriaCtx criteriaCtx, String affinityInstanceName, Boolean bForceMatch)

       at OracleInternal.ConnectionPool.OracleConnectionDispenser`3.Get(ConnectionString cs, PM conPM, ConnectionString pmCS, SecureString securedPassword, SecureString securedProxyPassword, CriteriaCtx criteriaCtx)

       at Oracle.ManagedDataAccess.Client.OracleConnection.Open()

    2018-08-13 15:45:10.990293 TID:10  (PRI) (EXT) OracleConnection.Open()

    2018-08-13 15:45:14.924446 TID:10  (PUB) (EXT) OracleConnection.Open() (conid=54636159) (state=Closed) (sessid=0) (implid=0) (pooling=F) (txnid=n/a)

  • Mark Williams
    Mark Williams Member Posts: 67 Blue Ribbon
    edited August 2018

    Hi,

    Since you have a test application where it looks easy to reproduce the issue are you able to run from VS in debug mode and verify if there are inner exceptions? Or modify the test application to emit any inner exceptions to the console or whatever is appropriate? Something must be happening during the connection establishment process (such as ORA-01219 error during the NLS session parameter value discovery step).

    Regards,

    Mark

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,751 Employee
    edited August 2018

    35463852736622

    Does this error occur in unmanaged ODP.NET or only managed ODP.NET?

    I didn't find an existing managed ODP.NET bug with the same symptoms. So this looks like a new issue.

  • michel kamp
    michel kamp Member Posts: 21
    edited September 2018

    Hi Alex,

    Thanks for the reply.

    The unmanaged ODP.NET (V4.121.1.0) is working okay

    however the managed ODP.NET is having this issue.

    I have tested it also with the latest managed august release 4.122.18.3 

    Please have a look on how to fix this , this issue is a real SHOW STOPPER to migrate from the unmanaged ODAC to the managed ODAC.

    If you want to schedule a live call please let me know.

    My test scenario:

    - Oracle 11.2.0.1.0 (linux)

    - startup mount

    - lsnrctl start

    See stacktrace from my c# test app.

    Message:

    Value cannot be null.

    Parameter name: key

    Inner Exception:

    StatckTrace:

       at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)

       at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)

       at OracleInternal.Common.SyncDictionary`2.ContainsKey(K k)

       at OracleInternal.ConnectionPool.PoolManager`3.CreateServiceCtx(PR pr)

       at OracleInternal.ConnectionPool.PoolManager`3.PutNewPR(PR pr, Boolean bForPoolPopulation)

       at OracleInternal.ConnectionPool.PoolManager`3.CreateNewPR(Int32 reqCount, Boolean bForPoolPopulation, ConnectionString csWithDiffOrNewPwd, OracleConnection connRefForCriteria, String instanceName, List`1 switchFailedInstNames)

       at OracleInternal.ConnectionPool.PoolManager`3.Get(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, OracleConnection connRefForCriteria, String affinityInstanceName, Boolean bForceMatch)

       at OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString csWithNewPassword, Boolean bGetForApp, OracleConnection connRefForCriteria, String affinityInstanceName, Boolean bForceMatch)

       at OracleInternal.ConnectionPool.OracleConnectionDispenser`3.Get(ConnectionString cs, PM conPM, ConnectionString pmCS, SecureString securedPassword, SecureString securedProxyPassword, OracleConnection connRefForCriteria)

       at Oracle.ManagedDataAccess.Client.OracleConnection.Open()

       at OraConnectionTestUI.Form1.btnTest_Click(Object sender, EventArgs e) in C:\Data\VSTS01\SysCtr-OraclePOOLING\Develop\Common\OraConnectionTestUI\OraConnectionTestUI\Form1.cs:line 90

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,751 Employee
    edited September 2018

    I've filed bug 28632559 so that we can further investigate this issue. We may have some additional follow up questions if we have trouble reproducing the problem.

    michel kamp
  • Mohammed Al-Masri
    Mohammed Al-Masri Member Posts: 17 Red Ribbon
    edited September 2018

    Hi,

           Just following if the issue got resolved?

    Thanks,

    Mohammed Al-Masri

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,751 Employee
    edited September 2018

    The bug has not been fixed yet.

  • Mohammed Al-Masri
    Mohammed Al-Masri Member Posts: 17 Red Ribbon
    edited September 2018

    Any alternatives to connect to standby from .NET applications?

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,751 Employee
    edited September 2018

    Use unmanaged ODP.NET. That provider does not have this bug.

    3599931
  • Mohammed Al-Masri
    Mohammed Al-Masri Member Posts: 17 Red Ribbon
    edited September 2018

    When I use managed ODP I'm getting {"ORA-1034: ORACLE not available"} from standby database.

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,751 Employee
    edited September 2018

    That's a different error then what was reported by other posters to this thread. It's either a non-bug or a different issue. What happens when you use unmanaged ODP.NET?

  • michel kamp
    michel kamp Member Posts: 21
    edited September 2018

    Hi Alex,

    Any change you could PM me on this issue. I am willing to spend some time to test for you. We are currently in a dead lock on pushing our oracle monitoring solution to the market due to this issue.

    The point is that we have invested time to move from the unmanaged to the managed version and i don't want to do this refactoring twice.

    p.s During some testing we also have seen some (non breaking) more issues, but for now the above is the most important.

    Thanks,

    Michel

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,751 Employee
    edited September 2018

    Hi Michel,

    I recommend you open an Oracle Support service request to request a one-off fix if you need the fix ASAP. We have reproduced the issue and are looking at a fix. Once we have a fix, we will place the fix for the next regularly scheduled bundle patch. That could take one to several weeks depending on where in the release cycle we are for the next bundle patch. The one-off fix is your fastest route to receive the fix the quickest.

  • Mohammed Al-Masri
    Mohammed Al-Masri Member Posts: 17 Red Ribbon
    edited September 2018
    Severity 2Severity 2SR 3-18368531891 : Connect to standby using ODP.NET Value cannot be null. Parameter name: key

    Printable View

    michel kamp
  • michel kamp
    michel kamp Member Posts: 21
    edited September 2018

    Hi Mohammed,

    I see you already added a SR.

    Could you share the patch if you have it from the support team ? You can PM me if you want.

    Michel

  • Mettemusens2
    Mettemusens2 Member Posts: 158 Blue Ribbon
    edited September 2018

    Hi

    We have the same problem - I would very much lige a solution as well.

    This is also a showstopper for our monitoring solution :-)

    Are we able to piggyback on your SR ?

    Regards
    Mette Stephansen, DK

  • Mohammed Al-Masri
    Mohammed Al-Masri Member Posts: 17 Red Ribbon
    edited September 2018

    Hi All,

           There was no update on my SR,  I have followed a longer way to get over this issue, currently I'm using C# threads to connect to my primary and standby servers to be able to connect to the system as sysdba. This way is the worst as we don't have much control like using ODP directly.

    WhatsApp Image 2018-09-26 at 10.29.05.jpeg

    Thanks,

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,751 Employee
    edited September 2018

    We believe we have fix for this bug. We're testing it internally out to verify.

    Once we complete that task and we verified it works in our own internal deployment, we can provide a diagnostic drop to you to verify the fix in your instance.

    @Mettemusens2 and @michel kemp

    If you would like access to this diagnostic drop, I would encourage you to open SRs to request the same.

  • Mohammed Al-Masri
    Mohammed Al-Masri Member Posts: 17 Red Ribbon
    edited September 2018

    Hi,

          Shall I open more request other than SR 3-18368531891 : Connect to standby using ODP.NET Value cannot be null. Parameter name: key

    Thanks,

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,751 Employee
    edited September 2018

    @Mohammed Al-Masri

    You don't need to open another SR. Just request that you would like the diagnostic drop to try out to verify the fix when it's ready as part of your current SR.

This discussion has been closed.