Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

TempDB growth
Every month we archive (write to file using bcp) about 50 million rows to a
file, and then delete the data that was written to file. In the process of
deleting, the transaction log grows and grows and grows. This is done in a
stored procedure.

We have changed this procedure to only write to file and then delete, 5
million rows at a time. This keeps tempdb to a reasonable size.

We are running FULL recovery mode, SQL Server 2005, SP1, on Windows 2003.

Is there anyway to reduce the growth of tempdb when these deletes are taking
place?

--
Message posted via http://www.webservertalk.com


Report this thread to moderator Post Follow-up to this message
Old Post
cbrichards via webservertalk.com
11-29-06 12:14 AM


Re: TempDB growth
Hi,

First step is to reduce the batch size to 100,000 or low. So as tempdb
growth will be reduced.

take a look into the article:-

http://www.microsoft.com/technet/pr...withtempdb.mspx

Thanks
Hari

"cbrichards via webservertalk.com" <u3288@uwe> wrote in message
 news:69fc2d8be0d89@u
we...
> Every month we archive (write to file using bcp) about 50 million rows to
> a
> file, and then delete the data that was written to file. In the process of
> deleting, the transaction log grows and grows and grows. This is done in a
> stored procedure.
>
> We have changed this procedure to only write to file and then delete, 5
> million rows at a time. This keeps tempdb to a reasonable size.
>
> We are running FULL recovery mode, SQL Server 2005, SP1, on Windows 2003.
>
> Is there anyway to reduce the growth of tempdb when these deletes are
> taking
> place?
>
> --
> Message posted via http://www.webservertalk.com
>



Report this thread to moderator Post Follow-up to this message
Old Post
Hari Prasad
11-29-06 05:12 AM


Re: TempDB growth
cbrichards via webservertalk.com  wrote:
> Every month we archive (write to file using bcp) about 50 million rows to 
a
> file, and then delete the data that was written to file. In the process of
> deleting, the transaction log grows and grows and grows. This is done in a
> stored procedure.
>
> We have changed this procedure to only write to file and then delete, 5
> million rows at a time. This keeps tempdb to a reasonable size.
>
> We are running FULL recovery mode, SQL Server 2005, SP1, on Windows 2003.
>
> Is there anyway to reduce the growth of tempdb when these deletes are taki
ng
> place?
>

Using smaller batches is really the only option.  You're asking SQL to
delete 5 million rows at once, all within the same transaction (batch).
The transaction log must be large enough to hold that entire
transaction, no way around it.


--
Tracy McKibben
MCDBA
http://www.realsqlguy.com

Report this thread to moderator Post Follow-up to this message
Old Post
Tracy McKibben
11-30-06 12:12 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

MS SQL Server archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 08:46 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006