Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

sql dts hanging during import

Posted on 2006-11-25
5
Medium Priority
?
376 Views
Last Modified: 2011-10-03
Hello all, I am in the middle of copying data from one table to a new table and the DTS job seems to be hanging up after copying 34427000 rows, sql server logs are showing occurenced of IO requests taking longer than 15 seconds to complete but thats all the logging I am seeing at this point, is there a way for me to check if the job is doing anything at this point? looking at my process id the last sql running is the insert. and if I have to stop the job it will take me hours to make it up.

Basically what I am trying to accomplish is a database trim on one of my tables, after scheduling the downtime (No one is accessing the server but me), I renamed the target table, then recreated the original table and am trying to copy the data I want to keep back into the new table.

Appreciate the help.
0
Comment
Question by:camitche
  • 3
  • 2
5 Comments
 

Author Comment

by:camitche
ID: 18012549
fyi this is sql2000 running on windows 2003
0
 
LVL 29

Expert Comment

by:Nightman
ID: 18012586
1. What size is the transaction log file? Is it set to autogrow? Is it growing significantly during this process?
2. What size is the database file? Is it set to autogrow? Is it growing significantly during this process?

Both of these are performance killers. Configure your file sizes before hand to prevent rapid autogrowth (SLOW). Also, a commit of 34 million rows will probably take a while (and may cause locking and blocking). I would suggest that you do this in smaller batches of data (e.g. 100,000 at a time).
0
 

Author Comment

by:camitche
ID: 18012645
I have been monitoring the transaction logs and backing them up periodically during the process and I do show the database is auto growing as well. the db size is currently 54 GB, the last transaction log was around 9mb, I was thinking the same thing about the moving this across in smaller chunks, how do I set how many records to copy at a time?
0
 
LVL 29

Accepted Solution

by:
Nightman earned 2000 total points
ID: 18012672
Do you have a row ID or some other counter?

SELECT TOP 100000 * FROM myNewTable WHERE RowID > (SELECT ISNULL(MAX(RowID),0) FROM MyOldEmptyTable) ORDER BY RowID ASC

You could use datetime as well if you have one that you know will be sequentially incremented.
0
 

Author Comment

by:camitche
ID: 18012694
perfect, thanks NM :-D
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question