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
Hi Team,
Thanks for available information,i facing issue while connecting adw to alteryx,
@Ram_123 Please review below article.
ORA-12154 TNS could not resolve the connect identifier specified
Be sure system variables are setup correctly:
How to Edit Environment Variables for Oracle
@Ram_123
Any ORA-xxxxx type error is coming from Oracle, not from Alteryx. Check to make sure that you can connect to your data source from that same machine outside of Designer. You might try SQLPlus or SQL Developer.
Greetings of the day,
##ORA - 28759, UNABLE TO OPEN FILE.
Subject: Assistance Required: Connecting Alteryx with ADW Cloud Wallet (Oracle OCI)
We are currently facing issues connecting Alteryx with our ADW Cloud Wallet (Oracle OCI). We have encountered errors, specifically the ORA-28759 error, during the process. We would greatly appreciate your guidance and support in resolving this matter.
To provide you with a clear understanding of the problem, we have outlined the steps we have followed and the error we encountered:
1. **Step 1:** We attempted to connect Alteryx with our ADW Cloud Wallet by setting up the environment variables as per the provided documentation.
2. **Step 2:** However, we encountered the following error during the connection process: ORA-28759 - failure to open file.
In light of the above situation, we kindly request your assistance in resolving the issue and providing guidance on the steps to successfully connect Alteryx with our ADW Cloud Wallet. Specifically, we would appreciate your guidance on resolving the ORA-28759 error.
Please provide us with the detailed steps or any troubleshooting techniques required to overcome this obstacle. If there are any specific settings or configurations that we need to adjust or any additional information we should provide, kindly let us know.
Thank you very much for your attention and support. We look forward to your prompt response.
Best regards
Ramesh Durgam
@Ram_123
I would recommend that you first work with AWS and Oracle experts because the error is coming from Oracle (ORA prefix indicates that it's an Oracle error). Licensed users can open a case with Customer Support. This is a much more involved issue that we can resolve via the Community. If you hold a license and do not have access to the case portal, you can email support@alteryx.com. Please include as much detail as you can (per this article on working with Alteryx Customer Support Engineers) including what driver you are using and a screenshot of your successful connection to the target table from the same machine that is running Designer. You will likely be asked for logs of the connection and because you are using OCI, that will probably require Fiddler.
Hey Team,
## WHAT WILL BE THE WORKFLOW FOR THIS BELOW SQL QUERY, PLEASE HELP ME IN GETTING THE WORKFLOW AS SOON AS POSSIBLE.
SELECT
AP_GL_LINK.JE_SOURCE DISTRIBUTION_SOURCE
, UPPER(AP_GL_LINK.JE_SOURCE) ||'~'|| TO_CHAR(AP_GL_LINK.DISTRIBUTION_ID) ||'~'||1 GL_LINK_KEY
-- AP_GL_LINK.DISTRIBUTION_ID||'~'||AP_GL_LINK.ACCOUNTING_CLASS_CODE||'~'||TO_CHAR(AP_GL_LINK.AE_HEADER_ID)||'~'||TO_CHAR(AP_GL_LINK.AE_LINE_NUM) END SOURCE_DISTRIBUTION_ID
, TO_CHAR(AP_GL_LINK.JE_HEADER_ID) || '~' || TO_CHAR(AP_GL_LINK.JE_LINE_NUM)||'~'||1 GL_JOURNAL_LINE_KEY
, TO_CHAR(AP_GL_LINK.LEDGER_ID) LEDGER_ID
, CASE WHEN AP_GL_LINK.LEDGER_TYPE='PRIMARY' THEN 'P' WHEN AP_GL_LINK.LEDGER_TYPE='SECONDARY' THEN 'S' WHEN AP_GL_LINK.LEDGER_TYPE='ALC' THEN 'R' END LEDGER_TYPE
, AP_GL_LINK.BATCH_NAME JE_BATCH_NAME
, AP_GL_LINK.HEADER_NAME JE_HEADER_NAME
, AP_GL_LINK.JE_LINE_NUM JE_LINE_NUM
, AP_GL_LINK.POSTED_DATE POSTED_ON_DT
, TO_CHAR(AP_GL_LINK.CODE_COMBINATION_ID) GL_ACCOUNT_ID
, TO_CHAR(AP_GL_LINK.AE_HEADER_ID) || '~' || TO_CHAR(AP_GL_LINK.AE_LINE_NUM) SLA_TRX_INTEGRATION_ID
--, AP_GL_LINK.GL_STATUS_ID GL_STATUS_ID
, AP_GL_LINK.DISTRIBUTION_CATEGORY_CODE DISTRIBUTION_CATEGORY_CODE
--, AP_GL_LINK.DR_CR_IND DB_CR_IND
FROM(
SELECT
AE.DISTRIBUTION_ID
, AE.DISTRIBUTION_SOURCE_TYPE
, GL.JE_SOURCE
, AE.ACCOUNTING_CLASS_CODE ACCOUNTING_CLASS_CODE
, GL.JE_HEADER_ID JE_HEADER_ID
, GL.JE_LINE_NUM JE_LINE_NUM
, AE.AE_HEADER_ID AE_HEADER_ID
, AE.AE_LINE_NUM AE_LINE_NUM
, GL.GL_LEDGER_ID LEDGER_ID
, GL.GL_LEDGER_CATEGORY_CODE LEDGER_TYPE
, GL.BATCH_NAME BATCH_NAME
, GL.HEADER_NAME HEADER_NAME
, GL.GL_PER_END_DT POSTED_DATE
, AE.CODE_COMBINATION_ID CODE_COMBINATION_ID
, GL.JE_SOURCE||'~'||GL.JE_CATEGORY DISTRIBUTION_CATEGORY_CODE
--, CASE WHEN NVL(AE.ENTERED_DR, 0) >= NVL(AE.ENTERED_CR, 0) THEN 'DEBIT' ELSE 'CREDIT' END DR_CR_IND
--, CASE WHEN GL.STATUS <> 'P' THEN 'FIN_GL_STATUS~ACCOUNTED~TRANSFERRED TO GL~UNPOSTED' ELSE 'FIN_GL_STATUS~ACCOUNTED~TRANSFERRED TO GL~POSTED' END GL_STATUS_ID
, AE.SOURCE_ID SOURCE_ID
, AE.SOURCE_TABLE SOURCE_TABLE
FROM
(
SELECT
DLINK.SOURCE_DISTRIBUTION_TYPE DISTRIBUTION_SOURCE_TYPE
, DLINK.SOURCE_DISTRIBUTION_ID_NUM_1 DISTRIBUTION_ID
, AEH.GL_TRANSFER_STATUS_CODE GL_TRANSFER_STATUS_CODE
, AEH.ACCOUNTING_ENTRY_STATUS_CODE ACCOUNTING_ENTRY_STATUS_CODE
, AEH.EVENT_TYPE_CODE EVENT_TYPE_CODE
, AEH.UPG_BATCH_ID UPG_BATCH_ID
, T.LEDGER_ID LEDGER_ID
, T.LEDGER_CATEGORY_CODE LEDGER_CATEGORY_CODE
, PER.END_DATE END_DATE
, AELINE.ACCOUNTING_CLASS_CODE ACCOUNTING_CLASS_CODE
, AELINE.AE_LINE_NUM AE_LINE_NUM
, AELINE.AE_HEADER_ID AE_HEADER_ID
, AELINE.CODE_COMBINATION_ID CODE_COMBINATION_ID
, AELINE.ENTERED_DR ENTERED_DR
, AELINE.ENTERED_CR ENTERED_CR
, AELINE.GL_SL_LINK_ID GL_SL_LINK_ID
, AELINE.GL_SL_LINK_TABLE GL_SL_LINK_TABLE
, AELINE.SOURCE_TABLE SOURCE_TABLE
, AELINE.SOURCE_ID SOURCE_ID
, AELINE.APPLICATION_ID APPLICATION_ID
, AELINE.LAST_UPDATE_DATE LAST_UPDATE_DATE
FROM
XLA_AE_HEADERS AEH
,XLA_AE_LINES AELINE
,GL_LEDGERS T
,GL_PERIODS PER
, XLA_DISTRIBUTION_LINKS DLINK
WHERE
AEH.AE_HEADER_ID=AELINE.AE_HEADER_ID
AND AEH.LEDGER_ID=T.LEDGER_ID
AND T.PERIOD_SET_NAME=PER.PERIOD_SET_NAME
AND AEH.PERIOD_NAME=PER.PERIOD_NAME
AND AELINE.AE_HEADER_ID = DLINK.AE_HEADER_ID
AND AELINE.AE_LINE_NUM = DLINK.AE_LINE_NUM
--AND AEH.APPLICATION_ID IN (200,201,222)
--AND AELINE.APPLICATION_ID IN (200,201,222)
AND AELINE.APPLICATION_ID = DLINK.APPLICATION_ID
--AND UPPER(DLINK.SOURCE_DISTRIBUTION_TYPE) IN (
--'AP_INV_DIST',
----'AP_PMT_DIST',
--'AP_PREPAY',
--'AR_DISTRIBUTIONS_ALL',
--'PO_DISTRIBUTIONS_ALL',
--'PO_REQ_DISTRIBUTIONS_ALL'
--)
--AND AEH.UPG_BATCH_ID IS NULL
) AE,
(
SELECT
T.LEDGER_ID GL_LEDGER_ID
, T.LEDGER_CATEGORY_CODE GL_LEDGER_CATEGORY_CODE
, PER.END_DATE GL_PER_END_DT
, GLIMPREF.JE_LINE_NUM JE_LINE_NUM
, GLIMPREF.JE_HEADER_ID JE_HEADER_ID
, GLIMPREF.GL_SL_LINK_TABLE GL_SL_LINK_TABLE
, GLIMPREF.GL_SL_LINK_ID GL_SL_LINK_ID
, JHEADER.NAME HEADER_NAME
, JHEADER.STATUS STATUS
, JBATCH.NAME BATCH_NAME
, JHEADER.JE_SOURCE JE_SOURCE
, JHEADER.JE_CATEGORY JE_CATEGORY
, JHEADER.LAST_UPDATE_DATE LAST_UPDATE_DATE
, JBATCH.JE_BATCH_ID JE_BATCH_ID
FROM
GL_JE_BATCHES JBATCH
,GL_JE_HEADERS JHEADER
,GL_IMPORT_REFERENCES GLIMPREF
,GL_LEDGERS T
,GL_PERIODS PER
WHERE
JBATCH.JE_BATCH_ID=JHEADER.JE_BATCH_ID
AND JHEADER.JE_HEADER_ID=GLIMPREF.JE_HEADER_ID
AND JHEADER.LEDGER_ID=T.LEDGER_ID
AND T.PERIOD_SET_NAME=PER.PERIOD_SET_NAME
AND JHEADER.PERIOD_NAME=PER.PERIOD_NAME
--AND GLIMPREF.GL_SL_LINK_ID IS NOT NULL
--AND JHEADER.STATUS = 'P'
) GL
WHERE NVL(AE.GL_SL_LINK_ID,'-999') =NVL(GL.GL_SL_LINK_ID,'-999') AND NVL(AE.GL_SL_LINK_TABLE,'-999')=NVL(GL.GL_SL_LINK_TABLE,'-999')
) AP_GL_LINK
Hey LisaL
Can you please give me some details
@Ram_123
I'm sorry. I had initially thought this was a different post, and then I was unable to delete the post I wrote in error. Community is an inadequate forum to help you connect to Oracle (even with the query). You will need to work with your Oracle Database Administrator (DBA) to connect from your computer to the target database. If you have done that, then you should provide that information including the configuration you used (except for your password) in the case portal when you open a case as recommended in my prior comment.
Hey Lisal
Thanks for the response
## Incremental load
Iam trying to work on incremental load in Alteryx,iam having two tables with same data and column as we load by full load,suppose one table is dil_supplier_ds from oracle database and another table DIL_SUPPLIER_D from snowflake.
NOW,IN DIL_SUPPLIER_DS WE UPDATE ONE ROW AND INSERT ONE ROW ,AND COLUMNS WE HAVE SUPPLIER KEY,COMPANY,LAST_UPDATE_DATE.
DIL_SUPPLIER_DS
SUPPLIER_KEY | LAST_UPDATE_DATE | COMPANY |
DSP01 | 03/02/2002 | ABC |
DSP02 | 04/02/2002 | ABCD |
DSP03 | 08/05/2005 | ABCDE |
DSP04 | 08/08/2005 | DELTA |
SO USING FULL_INCREMENTAL LOAD I LOAD SAME TABLE INTO SNOWFLAKE,AS DIL_SUPPLIER_D.
DIL_SUPPLIER_D IN SNOWFLAKE
SUPPLIER_KEY | LAST_UPDATE_DATE | COMPANY |
DSP01 | 03/02/2002 | ABC |
DSP02 | 04/02/2002 | ABCD |
DSP03 | 08/05/2005 | ABCDE |
DSP04 | 08/08/2005 | DELTA |
NOW ,I ADDED ONE ROW AND UPDATE DSP02 ROW.
THIS UPDATE TABLE IN DIL_SUPPLIER_DS IN ORACLE:
SUPPLIER_KEY | LAST_UPDATE_DATE | COMPANY |
DSP01 | 03/02/2002 | ABC |
DSP02 | 08/08/2003 | GIGA |
DSP03 | 08/05/2005 | ABCDE |
DSP04 | 08/08/2005 | DELTA |
DSP05 | 08/08/2023 | BELTA |
SO I WANT A WORKFLOW,WHICH CAN INSERT A NEW ROW AND UPDATE A NEW ROW IN DIL_SUPPLIER_D IN SNOWFLAKE BY USING INCREMENTAL LOAD
###PLEASE PROVIDE A WORKFLOW FOR REFERENCE.