This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
04-27-2020 01:26 AM - edited 02-03-2022 09:17 AM
This article details different methods for connecting to an Oracle database from Alteryx.
Note: All screenshots included in this article are for Designer version 2019.2 or later.
1. Quick connect
2. OCI
3. ODBC
4. OleDB
5. 32-bit connections (OCI, ODBC, OleDB)
a. Open a new workflow in Alteryx Designer.
b. Add an Input tool to the canvas, and select Data Sources from the drop-down menu in the configuration window then select Oracle Quick connect
Alteryx Designer checks for the client as follows:
• Check for full Client install:
• Check PATH variable for Oracle client path
• Check the Oracle home directory for the existence of tnsnames.ora file (Note: it does not check for the content of the file and it does not use the file, it just checks for existence.)
• If it cannot find tnsnames.ora file, it assumes client install is incomplete and prompts to install the instant client from Oracle website
• Check for Instant Client in User Settings
• If Oracle client is not found or it is incomplete, it prompts to install the instant client from Oracle website.
c. Select a directory to install the client to.
A window will appear prompting you to select a directory to install the client. The best practice is to use a new empty folder you created for Alteryx to install the driver to:
Needs: hostname, port, service name, user name, password
f. Test the connection then click OK to connect.
g. Automatically creates a saved data connection
Connection string format:
• oci:<username>/__EncPwd1__@<hostname>:<port>/<servicename>
All information necessary to connect is contained in the connection string itself.
h. Going forward, Alteryx will not ask to install the driver again. It will recognize the driver previously installed. If you need to connect to the same database in another input tool, you can find the connection in the drop-down option.
i. If you need to connect to a different database, you can repeat steps 5 - 8 for the new database.
a. Open a new workflow in Alteryx Designer.
b. Add an Input tool to the canvas. Select Saved and select the connection.
c. Alteryx will search your machine for an existing Oracle client.
- If Alteryx can find an existing client, the Saved Data Connections will appear.
- If Alteryx cannot find an existing client, and you have the appropriate permissions on your machine, internet access, don't care if you use an existing driver, and your Oracle DBA did not tell you that you must use a specific client, -> Follow the procedure for users who have never connected before to install the Oracle Instant Client through Alteryx and use it to connect.
- If Alteryx cannot find an existing client, but you have a client you want/must use to connect, most likely Alteryx can't find the existing client because it couldn't find Oracle Home in the Windows Environmental Variables and/or there were no tnsnames.ora file in the Oracle Home Directory. You can force Alteryx to use the existing client by setting the Environmental Variable and creating a tnsnames.ora file :
· Close all instances of Alteryx.
· Navigate to the folder containing the Oracle client files.
· Create a blank text file called tnsnames.ora. Be careful not to save with an extension such as .txt or .csv and save to the folder.
· Copy the path of the folder.
· Open up Windows Environmental variables and create a new one called TNS_ADMIN with the path for the Oracle client file folder as the value.
· Note: If you already have a tnsnames.ora file, or a TNS_ADMIN variable, do not overwrite any of these.
· Open Alteryx and try connecting again.
a. Open a new workflow in Alteryx Designer.
b. Add an Input tool to the canvas and select Data Sources from the drop-down menu in the configuration window then select Oracle OCI.
Enter the TNS Service Name from your tnsnames.ora file.
• Uses the Oracle Client and the tnsnames.ora file to connect
• Needs the Oracle Instant Client or full client installed
• Needs properly formatted tnsnames.ora file.
Example Basic Format of tnsnames.ora File
• Needs Oracle home directory set in the PATH variable of the system environment variables window
• If tnsnames.ora file is not located in the Oracle Home directory, add a TNS_ADMIN variable
• Tip: Ensure the tnsnames file has the .ORA extension and not a .TXT extension
Example of a successful OCI connection:
To connect via ODBC, first, install the ODBC driver on your computer. Then, use the ODBC Data Source Administrator to create a Data Source Name (DSN) for your connection.
• Open ODBC Administrator. Click the Drivers tab and verify that the driver appears in the list of ODBC drivers installed on your computer:
• A DSN must be created through the Windows ODBC Data Source Administrator:
• Use the Test button to make sure it is working
• Uses the tnsnames.ora file
· You can then select the DSN in the Alteryx tool you are using to connect to the database.
a. Open a new workflow in Alteryx Designer.
b. Add an Input tool to the canvas and select Data Sources from the drop-down menu in the configuration window then select Oracle ODBC. You have to enter the User Name and Password since Oracle doesn’t save it in the ODBC DSN.
To connect via OLEDB, first, install the OLEDB driver on your machine.
After installing the driver you can then select it from a list of drivers available in the Alteryx tool you are using to connect to the database.
a. Open a new workflow in Alteryx Designer.
b. Add an Input tool to the canvas and select Data Sources from the drop-down menu in the configuration window then select Oracle OleDB. The "Data Link Properties" window should appear.
Select the driver for Oracle and click “Next.” Once you configure it, click the “Test Connection” button to test that you are set up correctly.
Data Source should be the Service Name from your tnsnames.ora file.
• Usually, 32 bit is used because of IT/other company requirements
• 32-bit connections are available for OCI w/tnsnames.ora and (ODBC or OleDB) with applicable client installed
• In order to use these connections, you will need to have the driver already installed and a tnsnames.ora file created in the Oracle Home directory. If you are using ODBC you have to set up a connection through the Windows ODBC Data Sources Administrator before attempting to connect through Alteryx.
• Although it can be done, we do not recommend installing both 64 bit and 32-bit clients on the same machine
• User can work with his IT/DB Admin
• Connection string will indicate 32-bit connection:
32bit:oci:<username>/PASSWORD@ServiceName
• Sometimes connection will not be established, type in connection string manually in the format:
32bit:oci:<username>/PASSWORD@ServiceName|tablename
• Connection window is identified as 32-bit
· If tnsnames.ora file is not located in Oracle Home directory:
· If you don’t have TNS_ADMIN variable containing the path:
Hi @ntobon , thanks so much for putting together this comprehensive page! might you have an example of how to create an INDBC file for Oracle? similar to this (which is for MySQL) https://community.alteryx.com/t5/Alteryx-Designer-Discussions/INDBC-File-Microsoft-SQL-Server-Connec...
That way, users can customize the connect and go DSN-less, and account for other local settings and configs with ease?
Many thanks.
@MGA Please review this article:
How To: Create an In-Database Connection
Thanks for this!!! Awesome article.
How can i connect using user/system DSN for Oralce from connection string ? I'm trying to avoid storing userid/password within system DSN, so that i can share connection string with anyone without stored password. Article doesn't mention DSN setup.
Any help would be appreciated !!
Oracle 19c Drivers
Alteryx 2019.4
attempt 1 error :
attempt 2 error :
Super useful document - thank you!
Thank you for sharing!
After establishing the connection between Alteryx and SQL data base, how to update the data from one data table to another data table using "In data base " tool?
Hello,
This is awesome document.
Can you please help me to resolve the issue?
After typing username and password to connect Oracle using OCI, it is keep spinning and not getting the next step.
I have Alteryx 2020.2 and TNSNAME.ORA file is in oracle19 version.
With the same login credentials, I'm able to connect SQL developer.
Thanks in advance
Regards
Nataraj
Thank you! Is it possible to connect using Single-Sign-On?
To use a single-sign-on (SSO):
odbc: Driver={Oracle in OraClient12Home1};Dbq=your_oracle_sid;Trusted_Connection=yes
Change the ODBC driver to the one installed on your system