Solved

DBCC SHRINKDATABASE

Posted on 2006-07-14
2
779 Views
Last Modified: 2012-08-14
Hi

1)      Can I run DBBC SHRINKDATABASE command with users connected to the database to be shrunk?
2)      Any problem with data? Do I need to take a back up before running  DBBC SHRINKDATABASE?
3)      If I don’t have the options NOTRUNCATE/TRUNCATEONLY and I simply run:

DBCC SHRINKDATABASE (mydatabase, 10)

what happens to the files and data?

Thank you
Deepak
0
Comment
Question by:deepakee
2 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17107103
>1)     Can I run DBBC SHRINKDATABASE command with users connected to the database to be shrunk?
yes

>2)     Any problem with data? Do I need to take a back up before running  DBBC SHRINKDATABASE?
no problem with data, you can be paranoid and take a backup

>3)     If I don’t have the options NOTRUNCATE/TRUNCATEONLY and I simply run:
it will try to get the database size down to 10MB, but not force it.

0
 
LVL 42

Accepted Solution

by:
EugeneZ earned 500 total points
ID: 17107124
1.
If a database is full or nearly full, and a large number of the tables in the database do not have clustered indexes, DBCC SHRINKDATABASE command may cause severe performance degradation for SQL Server 2000.
The performance may degrade to the point where queries do not return results in a timely fashion. It takes longer for new connections to connect, resulting in connection timeouts. SQL Server 2000 may appear to stop responding (hang).

2. not required - but fresh backup good to have

3.This example decreases the size of the files in the UserDB user database to allow 10 percent free space in the files of UserDB.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

In this article—a derivative of my DaytaBase.org blog post (http://daytabase.org/2011/06/18/what-week-is-it/)—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now