Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
steel
Posting Yak Master
107 Posts |
Posted - 2008-05-14 : 02:19:01
|
hi all, I have a database on SQL SERVER 2000 and its size is grown too much large but i have low disk space so i want to purge the database,can anyone tell me how to purge the database.thank u |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-14 : 02:52:59
|
Use DBCC SHRINKDATABASE.http://msdn.microsoft.com/en-us/library/aa258287(SQL.80).aspx |
 |
|
steel
Posting Yak Master
107 Posts |
Posted - 2008-05-14 : 03:02:19
|
Thanks 4 ur reply but u are not getting me i want to extract the old data from the database and keep it some where else. |
 |
|
mcrowley
Aged Yak Warrior
771 Posts |
Posted - 2008-05-14 : 10:25:38
|
Is the datafile the big file in this database, or is it the log file? Assuming it is the datafile, and you need to export/archive old dataFirst, you will need to get the business user(s) to buy off on the plan. If they need the old data for any kind of reporting, then it is unlikely they will approve of you removing their data. Once you have their approval for which data, and how much of that data (best to get this in writing), then you can export that data with either DTS, or BCP. Get a good clean backup of the data BEFORE you try any of this, of course. The data can be exported to another database on another machine, text files, or several other storage options. In all cases, make sure you know where that data is, and be sure it is getting backed up. You will very likely not be asked for this data for a year or so, so think about how you will remember where the data is after that time. Once you are sure of the data that has been exported, then and ONLY then can you delete the data from the original database. Once the delete is completed, then you will have to pray to the god(s) of Data Distribution, and hope that shrinking the database does not take too long. SQL Server is exceedingly good at removing unused portions of data files at the end of a datafile, but poor at reclaiming space in the middle. After several days, you should have some diskspace back. |
 |
|
steel
Posting Yak Master
107 Posts |
Posted - 2008-05-15 : 05:58:49
|
I am really thankful to u.but can u please tell me the exact stepsthank u |
 |
|
mcrowley
Aged Yak Warrior
771 Posts |
Posted - 2008-05-15 : 09:40:23
|
Unfortunately, no. There is no set way of doing this. Have you talked to the business users yet? |
 |
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2008-05-15 : 21:52:36
|
And check with app developers, they can tell you how to purge old data. |
 |
|
|
|
|
|
|