Thursday, December 17, 2015

Shrink database SQL Server

Shrinking database is one of best option to reduce log space after taking Full Backup. To do that we requires to change your database in simple recovery mode than shrink the database.

ALTER DATABASE <database-name> SET RECOVERY SIMPLE

GO

DBCC SHRINKFILE (<database-log-name>, 5)

GO

ALTER DATABASE <database-name> SET RECOVERY FULL

GO

No comments:

Post a Comment