RE: Timeout problem when move large number of files

From: Mike Epprecht (SQL MVP) (mike_at_epprecht.net)
Date: 01/13/05


Date: Thu, 13 Jan 2005 00:45:04 -0800

Hi

In effect, you are moving more than 80% of your data that resides in the
table.
This has serious locking implications. During the delete, SQL Server
probably escalates the lock to a Table lock, resulting in any other access to
the table being blocked. Even if it is not a Table lock, just the index
maintenance that happens will cuase enough blocking so that nobody else can
work.

If you need high uptime on a server, and need to do these type of
operations, you have to do the deletes in small chunks. 10, 20 or 30 minute
chunks will probably be OK.

Moving data around so much does raise a red flag. DB design and indexing
sprint to mind.

Regards
Mike

"David" wrote:

> Hello, I have a transactions table that has a intensive use all day (24
> hours)
>
> For better performance at 5 AM, I move all transactions of previous day from
> the production table to a history table.
>
> The problem is that while moving (2 minutes aprox) all new transactions fall
> in a SQL timeout.
>
> I use trigger FOR DELETE to move
>
> in my production table I have this trigger
>
> CREATE TRIGGER [TGR_TRAN_DELETE] ON [dbo].[Transactions]
> FOR DELETE
> AS
> Insert into DbLog.dbo.his_Transactions select * from deleted
>
>
> So, my scheduled Job just do a Delete from Transactions where receivedtime <
> DateAdd(dd,-1, getdate())
>
>
> Do you know some way to avoid the timeout?
>
> Thanks
>
>
>
>



Relevant Pages

  • Re: Access 97 to a more powerfull platform!?
    ... Moving to SQL Server is common when a database "outgrows" ... Design problems are far and away the usual reason why a database ...
    (microsoft.public.access.gettingstarted)
  • Re: Copy database
    ... Best way is either do backup and restore or attach it. ... http://www.databasejournal.com/features/mssql/article.php/3379901 Moving ... http://www.support.microsoft.com/?id=168001 User Logon and/or Permission ... for SQL Server ...
    (microsoft.public.sqlserver.tools)
  • Re: best method for switching to a new server
    ... I can get the moving the db thing, no prob, but it's the in between part ... > a Restore ... > for SQL Server ... >> to move the Sql Server 2K database from the old to the new. ...
    (microsoft.public.sqlserver.setup)
  • Re: MOVING SQL 2000 to a different computer, and domain
    ... http://msdn2.microsoft.com/en-us/library/ms345408.aspx Moving ... http://www.support.microsoft.com/?id=221465 Using WITH MOVE in a Restore ... for SQL Server ... articles on how to do a SQL move, but I cannot find one specific to my ...
    (microsoft.public.sqlserver.setup)
  • Re: Cant read from database ??
    ... You also may need to worry about some permissions. ... http://msdn2.microsoft.com/en-us/library/ms345408.aspx Moving ... Issues When a Database Is Moved Between SQL Servers ... for SQL Server ...
    (microsoft.public.sqlserver.connect)