Wednesday, January 30, 2019

How to Shrink Dynamics NAV SQL database or Transaction Log




How to Shrink your Dynamics NAV SQL database or Transaction Log

Step 1  Select and right click on the database --> Tasks -->Shrink --> Database







Step 2 Then it will show you Currently allocated space and Available free space as below


Step 3


Press ok
Then it will process and reduce the database size as below





  


If this method didn’t work try shrink files instead of database.


If both above didn’t work try below query, I can guaranty this would work

--You can find the logical name of the log file by using the following query:
SELECT name FROM sys.master_files WHERE type_desc = 'LOG'

USE NAV2018Production;
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE NAV2018Production
SET RECOVERY SIMPLE;
GO



-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (NAV2018Production_Log, 100);
GO


-- Reset the database recovery model.
ALTER DATABASE NAV2018Production
SET RECOVERY FULL;
GO

 




No comments:

Post a Comment

Setting up Docker Containers for Dynamics 365 Business Central

Step 1: Please enable Hyper V and Container features from Programs and Features https://docs.microsoft.com/en-us/virtualization/hy...