Forum Discussion
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
- pabeaderPost Patron
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!
- AnonymousNot applicable
worked for me, thanks!
- AnonymousNot applicable
Oh my goodness, you just saved my whole day. I was so flustered trying to figure out what broke.
- AnonymousNot applicable
- ThierryGRegular 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).
- AnonymousNot applicable
Installing the Web vs the Store version fixed the problem for me as well!
For those wondering, here is the link to directly download from the web: https://www.microsoft.com/en-us/download/details.aspx?id=58494
Do not download from the Microsoft Store.
- AnonymousNot applicable
You made my day!
- v-chuncz-msftCommunity Support
- tjukkenAdvocate 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
- tjukkenAdvocate II
I haven't anything more from you regarding this case and I'm still stuck / can't connect to the database with PBI desktop. I have spoken to the client and they have no intension adding authentication via an Windows user/AD-solution (like this: https://docs.oracle.com/database/121/NTQRF/active_dir.htm#NTQRF270).
Is there any other way to solve this? More debugging?
Best regards
Andreas H
- thymallusFrequent 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.
- AnonymousNot 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?
- AnonymousNot 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.