From the course: SQL Server 2022 Administration
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Shrink databases - SQL Server Tutorial
From the course: SQL Server 2022 Administration
Shrink databases
So the cost of disk space has come down substantially over the past few decades in IT, but part of your job as a DBA is still to manage that space. And databases can be configured to auto grow and take up more space as they have data added to them. You can configure them to auto shrink and you should at least occasionally go in and check your databases and see if you do need to shrink them. So this lesson I'm going to show you how you can shrink your databases, and I'm going to talk about the auto shrink option and why I think it's evil. So let's dive right in. Here's the WideWorldImporters database, which is the sample with SQL, and if I look at the properties of this, you'll see on options that it is set to false for auto shrink. This is how I recommend you treat your database. Do not use auto shrink. And the reason for that is because, and I'm not a huge fan of auto grow either, but I get it in the event of an emergency, the database is filling up, you need to have it grow so…
Contents
-
-
-
-
-
-
-
-
-
-
-
-
-
(Locked)
Module 6 Introduction28s
-
(Locked)
Learning objectives40s
-
(Locked)
Schedule and monitor database backups12m 7s
-
(Locked)
Deal with database corruption4m 9s
-
(Locked)
Setup index maintenance14m 51s
-
(Locked)
Cleanup history8m 38s
-
(Locked)
Shrink databases11m 36s
-
(Locked)
Monitor database activity9m 44s
-
(Locked)
Use performance monitor5m 57s
-
(Locked)
Monitor database logs5m 8s
-
(Locked)
Use resource governor10m 37s
-
(Locked)
-
-