SQL Server database log shrinkage failure workaround

Source: Internet
Author: User

1, database-contraction-log-can shrink by more than 90, but the shrinkage, the capacity is not reduced. Check the information may be the log is occupied, temporarily unable to contract;

2, select Log_reuse_wait_desc from sys.databases where name = ' HIS_CDC ' query come Out is replication, think of before the CDC opened, and later not, just disable the job, CD C Forgot to disable:

    • A, first query which libraries open the CDC

 select * from sys.databases where is_cdc_enabled = 1

    • b, query which tables are open CDCD

SELECT * from Sys.tables WHERE is_tracked_by_cdc=1

    • C, disable the table

EXEC sys.sp_cdc_disable_table @source_schema = ' dbo ', @source_name = ' T1 ', @capture_instance = ' all ';

    • D. Disable Library

EXEC sys.sp_cdc_disable_db;

3, the final contraction, if not successful, it is recommended to detach the database, delete the log and then reattach the database.


This article is from the "net profit Small Yogoro" blog, please be sure to keep this source http://miawxm.blog.51cto.com/13260218/1962464

SQL Server database log shrinkage failure workaround

Related Article

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.