[Translation] how to solve the problem when the distribution database grows to 25 GB

Source: Internet
Author: User
Sometimes, the distribution database (DistributionDatabase) will grow very large, so how to solve it? Please refer to the solution of ChrisSkorlinski and MicrosoftSQLServerEscalationServices. Original article address: HowtoresolvewhenDistributionDatabaseisgrowinghuge (+ 25gig)

Sometimes, Distribution Database (Distribution Database) will grow very large, so how to solve it, please refer to the solution of Chris Skorlinski and Microsoft SQL Server Escalation Services. Original article address: How to resolve when Distribution Database is growing huge (+ 25gig), translated by myself

Sometimes, Distribution Database (Distribution Database) will grow very large, so how to solve it, please refer to the solution of Chris Skorlinski and Microsoft SQL Server Escalation Services.

Original article address: How to resolve when Distribution Database is growing huge (+ 25gig). My translation level is limited. If any translation is inappropriate or incorrect, please do not advise!

Yes, of course I know that large databases are relative, but in general, if you see that the distribution database is growing to 25 GB, it means it is difficult for the cleaning process to delete replication transactions, next I will introduce how and why the cleanup process works. But now I want to introduce a frequently used technique for clearing data rows from distribution data. This solution includes modifying the SQL copy stored procedure and adding the number of lines deleted by each transaction. If you are uncomfortable with the code modification, skip to STEP 7.

The first article published a "conservative" approach. Next, I will publish some more "radical" solutions.

1) Save the original script for clearing and deleting the srepl_commands stored procedure of the msrepl_commands object

Sp_helptext sp_MSdelete_publisherdb_trans

2) Change CREATE to ALTER

Alter procedure sp_MSdelete_publisherdb_trans

3) change the DELETE operation from 2000 to 100000.

Delete top (2000) MSrepl_commands...

4) Save msrepl_transaction to clear the original code of sp_MSdelete_dodelete In the Stored Procedure

Sp_helptext sp_MSdelete_dodelete

5) change the CREATE keyword to ALTER.

Alter procedure sp_MSdelete_dodelete

6) change the location where the MSrepl_transactions record is deleted and change 5000 to 100000.

Delete TOP (5000) MSrepl_transactions...

7) Determine oldest day containing transactions decides how many days to keep things

Code Snippet

8) execute SSMS or TSQL jobs to clear previous transactions (24 hours * 5 days = 120), and then continue to execute the reduce @ max_distretention execution.

Code Snippet

Hope you found this helpful,

Hope this is useful to you.

Chris Skorlinski, Microsoft SQL Server Escalation Services

,

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.