Tuesday, 14 March 2023

SQL server log database size shrink

1. Log in to SQL server wit Admin rights 

2. Use the below SQL commands in sequence

Note: Replace DBName with your log DB Name. EX(AXDB_Log)

  • Set the Database recovery mode to simple

            ALTER DATABASE DBName

            SET RECOVERY SIMPLE;

            GO

  • Shrink the DB

            DBCC SHRINKFILE (DBName, 1);

            GO

  • Set the database recover mode back to full

            ALTER DATABASE DBName

            SET RECOVERY FULL;

No comments:

Post a Comment