Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Deleting records from a table that is actively written too..


Deleting records from a table that is actively written too..

Author
Message
hp_dba_uk
hp_dba_uk
SSC Rookie
SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)

Group: General Forum Members
Points: 41 Visits: 123
Hi there,

We have a table where Application is logging. On average, roughly
800 rows are written to the table per minute so around 50,000 per hours.

Current size of the table is roughly around 18GB with over 60 million rows as its grown and now its taking too much of space. The table is actively written to so what's the best way to remove some of the old records without getting it locked down which in turn would break the Application as it wouldnt be able to write logs etc.

Any advise would be much appreciated. What's the best way to approach? I mean we can get developers to turn down loggin level required but then it has some useful info that would be lost when troubleshooting etc..

Thanks in Advance..
spaghettidba
spaghettidba
SSCertifiable
SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)

Group: General Forum Members
Points: 5732 Visits: 13305
A sliding window partitioning strategy could help here.

Dan Guzman has a couple of nice posts on the subject:
http://weblogs.sqlteam.com/DANG/archive/2008/08/30/Sliding-Window-Table-Partitioning.aspx
http://weblogs.sqlteam.com/dang/archive/2008/09.aspx

Setting up the partition scheme and rebuilding your indexes on the partition scheme can be done online if you have Enterprise Edition.

Hope this helps
Gianluca

--
Gianluca Sartori

How to post T-SQL questions
spaghettidba.com
@spaghettidba
Lowell
Lowell
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14973 Visits: 38992
Thanks for the Articles Gianluca!
good reading.

Lowell

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Lynn Pettis
Lynn Pettis
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24255 Visits: 37978
Gianluca Sartori (8/7/2012)
A sliding window partitioning strategy could help here.

Dan Guzman has a couple of nice posts on the subject:
http://weblogs.sqlteam.com/DANG/archive/2008/08/30/Sliding-Window-Table-Partitioning.aspx
http://weblogs.sqlteam.com/dang/archive/2008/09.aspx

Setting up the partition scheme and rebuilding your indexes on the partition scheme can be done online if you have Enterprise Edition.

Hope this helps
Gianluca


You need Enterprise Edition for table partitioning anyways.

Cool
Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
spaghettidba
spaghettidba
SSCertifiable
SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)

Group: General Forum Members
Points: 5732 Visits: 13305
Lynn Pettis (8/7/2012)
Gianluca Sartori (8/7/2012)
A sliding window partitioning strategy could help here.

Dan Guzman has a couple of nice posts on the subject:
http://weblogs.sqlteam.com/DANG/archive/2008/08/30/Sliding-Window-Table-Partitioning.aspx
http://weblogs.sqlteam.com/dang/archive/2008/09.aspx

Setting up the partition scheme and rebuilding your indexes on the partition scheme can be done online if you have Enterprise Edition.

Hope this helps
Gianluca


You need Enterprise Edition for table partitioning anyways.


Oh, sure. This is something I didn't think about. Blush

--
Gianluca Sartori

How to post T-SQL questions
spaghettidba.com
@spaghettidba
hp_dba_uk
hp_dba_uk
SSC Rookie
SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)

Group: General Forum Members
Points: 41 Visits: 123
Hi all,

Thanks for your support and useful links.

We are using enterprise edition. Just for your info we found some logic issues with Application side. It was using log4j loggin levels in wrong order hence loggin at wrong levels e.g. INFO instead of ERROR.

We have increased space on the drive (vmware) that was running out of space due to this, whiile we clear the table to minimum. This is where we may use the links given.

So thanks all.

Cheers
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search