Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSIS - Using Dataflow task to insert records, but the log is growing and eating up all disk space


SSIS - Using Dataflow task to insert records, but the log is growing and eating up all disk space

Author
Message
tan110
tan110
SSC-Enthusiastic
SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)

Group: General Forum Members
Points: 162 Visits: 702
SSIS - Using Dataflow task to insert records 47 mill records from a SQL Server 2008 r2 db to a destination SQL Server 2008 r2 db, but the log is growing and eating up all disk space, causing the package to fail. The database is in simple mode. There are approximately 47 million records that needs to be moved. I set the "Maximum Insert Commit Size" to 5 mill. I thought that would keep that log under control, but the package keeps failing due to the log growing out of control. Please help. Any suggestions.
Evil Kraig F
Evil Kraig F
SSCertifiable
SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)

Group: General Forum Members
Points: 5715 Visits: 7660
tan110 (11/27/2012)
SSIS - Using Dataflow task to insert records 47 mill records from a SQL Server 2008 r2 db to a destination SQL Server 2008 r2 db, but the log is growing and eating up all disk space, causing the package to fail. The database is in simple mode. There are approximately 47 million records that needs to be moved. I set the "Maximum Insert Commit Size" to 5 mill. I thought that would keep that log under control, but the package keeps failing due to the log growing out of control. Please help. Any suggestions.


What you need are minimally logged inserts, and you can't use a smaller commit size for them, because then the next 'section' won't minimally log. However, 47 million records can be huge depending on row width.

More information on Minimal Logging prerequisites: http://msdn.microsoft.com/en-us/library/ms190422(v=sql.105).aspx

Now, commit size is equivalent to BATCHSIZE from BULK INSERT. Now, from the BULK INSERT page:

http://msdn.microsoft.com/en-us/library/ms188365.aspx
The BULK INSERT statement can be executed within a user-defined transaction to import data into a table or view. Optionally, to use multiple matches for bulk importing data, a transaction can specify the BATCHSIZE clause in the BULK INSERT statement. If a multiple-batch transaction is rolled back, every batch that the transaction has sent to SQL Server is rolled back.


This means that you're not saving any T-Log space because it's not multiple transactions, it's merely multiple batches in the same transaction. So, that's not going to help with the problem.

Is there some kind of Identity field on the originating data that you could create a WHERE loop for the inbound data and grab it in 5 million row chunks, allowing for checkpoints to be sent to the database after each chunk? If not, try the minimally logged route and see where it can take you.


- Craig Farrell

Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

For better assistance in answering your questions | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search