SSIS Connection to ORACLE (Multiple-step OLE DB operation generated errors) - sql-server

I have an "Native OLE DB\Oracle Provider for OLEDB" connection in SSIS package to execute a procedure on ORACLE.
Procedure is working fine but in log file I am seeing below mentioned warning, which is slowing down the execution.
Warning : Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
The procedure is having 5 inputs and 2 out paras. After reading few articles which point says it could be due to data type/size mismatch.
I personally think its something to do with connection setting. I created a simple task of deleting data from a table without any para or variable. Still there was a warning
Its simple delete statement.
BEGIN DELETE FROM KC.KC_PAYMENT; END;
The warning appears after "validation is completed". and before the delete statement "Progress" event.
Deepak

There are many ways to work around this problem. What I am thinking as of now is
1) Store the Connection string that points to oracle into sql server table or in variable.
https://www.connectionstrings.com/oracle-provider-for-ole-db-oraoledb/
2) Check for security while fetching the records.
3) Use the "Oracle provider for OLE DB" from SSIS, don't use the "Microsoft Provider for Oracle" because a 64 bit version of it does not exist.
4) Schedule your packages with the SQLAgent.

Related

execute Oracle stored procedure from SQL Server 2012

I have changed variable names to protect customer.
I am trying to execute a stored procedure from a remote Oracle 12c database, from my SQL Server 2012 database. If it helps, the Oracle database pl/SQL procedure is has input data types of: INPUT1=CHAR(200), INPUT2=(NUMBER), OUTPUT=SYS_REFCURSOR
I am constantly getting the following error:
"OLE DB provider "OraOLEDB.Oracle" for linked server "testsrv1" returned message "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.""
My query is found below:
DECLARE #outputParameter int
DECLARE #inputParameter varchar(400)
DECLARE #inputParameter1 varchar(400)
set #inputParameter1 = 'SampleStringValue'
set #inputparameter = SampleNumberValue
EXEC ('BEGIN storedProcedure(?,?); END;', #inputParameter, #inputParameter1, #outputParameter OUTPUT) at testsrv1
After many hours of research, I found that you cannot return a SYS_REF_CURSOR data type over a database link. Even from an Oracle database to another Oracle database.
https://asktom.oracle.com/pls/apex/asktom.search?tag=returning-result-set-from-stored-procedure-over-a-database-link
If Oracle database A is the DB producing the SYS_REF_CURSOR, and database B is the consumer - the only way that I have found online is to retrieve the data inside database A and store into a table, then pass the table via database link.
Is this really the only way to do this? I am somewhat new to oracle, but this seems like something that should be able to be done by now. The link from above is from 10+ years ago.
You can use SSIS and the SSIS Data Streaming Destination to connect to Oracle in SSIS and consume the output of the SSIS package in a SQL Query.
From SSIS you can use OleDB, ODBC, ADO.NET connectors for Oracle, or you can use a .NET script to connect to Oracle.

The AcquireConnection method call to the connection manager failed with error code 0xC001A004

I use SQL Server 2014 and SSIS with Visual studio 2013.
I need to make some changes in one OLTP database (Here it is my destination database) in several tables with one of my SSIS package, and some times that takes a lot of time to execute and during this time it locks some tables in OLTP database and I can't anymore work with may application which works with OLTP database.
Before my package have been run one time in day and it was at midnight but now we decided to run this package every 30 min.
I need to use snapshot isolation level in OLTP databse to be sure that SSIS package does not lock the table for long time.
At first I want use IsolationLevel equal to Snapshot but it does not work.
Then I found that I should handel the Isolation leve manually inside the ControlFlow for using the Isolation Snapshot.
I have created a sample because my real SSIS package is really huge.
I have created a database and then, I have set Allow snapshot isolation with true.
After that I have created a SSIS package in which I have these variables:
Then I have created a Control flow like that :
In the first SQL Execution Task I have run this command:
SET TRANSACTION ISOLATION LEVEL SNAPSHOT
Then in second SQL Execution Task I have started a Transaction :
BEGIN TRANSACTION
Then I have added a Dataflow task. Inside of my DataFlow task there are two OLE DB. One as source and second one is destination.
The source and target are both in the same server and in the different database.
Then I change the property of my Connection Manager like below :
And then I have installed and configured my MSDTC in my computer. (Source and Destination are both on the same server and ssis package is running in the same server).
Then I configur my service like that :
Then in my firewall I have given the access to MSDTC like that :
Then I have configured my firewall's advance configuration like that :
All of the Task in my SSIS package have these configurations for IsolationLevel and TransactionOption :
My control flow has these configurations :
When I run the package I get this error in my OLE DB destination.
[OLE DB Destination [2]] Error: SSIS Error Code
DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.
The AcquireConnection method call to the connection manager
".<ServerName>.<DatabaseName>" failed with error code 0xC001A004.
There may be error messages posted before
this with more information on why the AcquireConnection method call failed.
[SSIS.Pipeline] Error:
OLE DB Destination failed validation and returned error code 0xC020801C.
What should I do to be able to handel manually the transaction and isolation level as Snapshot in my SSIS package?

SSIS load from Oracle DB via MS Oracle source Attunity: Failed to load OCI method. OCIAttrSet

I am trying to resolve an issue with unstable ETL process: Transformation of several tables from Oracle DB to MSSQL DB using Attunity source component.
The problem is that sometimes the SSIS package fails due to: Failed to load OCI method. OCIAttrSet. Rerun helps, but sometimes it is successful just after 10 reruns, sometimes it is successful after the first attempt. It seems to be very unpredictable and unstable which I do not like.
I was trying to set parameter DelayValidation = TRUE on the whole package and particular Data tasks, but it did not help.
One of my surmise is that the issue is caused by overloading the source DB and Oracle server is not able to send particular OCI methods.
Do you have any idea what it could be the problem and how to fix it? Thanks in advance!
EDIT:
I tried to use different OLE DB connection manager, especially Microsoft OLE DB Provider for Oracle.
I am currently having a new issue with collation. You can see below a preview of the data from Attunity connetion manager:
And here is the samee dataset, but via Microsoft OLE DB Provider for Oracle.
In both cases I am using code page 1250, any case of Microsoft OLE DB Provider for Oracle I have to set: "AlwaysUseDefaultCodePage" = True, nevertheless it does not solve the problem with special characters.

SISS is being a big brother and not letting me cast a varchar(23) to a numeric(23,0) in a stored procedure

I have an SSIS package that is using an "OLE DB Command" object to call a stored procedure.
All my datatypes are strings.
Everything works perfectly when I use a placeholder stored procedure that simply takes the inputs from SSIS and inserts the parimiters into a work table.
However, when I added all my logic SSIS started to complain.
I realized that SSIS does not like the fact that I have converted a varchar(23) variable to a numeric(23,0) variable. Why SSIS cares I don't know.
I can call my stored procecedure directly and everything works fine.
However, SSIS is has a problem with this for some reason.
The stored procedure input is this:
#MobilePhoneNumber varchar(23) = null
The cast looks like this:
select #MobilePhoneNumberNumeric = cast(#MobilePhoneNumber as numeric(23,0))
Once I add this cast statement SSIS starts giving me this error message:
"Error converting data type varchar to numeric"
Keep in mind that this stored procedure works if I call it directly.
What can I do to make SSIS happy?
Thanks
Ok I figured it out... Ok Ok my co-worker Gary had the answer.
The issue is realted to the OLE DB Connection and the provider.
When you establish a new OLE DB Connection you have the opportunity to select the provider.
In the OLE DB Connection the provider selected was:
Native OLE DB\SQL Server Native CLient 10.0
The provider I needed to use is:
Native OLE DB\Microsoft OLE DB Provider for SQL Server
Once I made this switch all is good with the world.
Thanks Gary for helping me.
Now let me go see what is on Hacker News :-)

SSIS Runs Okay Individual Tasks, Not Together

I have a simple SSIS Project. In the control flow I have three steps:
Step 1: Select Data from Db1.Table1
Step 2: Create Table2 in Db2
Step 3: Copy Data in Db1.Table1 to Db2.Table2
If I "Execute Task" one by one in order, it executes fine...but if I try running the entire project I receive the following error:
Error at Copy Data from Table1 to DB2 dbo Table2 Task [OLE DB Destination[40]]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E37.
An OLE DB record is available. Source: "Microsoft OLE DB Provider for SQL Server" Hresult: 0x80040E37 Description: "Invalid object name 'DB2.dbo.Table2".".
The issue was with the validation. On child tasks by default DelayValidation is disabled. Since the second step creates a table which is in the third step populated with the data pulled in the first step, there is a validation error. SSIS looks for the table and it doesn't exist. By enabling DelayValidation it operates fine - since it doesn't force the tables to be in existence before executing.
Your control flow makes no sense to me. There is no reason at all to havea step that only selects records. When this runs as a job who would see it and if you aren;t doing anything with them then why select.
If you are doing no cleanup or transformations why are you even using SSIS? Wouldn;t a t-sql stament of
SElect into table2 from table1 be sufficient? Of course this is problem if running more than once, so I would probably write a script to create the table if is doesn't exist, truncate it is does (I'm assuming you are replacing the data here) and then insert into it.

Resources