Monday, February 27, 2023

Log file Shrink in SQL Database (AXDB_log) to 1 MB | D365 F&0 | Dynamics 365 Finance and Operation

Log file Shrink in SQL Database (AXDB_log) to 1 MB 


USE AxDB;

GO

-- Truncate the log by changing the database recovery model to SIMPLE.

ALTER DATABASE AxDB

SET RECOVERY SIMPLE;

GO

-- Shrink the truncated log file to 1 MB.

DBCC SHRINKFILE (AxDB_log, 1);

GO

-- Reset the database recovery model.

ALTER DATABASE AxDB

SET RECOVERY FULL;

GO

No comments: