Solved

how to compress /  shrink an msde 2000 database

Posted on 2006-06-28
3
3,008 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
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.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

762 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

22 Experts available now in Live!

Get 1:1 Help Now