Groups | Blog | Home
all groups > sql server dts > march 2007 >

sql server dts : Using transactions in DTS


Kayda
3/26/2007 1:12:31 PM
I have a pump that does one data pump and then runs a series of sprocs
(In Execute SQL tasks) on the data to transform. The transaction file
is growing quite large (I don't have access unfortunately to the
customer's production server). If the DTC service is not started, that
means I cannot use transactions within the package, but I can still
put transactions in my procedure. Is the best approach to put as many
commits as possible in a long running sproc to keep the logfile small?
Also, is there no way to commit the "INSERT" that the datapump does
(target is SQL Server2000) before I start running my sprocs?

Thanks,
Kayda
EMartinez
3/26/2007 7:35:16 PM
It would seem like committing the results frequently would cause the
transaction log to grow faster. I would suggest either setting the
database recovery model to simple (if thats an option and you can get
access to it) or periodically calling DBCC SHRINKDATABASE (DBName, 20)
before or after transactions. DBCCs tend to be a little performance
intensive in general, but the benefits might out-weigh the risks in
your case. Hope this is helpful.

Regards,

Enrique Martinez
Sr. Software Consultant


[quoted text, click to view]
EMartinez
3/27/2007 5:01:46 AM
[quoted text, click to view]

Allan,
You are entitled to your opinion; however, in terms of the DBCC
SHRINKDATABASE (http://msdn2.microsoft.com/en-us/library/
ms178037.aspx), you are completely incorrect. I have worked in
environments where I maintained several databases that had millions of
records and backups that were 400-500 GBs w/space used on 25 TB of SAN
and DBCC SHRINKDATABASE has never harmed data on disk, database
availability/performance or anything else. Sorry that you have been
misinformed.

Regards,

Enrique Martinez
Sr. Software Consultant
Allan Mitchell
3/27/2007 5:16:59 AM
Hello EMartinez,


Why would committing results frequently cause the log file to grow? The
reason the log file grows here is because nothing is committed yet and the
results are stored in the log. Setting the log to simple will not stop it
growing during a data pump but it will cause it to be flushed more frequently
(But not during a transaction)

Calling DBCC SHRINKDATABASE() wrecks your data on disk. data will get placed
wherever it can and not optimally. You would need to REINDEX right after
this.

During the datapump we can retrieve and commit in batches allowing the log
to breathe.

--

Allan Mitchell
http://wiki.sqlis.com | http://www.sqlis.com | http://www.sqldts.com |
http://www.konesans.com

[quoted text, click to view]

Russell Fields
3/27/2007 2:44:14 PM
Enrique,

Yes, plenty of opinions to go around. And I a happy that your performance
has continued to meet your expectations. However, FWIW, Paul Randall of SQL
Server Product Team agrees with Allan.
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=58889

And, of course, Tibor's article:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp

FWIW, they don't actually say "never shrink" but "understand the results of
a shrink, and avoid it as much as possible." (Shrinking out of control LOG
files is a different issue from shrinking the DATA files.)

RLF

[quoted text, click to view]

AddThis Social Bookmark Button