Forum Discussion

tjukken's avatar
tjukken
Advocate II
8 years ago

Oracle connection error: Object reference not set to an instance

Hi

 

I'm trying to connect to an Oracle 11g database (not local), but I do only receive an error message. First I write in the servername/ip-address/tnsnames on the Oracle server and then I'm displayed with a new box and I write in the database username and password. The I got the error saying: "Object reference not set to an instance...." (see more details from the mash-up / log file below). Quit poorly description so there is not that much clue on how to solve the issue.

 

I have followed the documentation at: https://docs.microsoft.com/en-us/power-bi/desktop-connect-oracle-database . I installed the Oracle driver: 64-bit ODAC 12c Release 4 (12.1.0.2.4) for Windows x64 (ODAC122010_x64.zip) and restarted my computer after this process.

I have tried to connect to the database with the IP-address/SID and the tnsnames.ora approach, but nothing works (same error). I have also tried on two different client computers (same error).

I have tried to connect with Oracle SQL developer to the database and that works. 

Is there something I have missed? 

 

Got the lastest PBI Desktop (december version).

 

DataMashup.Trace Error: 24579 : {"Start":"2017-12-22T09:38:58.1118788Z","Action":"Engine/IO/Db/Oracle/Connection/Open","HostProcessId":"5188","ConnectionId":"ec5a6fb1-f5c8-496a-b39b-ed59e19b1e5d","Exception":"Exception:\r\nExceptionType: System.NullReferenceException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b78a5c561934e019\r\nMessage: Object reference not set to an instance of an object.\r\nStackTrace:\n   at Oracle.DataAccess.Client.OracleException.get_Number()\r\n   at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck, Int32 isRecoverable, OracleLogicalTransaction m_OracleLogicalTransaction)\r\n   at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src, OracleLogicalTransaction m_oracleLogicalTransaction)\r\n   at Oracle.DataAccess.Client.OracleConnectionOCP.Open(OracleConnection con)\r\n   at Oracle.DataAccess.Client.OracleConnection.Open()\r\n   at Microsoft.Mashup.Engine1.Library.Common.TracingDbConnection.<Open>b__0(IHostTrace trace)\r\n   at Microsoft.Mashup.Engine1.Library.Common.Tracer.<>c__DisplayClass4.<TracePerformance>b__3(IHostTrace trace)\r\n   at Microsoft.Mashup.Engine1.Library.Common.Tracer.TracePerformance[T](String method, Func`2 func)\r\n\r\n\r\n","ProductVersion":"2.53.4954.621 (PBIDesktop)","ActivityId":"2120ce79-b905-4d70-aae8-24d67207c9ed","Process":"Microsoft.Mashup.Container.NetFX40","Pid":11320,"Tid":1,"Duration":"00:00:00.0813127"}

 

Best regards

Andy

27 Replies

  • If you are using the Marketplace version of Power Bi Desktop and getting this error, try this:

    In your oracle client home directory you should be able to find oraons.dll.  Copy this file into the \bin folder of the same directory.

    Close any open Power BI Desktop and reopen it.

    You should be able to connect now.

    This worked for me.  I found it buried in the install instructions for Oracle on Power BI on Microsofts site.

    For me the directory where I found the file was:

    c:\app\client\OraHome

    and I copied it to 

    c:\app\client\OraHome\bin

     

    Hope this helps somebody!

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      worked for me, thanks!

    • Anonymous's avatar
      Anonymous
      Not applicable

      Oh my goodness, you just saved my whole day. I was so flustered trying to figure out what broke.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi pabeader,

       

      Thank you for your advice.  I've been battling with this for long!

  • ThierryG's avatar
    ThierryG
    Regular Visitor

    Same problem and same solution worked for me too i.e after installing the dowloadable version (and even keeping the store version in parallel).

    • Anonymous's avatar
      Anonymous
      Not applicable

      You made my day!

    • tjukken's avatar
      tjukken
      Advocate II

      Thanks for your answer, but I need to be sure that I understand your suggestion correctly.

      Would you like me to use Windows credientals instead of SQL / Basic identification? 

       

      Best regards

      Andreas H

  • thymallus's avatar
    thymallus
    Frequent Visitor

     Hi Andy,

     

    Did you manage to solve this issue?

     

    Likewise, I'm also trying to connect to an Oracle 11g database with drivers from the 64-bit ODAC 12c Release 4 (12.1.0.2.4) for Windows x64 (ODAC122010_x64.zip) and I'm getting the same "An error happened while reading data from the provider: 'Object reference not set to an instance of an object.'" error. This happens in Power BI Desktop (Februrary 2018 64-bit) as well as when trying to setup a new data source for on-premises data gateway. I do have tnsnames.ora defined and the connection defined there works fine with SQLPlus. As for Power BI, both tnsnames.ora and IP/SID produce the same error.

     

    Using the 32-bit version of Power BI desktop and 32-bit drivers from ODAC 12.2c Release 1 and Oracle Developer Tools for Visual Studio all is working well. The problem is, I really do need the 64-bit drivers for the on-premises data gateway.

     

     

    • tjukken's avatar
      tjukken
      Advocate II

      No, I didn't proceed with the issue in this case. We created a (poor) workaround with CSV-files.

       

      Good luck. :)

      • thymallus's avatar
        thymallus
        Frequent Visitor

        Ok, thanks. I created a support ticket now, I'll keep you posted.

  • Anonymous's avatar
    Anonymous
    Not applicable

    I am experiencing the same issue. I installed Oracle client and still does not look like it is resolved. what am I doing wrong?where should I place the client_1 file?

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    I got the same error. When I am trying to connect the Oracle database for my new dashboards I am able to connect it. But when I am trying to connect the oracle database to my old existing dashboard, I was getting "Object reference not set to an instance" error. This was due to different version of Power BI that I used while creating my old dashboard.

     

    "This issue resolved when I downloaded the latest version of Power BI and opened my old dashboard with the latest  Power BI version"

     

    Please try to download the latest Power BI version and check if this helps to resolve your issue.