Hello there,
One of our clients is facing an issue with a database where the memory-optimized filegroup was forcibly removed using DBCC CHECKDB (test, REPAIR_ALLOW_DATA_LOSS). The database remains functional, but the transaction log continues to grow and cannot be truncated.
A few days ago, the database was part of an Always On Availability Group. Since log truncation was not possible, we removed it from Always On and switched to SIMPLE recovery mode. We executed these commands to shrink the log but issue still exist:
USE [test]
GO
DBCC SHRINKFILE (N'test_log', 0, TRUNCATEONLY)
GO
USE [test]
GO
CHECKPOINT
DBCC SHRINKFILE (N'test_log', 0, TRUNCATEONLY)
GO
We backed up and restored the database on another server, ran DBCC CHECKDB ('test', REPAIR_REBUILD), and tried to truncate the log again, but the issue persisted.
In the final attempt, we deleted the log, created a new one, and ran DBCC CHECKDB (test, REPAIR_ALLOW_DATA_LOSS) again. This made the database worst, now db is functional and while executing backup is gives and error.
The log scan number (463443:58:2) passed to log scan in database 'test' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup. (Microsoft SQL Server, Error: 9003)
Is there a solution to this?
Any insights or suggestions would be greatly appreciated.