Solved

how to compress /  shrink an msde 2000 database

Posted on 2006-06-28
3
3,153 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 143

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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
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.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

630 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