Friday, June 28, 2019

GP SQL - Failed to flush the commit table to disk in dbid 12 due to error 2601. Check the errorlog for more information.

https://cowmasterscorner.blogspot.com/2014/01/sql-2008-r2-failed-to-flush-commit.html

Already resolved with
Solution 2 (this one worked for me):
Run a

DBCC CHECKDB (two) WITH NO_INFOMSGS, ALL_ERRORMSGS

then most likely a

ALTER DATABASE two SET SINGLE_USER
GO
DBCC CHECKDB (two,repair_rebuild)
GO
ALTER two SET MULTI_USER
GO



This is a bug, install the latest SQL

https://support.microsoft.com/en-us/help/2603910/fix-backup-fails-in-sql-server-2008-sql-server-2008-r2-or-sql-server-2

It comes from MR enabling change tracking on tables

https://community.dynamics.com/gp/f/32/t/136038


Disable change Tracking, Backup, then enable change tracking
Get a list of all change tracking enabled tables with this
---------------------------------------------------------------------
SELECT * FROM sys.change_tracking_tables sctt

left join sys.tables st on sctt.object_id = st.object_id


------------------------------------------------------------------------
Use this to generate scripts to disable change tracking in all tables with it on
------------------------------------------------------------------
DECLARE @SQL NVARCHAR(MAX)='';
SELECT @SQL = @SQL + 'ALTER TABLE ' + s.name + '.' + t.name +
 ' Disable Change_tracking;'
FROM sys.change_tracking_tables ct
JOIN sys.tables t
 ON ct.object_id= t.object_id
JOIN sys.schemas s
 ON t.schema_id= s.schema_id;
PRINT @SQL;
EXEC sp_executesql @SQL;
-----------------------------------------------------------------

Run the script below against the Company database
---------------------------------------------------------
ALTER TABLE dbo.GL00102 Disable Change_tracking;ALTER TABLE dbo.GL40200 Disable Change_tracking;ALTER TABLE dbo.GL30000 Disable Change_tracking;ALTER TABLE dbo.GL40000 Disable Change_tracking;ALTER TABLE dbo.MC00200 Disable Change_tracking;ALTER TABLE dbo.GL10101 Disable Change_tracking;ALTER TABLE dbo.GL00200 Disable Change_tracking;ALTER TABLE dbo.GL12000 Disable Change_tracking;ALTER TABLE dbo.SY00300 Disable Change_tracking;ALTER TABLE dbo.GL00201 Disable Change_tracking;ALTER TABLE dbo.MC40600 Disable Change_tracking;ALTER TABLE dbo.GL32000 Disable Change_tracking;ALTER TABLE dbo.GL10001 Disable Change_tracking;ALTER TABLE dbo.SY40100 Disable Change_tracking;ALTER TABLE dbo.GL10000 Disable Change_tracking;ALTER TABLE dbo.GL00100 Disable Change_tracking;ALTER TABLE dbo.GL20000 Disable Change_tracking;ALTER TABLE dbo.GL10100 Disable Change_tracking;ALTER TABLE dbo.SY40101 Disable Change_tracking;ALTER TABLE dbo.MC40000 Disable Change_tracking;ALTER TABLE dbo.GL12001 Disable Change_tracking;
------------------------------------------------------------------------
Run script to disable on company
-------------------------------------------
ALTER DATABASE FABRIKAM
SET CHANGE_TRACKING = OFF
---------------------------------------------

Take Backups

enable Change Tracking
----------------------------------------------------------------------------
ALTER DATABASE FABRIKAM
SET CHANGE_TRACKING = ON
(CHANGE_RETENTION = 5 DAYS, AUTO_CLEANUP = ON)

ALTER TABLE dbo.GL00102 Enable Change_tracking;ALTER TABLE dbo.GL40200 Enable Change_tracking;ALTER TABLE dbo.GL30000 Enable Change_tracking;ALTER TABLE dbo.GL40000 Enable Change_tracking;ALTER TABLE dbo.MC00200 Enable Change_tracking;ALTER TABLE dbo.GL10101 Enable Change_tracking;ALTER TABLE dbo.GL00200 Enable Change_tracking;ALTER TABLE dbo.GL12000 Enable Change_tracking;ALTER TABLE dbo.SY00300 Enable Change_tracking;ALTER TABLE dbo.GL00201 Enable Change_tracking;ALTER TABLE dbo.MC40600 Enable Change_tracking;ALTER TABLE dbo.GL32000 Enable Change_tracking;ALTER TABLE dbo.GL10001 Enable Change_tracking;ALTER TABLE dbo.SY40100 Enable Change_tracking;ALTER TABLE dbo.GL10000 Enable Change_tracking;ALTER TABLE dbo.GL00100 Enable Change_tracking;ALTER TABLE dbo.GL20000 Enable Change_tracking;ALTER TABLE dbo.GL10100 Enable Change_tracking;ALTER TABLE dbo.SY40101 Enable Change_tracking;ALTER TABLE dbo.MC40000 Enable Change_tracking;ALTER TABLE dbo.GL12001 Enable Change_tracking;


-------------------------------------------------------------
Run the script below against the Dynamics database
ALTER TABLE dbo.MC00100
ENABLE CHANGE_TRACKING WITH (TRACK_COLUMNS_UPDATED = OFF);
GO
ALTER TABLE dbo.SY01500
ENABLE CHANGE_TRACKING WITH (TRACK_COLUMNS_UPDATED = OFF);
GO

1 comment:

  1. I am grateful for this posting of solution. I actually ran into it this afternoon & SQL posts were not detailed enough towards GP, as this solution is tailored. I was able to go through it resolve my issue & make my db backup. Thanks!

    ReplyDelete