Sql2008R2 日志无法收缩解决方案
生活随笔
收集整理的這篇文章主要介紹了
Sql2008R2 日志无法收缩解决方案
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
? ? 在網上查了二天資料,終于找到個解決了這個問題的方案,記錄下來.方便下次處理.
? ? 解決方案轉貼自:??https://blog.csdn.net/kk185800961/article/details/41865073
? ??
use DBName go dbcc opentran --結果如下 /* 已復制的事務信息:最早的分布式 LSN : (0:0:0)最早的非分布式 LSN : (5067131:1370:2) DBCC 執(zhí)行完畢。如果 DBCC 輸出了錯誤信息,請與系統(tǒng)管理員聯(lián)系。 */DBCC loginfo() --全是2 木有 0 都是活動事務,斷不了,更收縮不了。-- 一個沒有spid的東西。怎么殺啊? 查事務, select transaction_begin_time, case transaction_type when 1 then 'Read/Write transaction' when 2 then 'Read-Only transaction' when 3 then 'System transaction' when 4 then 'Distributed transaction' end tran_Type, case transaction_state when 0 then 'not been comoletely initaialiaed yet' when 1 then 'initaialiaed but ha notstarted' when 2 then 'active' when 3 then 'ended (read-only transaction)' when 4 then 'commit initiated for distributed transaction' when 5 then 'transaction prepared and waiting resolution' when 6 then 'commited' when 7 then 'being rolled back' when 0 then 'been rolled back' end transaction_state from sys.dm_tran_active_transactions --沒有發(fā)現(xiàn)異常的事務。沒有做過復制,沒有做過鏡像。--查看log狀態(tài) SELECT log_reuse_wait_desc FROM sys.databases WHERE NAME='DBName' --REPLICATION 某做過復制,竟然出來個這。use DBName checkpoint go sp_removedbreplication 'DBName' DBCC SHRINKFILE(DBName_Log,100);DBCC loginfo() --還是全是活動的。 dbcc opentran 還有的那個沒有spid的復制事務。?
轉載于:https://www.cnblogs.com/starluck/p/9922262.html
《新程序員》:云原生和全面數(shù)字化實踐50位技術專家共同創(chuàng)作,文字、視頻、音頻交互閱讀總結
以上是生活随笔為你收集整理的Sql2008R2 日志无法收缩解决方案的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 暂时转换
- 下一篇: 三次握手,四次挥手?