Create MS SQL Shrink Databases Task

This is the third part of MS SQL backup maintenance plan tutorial and continues from Create MS SQL Back Up Database Task.

Here we will discuss how to create and setup MS SQL Shrink Databases Task.

Each file within a database can be reduced to remove unused pages. Although the Database Engine will reuse space effectively, there are times when a file no longer needs to be as large as it once was; shrinking the file may then become necessary. Both data and transaction log files can be reduced, or shrunk.

The database files can be shrunk manually, either as a group or individually, or the database can be set to shrink automatically at specified intervals.

To add the ‘Shrink Databases Task’ drag it from the Maintenance Plan Tasks list, select it into the field, connect it with the arrow from the previous backup task, right-click on it and choose ‘Edit’.

Create MS SQL Shrink Databases Task

Here you have to repeat the steps where you choose server and databases that we discus in the previous tasks. Then choose the parameters which the shrink option will execute. In my case I choose to run on small sized databases as this server is used by shared hosting accounts.

In order to make this step fast I will choose the amount of free space to remain after shrink to be about ten percent.

Also I will leave the space to the operation system as the server is not only database.

The next tutorial will be for Maintenance Cleanup Task. As I promised in MS SQL Back Up Database Task I will create separate Cleanup Tasks for outdated database backups and transaction logs.

Filed Under: MSSQL

Anthony Gee About the Author: Anthony G. is an IT specialist with more than 9 years of solid working experience in the Web Hosting industry. Currently works as server support administrator, involved in consultative discussions about Web Hosting and server administration. One of the first writers in the website, now writing for Free Tutorials community - he is publishing tutorials and articles for the wide public, as well as specific technical solutions.

Leave a Reply