-->
In order to connect to an Oracle database with Power BI Desktop, the correct Oracle client software must be installed on the computer running Power BI Desktop. Which Oracle client software you use depends on which version of Power BI Desktop you have installed - the 32-bit version or the 64-bit version.
Supported versions: Oracle 9 and later, Oracle client software 8.1.7 and later.
Determining which version of Power BI Desktop is installed
1.Go to Control Panel->Administrative Tools->Data Sources (ODBC)->System DSN. Select Oracle BI Server and Click Add. 3.Click on Finish and enter a name for your DSN and enter the BIServer name and click finish. Now your BI Server DSN Configuration is done. Create the report using Microsoft Query.
To determine which version of Power BI Desktop is installed, select File > Help > About then check the Version: line. In the following image, a 64-bit version of Power BI Desktop is installed:
Installing the Oracle client
For 32-bit versions of Power BI Desktop, use the following link to download and install the 32-bit Oracle client:
For 64-bit versions of Power BI Desktop, use the following link to download and install the 64-bit Oracle client:
Connect to an Oracle database
Once the matching Oracle client driver is installed, you can connect to an Oracle database. To make the connection, take the following steps:
- From the Get Data window, select Database > Oracle Database
- In the Oracle Database dialog that appears, provide the name of the server, and select Connect. If a SID is required, you can specify that using the format: ServerName/SID, where SID is the unique name of the database. If the ServerName/SID format doesn't work, try using ServerName/ServiceName, where ServiceName is the alias used when connecting.TipIf you're having trouble connecting in this step, try using the following format in the Server Name field: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host_name)(PORT=port_num))(CONNECT_DATA=(SERVICE_NAME=service_name)))
- If you want to import data using a native database query, you can put your query in the SQL Statement box, available by expanding the Advanced options section of the Oracle Database dialog.
- Once your Oracle database information is entered into the Oracle Database dialog (including any optional information such as a SID or a native database query), select OK to connect.
- If the Oracle database requires database user credentials, input those credentials in the dialog when prompted.
Troubleshooting
If you downloaded Power BI Desktop from the Microsoft Store, you might be unable to connect to Oracle databases because of an Oracle driver issue. If you encounter this issue, the error message returned is 'Object reference not set'. To address the issue, do one of the following:
- Download Power BI Desktop from https://powerbi.microsoft.com/desktop instead.
- If you want to use the version from the Microsoft Store: on your local computer, copy oraons.dll from 12.X.Xclient_X into 12.X.Xclient_Xbin. The X represents version and directory numbers.
If you see the error message Object reference not set in the Power BI Gateway when connecting to an Oracle database, you might be able to solve the issue by following the instructions found in the Manage your data source - Oracle article.
In general, there are several links available to download the ODAC components from the Oracle official site. It varies across the Oracle versions, and the type of installer that we would need. Most of the time, we look for the .exe installer to install the Oracle related drivers as we are more comfortable with the Windows MSI installers.
In this blog, we will go through the ODAC driver installation and configuration with the SQL Server Reporting services (SSRS) data source to connect Oracle data source using Oracle native driver.
Assumption:
- We would be using a single system to develop the report using SQL Server Data Tools (SSDT) and host the report in Report Server. It means SSDT and SSRS both are installed in the same system.
- SSDT version – Visual Studio 2017
- SSRS – SQL Server Reporting Services 2014.
Steps:
1. SSDT runs in 32 bit whereas SSRS runs in 64 bit. Since we are in the same system, we need to install both the bit-ness of Oracle drivers one by one.
We need to go to the Oracle official site to search for the drivers for the required version. Please note that we need to check for the installer which has the OLE DB/ ODP. Net (Oracle data Provider for .Net components.)
For 64-bit driver-
(Download link available during the time the blog had been written)
For 32-bit driver- http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html
(Download link available during the time the blog had been written)
2. After uncompressing the file, you will see the installer file. Once you double click on that, you will get the information on GUI which is self-explanatory.
You need to note down where the oracle driver is getting installed, you need to place the tnsnames.ora file in that location which we will discuss later. For me, the installation folder as
E:appclientxxxxproduct12.2.0client_1 (32 bits)
E:appclientxxxxproduct12.2.0client_2 (64 bits)
Client_#, the number will change according to your installation order.
No need to update any environmental variable. During the installation, it was already done. You can check the same going to the My computer -> Properties -> Advance System setting -> Environmental Variables -> System Variables -> Path
3. Once the 32 bits and 64 bits driver installations are done, you need to place the tnsnames.ora file in the following location
E:appclientxxxxproduct12.2.0client_1NetworkAdmin
E:appclientxxxxproduct12.2.0client_2NetworkAdmin
The format of tnsnames.ora file as below- Ref: https://docs.oracle.com/cd/F49540_01/DOC/network.815/a67440/appb.htm
4. So, we have now successfully installed the Oracle drivers. The next step is to test the connection from Visual Studio and SSRS.
5. Open the SSDT. I tested in SSDT 2017. Create a Report Server Project –> File-> New -> Project -> Reporting Services -> Report Server Project
6. After creating the Reporting Services Project, you need to do the test connection. You can do the test connection by following the below screenshot. Please note that here we are using the OLE DB driver.
7. The same test connection, we will now be doing in SSRS. To do that we need to register the OraOLEDB driver. Go to the command Prompt (Run as Admin) -> and then run the following command. The path might vary as per your installation directory. We need to register the 64 bits driver since SSRS run on 64 bits ( E:appclientxxxxproduct12.2.0client_2binOraOLEDB12.dll)
8. Once this is done, after deploying the project, we can do the test connection in SSRS
9. We can use the ODP.Net to connect to the SSRS as well. This is the default driver which shows in SSDT. We need to register the ODP.Net DLLs. Go to the 64 bits installation folder. For me it is -
E:appclientxxxxproduct12.2.0client_2
Run the following commands using the command Prompt (Run as admin).
10. Once it is done, we can test the connection from SSRS, and as well as from SSDT.
This is how you would be able to test the connectivity from the SSRS to the Oracle database. If it is not working, you might need to test the Oracle connection outside of SSRS. If that does work, and only connections made from SSRS fails, then I would recommend you contact the Microsoft Support team.
Author: Samarendra Panda - Support Engineer, SQL Server BI Developer team, Microsoft
Reviewer: Krishnakumar Rukmangathan – Support Escalation Engineer, SQL Server BI Developer team, Microsoft