Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SSIS - Using Dataflow task to insert records, but the log is growing and eating up all disk space Expand / Collapse
Author
Message
Posted Tuesday, November 27, 2012 1:14 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Saturday, April 05, 2014 1:40 PM
Points: 147, Visits: 629
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.
Post #1389392
Posted Wednesday, November 28, 2012 12:13 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Saturday, April 12, 2014 12:51 AM
Points: 5,986, Visits: 6,930
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
Post #1390049
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse