Wednesday, 25 June 2014

Database Log files Shrinking DBCC SHRINKFILE

Shrinking database log file is necessary if log has grown out of control whether after a one-time data delete or where recovery model of the database is FULL and no log backups have been carried out. To reverse the effect of a one-time operation that caused unexpected log file growth are convincing reasons for shrinking a database\ database file.
Shrinking database is not a recommended process and should not be part of any regular maintenance operation but in any case you need to do so, you must REBUILD\ REORGANIZE indexes of database along with statistics update.

Script to shrink log files of all user created databases on server where some are with Simple'' and some are with 'Full' recovery model