Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

DBCC SHRINKDATABASE

Posted on 2006-07-14
2
Medium Priority
?
814 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 143

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 43

Accepted Solution

by:
Eugene Z earned 2000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

810 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