Solved

how to compress /  shrink an msde 2000 database

Posted on 2006-06-28
3
3,057 Views
Last Modified: 2012-08-13
I have a windows 2000 server running msde.  It now has a database file that is almost 2 gb, the max it will allow.  I know one of my options is to move it to a sql standard server, but this database is just not worth the work or cost.  I have cleaned out some of the junk data in the database.  I am hoping I can run some sort of maintenance on the database to compress/shrink/defrag it.  It looks like I will be using the osql command, but I can only find documentation on how to use this to backup, move or restore the file, not perform any other maintenance on it.  Any advice would be helpful
0
Comment
Question by:lrpage
3 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17000640
if the file size has grown to 2GB, keep it there. if you cleaned out some tables, there will be free space available for new records
0
 
LVL 1

Accepted Solution

by:
terjoh earned 250 total points
ID: 17043778
As long as you have OSQL installed, run the following at a command prompt to compress the database:

osql -U [user name] -P [password] -S (local)\[Server Instance Name] -d [database name] -Q "DBCC SHRINKDATABASE ([database name])"

Let me know if you have any problems!!
0
 
LVL 3

Author Comment

by:lrpage
ID: 17044376
That was the command I was looking for.  Thank you.
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how the fundamental information of how to create a table.

776 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