Showing posts with label DBA Snipts. Show all posts
Showing posts with label DBA Snipts. Show all posts

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



Sunday, 22 December 2013

Alter Growth Rate of All Database Files

To avoid unexpected and frequent growth of database files, it is important for a DBA to properly analyze the production databases file growth and setting them up with the appropriate rate.

Script is to change growth rate of all databases to 500MB.