Thursday, 30 July 2015

Dynamics Ax Data Size Increase and Slow,Steps to Reduce Data Size Shrink Logs

  1. Log into Microsoft SQL Server Management Studio
  2. Right click on your database.
  3. Select Properties.
  4. Click on Options.
  5. Change the recovery model to Simple.
  6. Click OK.
  7. Right click on the database.
  8. Select Tasks > Shrink > Database.
  9. Click OK.
  10. Right click on the database.
  11. Select Properties.
  12. Click on Options.
  13. Change the recovery model to Full.
  14. Click OK.

SSMS Steps To Shrink a SQL Log File

  • 1. Go to Start menu->All Programs-> SQL Server Management Studio->Object Explorer
ssms objects

  • Click on Databases so that it Expands and Select the Database which you want to Shrink
  • Then make a Right Click Go to Task-> Shrink-> Files.
shrink sql log file
  • A "Shrink Window" appears Select File type i.e. Log and moves to downward and select "Reorganize Page before releasing unused page" and choose the Size for Log File.
sql log shrink window

If You Dont Want to follow above steps then Copy below query and paste in to Sql Query Window

USE MicrosoftDynamicsAX;
ALTER DATABASE MicrosoftDynamicsAX
SET RECOVERY SIMPLE;
DBCC SHRINKFILE (MicrosoftDynamicsAX_Log, 0);
ALTER DATABASE MicrosoftDynamicsAX
SET RECOVERY FULL;