SQL Server SSIS : ADO.net date issue - sql-server

I have created an SSIS package that pulls the data from Oracle 10g server and pushes them in SQL Server 2008. I have date datatype field in Oracle named admission_date.
Below is my query in Oracle.
select pt_id,admission_date
from stays
It works fine.
When I tried to pull the data in SQL Server through ADO.net via an SSIS package. I get the below error messages.
Error: 0xC02090F5 at STAYS, ADO NET Source [1050]: The component "ADO
NET Source" (1050) was unable to process the data. ORA-01843: not a
valid month
Error: 0xC0047038 at STAYS, SSIS.Pipeline: SSIS Error Code
DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "ADO NET
Source" (1050) returned error code 0xC02090F5. The component returned
a failure code when the pipeline engine called PrimeOutput(). The
meaning of the failure code is defined by the component, but the error
is fatal and the pipeline stopped executing. There may be error
messages posted before this with more information about the failure.
Any input on this would helpful.

Use something like this TO_CHAR(addmission_date,'yyyy-mm-dd HH24:MI:SS') to format your oracle date into a format that SQL likes.
Also be aware that Oracle has a much larger valid date range than SQL so depending upon your Oracle data you may have valid oracle dates that don't come across as valid SQL dates.
See Dealing With Timestamp/Datetime when copying from Oracle to Sql Server using SSIS
And Oracle to SQL2005 DATETIME field overflows in SSIS

Well, the issue was the Oracle table was a view and not a table , the admission_date was extracted from the decode command for SQL. I pulled as it is and it is resolved my issue.

Related

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?

SQL Server Transactional replication - The process could not bulk copy into

So I have setup T-replication from Publisher (SQL Server 2014) Distributor (SQL Server 2014) Subscriber (SQL Server 2008 R2) and initialized it using a snapshot.
Checking in the replication monitor I find that the Snapshot agent has completed successfully and Log Reader agent is running.
Now in 'Distributor to Subscriber History' tab just beside the 'Undistributed Commands' Tab
I get the following error:
The process could not bulk copy into table '"dbo"."BEAMDATA"'. (Source: MSSQL_REPL, Error number: MSSQL_REPL20037)
Get help: http://help/MSSQL_REPL20037
End of file reached, terminator missing or field data incomplete
To obtain an error file with details on the errors encountered when initializing the subscribing table, execute the bcp command that appears below. Consult the BOL for more information on the bcp utility and its supported options. (Source: MSSQLServer, Error number: 20253)
Get help: http://help/20253
bcp "LOWIS_BUCT"."dbo"."BEAMDATA" in "C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\ReplData\unc\LOWISBUCT_CSSQLDB_BUCT_CSSQLDB_BUCT_ALL_TABLES\20160826064516\BEAMDATA_34#1.bcp" -e "errorfile" -t"\n\n" -r"\n<,#g>\n" -m10000 -SLOWISTSTSQL -T -w (Source: MSSQLServer, Error number: 20253)
Get help: http://help/20253
I thought this could be some kind of data overflow and hence checked the schema of the table at both Publisher and Distributor and they match exactly.
I cleaned the whole replication setup completely and re did it but still stuck at the very same place for the same table.
Has anyone encountered this before? Ask me if you need more information from my end which I can furnish.
I found the reason for this. It was due to the schema mismatch at the publisher and subscriber.
In the said table, column had the datatype (date(datetime) and when replication scripted the schema for this table it was scripted as date hence at subscriber when the snapshot was applied, the field had the data type of date.
When data was being copied from datetime to date field it resulted in the said error.
I did the necessary changes in the data type at the subscriber end and things got fixed,
I had a similar error and Problem "sql replication repl20037 field size too large". What i found is this. I setup the subscription with my local Sql Management Studio v18.10 on a SQL Server 12.0. This caused the the Bulk copy problem and a field mismatch. Solution: setting up the Publication directly on the Mgmt Studio on the source server and setting up the subscription directly on the Mgmt Studio on the destination server.

ORACLE to SQL Server SSIS JOB Failing unicode issue Successful when not ran as job

I am trying to import Oracle data to SQL Server and keep getting an error telling me that it cannot convert between unicode and non-unicode string data types but the SSIS package works when I run it initially.
I am dropping the table (which is completing successfully) at the beginning of the job, but when the proxy trys to start inserting the data into the new table it creates it fails...
I am using a proxy and /DECRYPT with the password and that part seems to be working fine it is just not wanting to accept the field formats...

SQL Server Agent Job intermittently running for packages on SSISDB

I created an SSIS package to pull data from OLAP Cube and push it into SQL Server using SSIS 2012. I deployed the same on the SQL Server SSIS DB and created a SQL Server Agent Job to run the package. I have an account configured to run the job (not by creating proxy in the job, but SQL Server Agent is running under that account), that has access to the OLAP Cube. The job is running sometimes and failing sometimes.
Why the job behaving weirdly? Any help on the issue will help me a lot.
I am using SQL Server 2012 SP1 enterprise edition (11.0.3000.0) (if it helps). The error message which pops up when it fails is :
OLE DB Source failed the pre-execute phase and returned error code 0xC0202009
SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E05.
An OLE DB record is available. Source: ""Microsoft OLE DB Provider for SQL Server 2012 Analysis Services."" Hresult: 0x00000001 Description: ""Error Code = 0x80040E05, External Code = 0x00000000:."".
"
I have had the same error on SQL2008 and now on SQL2012 SSIS, but have been able to eliminate / workaround.
We have a Loop Container in our Control flow that contains a data-flow task with an MDX source. The MDX query for the data-flow source is dynamically built (via an expression) on each iteration of the Loop container (however it always returns the "same shaped" results - only the filters in the WHERE clause are different).
We've found the error to be somewhat intermittent - sometimes the package will complete successfully, other times it will fail with the 0x80040E05 error at varying iterations thru the container loop.
To alleviate the problem we setup the SQL Agent job-step for this package to re-try on failure for up to 5 retries - not an ideal workaround, but it helped to improve the success rate of the Job.
We have no idea why this error is occurring or what is causing it, however it appears to be timing-related in some way and I have only seen the issue when using a SSAS OLE-DB data source with a dynamically generated MDX query. I have managed to virtually eliminate the error from occurring with a not ideal workaround in the SSIS package - no idea why this works/helps (hopefully Microsoft will be able to work it out and resolve the issue as it's been plaguing us since SQL2008 and is still here in SQL2012 SP1...
Workaround for MDX causing 0x80040E05 error:
Within our loop container we have added a Script task with OnSuccess precedent constraint to the data-flow task that contains the dynamically generated MDX source query. The script task simply introduces a WAIT in the processing immediately after the data-flow task completes of about 5 seconds, before allowing SSIS to continue with the next iteration (e.g. System.Threading.Thread.Sleep(5000)).
With this delay in place we have had much more stable SSIS package executions - dont know why, but that's what we have observed. Also note that when we migrated to SQL2012 SSIS packages the 0x80040E05 error returned, however we were able to eliminate it once more by increasing the WAIT time to 10 seconds on this script task.
Now waiting for 10 seconds is not an ideal solution / workaround to this problem - particularly when it is contained within a Loop Container (in our case it has added nearly 30 minutes of "WAIT time" to the package execution duration), however this workaround is better than having the package fail 80%+ of the time

SSIS: transaction during simultaneous moving of data

I implemented SSIS package which moves data from Sql Server database to another one. This package has set of Data Flow Tasks which copy data simultaneously in different tables. Each Data Flow Task contain OLE DB datasource and Sql Server destination.
Package worked fine until I decided to implement transaction. I found that it is not possible to just set TransactionOption to Supported on package level, because SSIS cannot handle transactions in multiple simultaneous processes. So, I decided to use this way:
http://consultingblogs.emc.com/jamiethomson/archive/2005/08/20/SSIS-Nugget_3A00_-RetainSameConnection-property-of-the-OLE-DB-Connection-Manager.aspx
But now I have another problem. I have "Unable to bulk copy data. You may need to run this package as an administrator" errors. These errors occur in random places. For example if I ran package in the first time Data Flow Task named "Task A" can be executed correctly, but when I run package in the second time it can throw the error.
How do I can implement transaction in my case? (Changing of package in order to perform execution of Data Flow tasks sequentially is not an option)
I got a recent error with our MS SQL Server 2008R2 and SSIS. Found the error:
[SQL Server Destination [16]] Error: Unable to bulk copy data. You may need to run this package as an administrator.
[SSIS.Pipeline] Error: component "SQL Server Destination" (16) failed the pre-execute phase and returned error code 0xC0202071.
but could not solve it with running as Admin. The error only came with one step and I finally found out that I get rid of the error when I increased the timeout of the SQL Server Destination. Funny is that with the read of external ADO NET Source I get a proper error that helped me to see the timeout is the problem.

Resources