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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Reindexing / Defrag a database

Author  Topic 

akatech
Starting Member

7 Posts

Posted - 2009-02-11 : 16:41:58
I am new to sql and was thrown into a project

I am deleting about 130,000 records and about 500GB of data from several tables in a database

SQL 2000 SP2 - Platform

How do I reindex / defrag the specific database and all the tables inside the database?


Let us call the database name mydatabase

I am not sure of the syntax - also can you run this from query analyer.

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-02-11 : 16:45:31
Did you search in forum? There are lots of post regarding this.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-02-11 : 17:56:48
500 GB of data divided by 130,000 records gives an average of 4,129,776 bytes per record...




E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

akatech
Starting Member

7 Posts

Posted - 2009-02-11 : 19:26:22
Yes the database has pdf images of documents it is storing so the files are between 1 - 15 MB for each pdf file. I did search but did not find anything that fit - new to the forum scene.
Go to Top of Page

mfemenel
Professor Frink

1421 Posts

Posted - 2009-02-11 : 19:52:48
Why do you feel like you have to defrag all of the tables in your database? Do you have fragmentation that is causing a problem?

Mike
"oh, that monkey is going to pay"
Go to Top of Page

akatech
Starting Member

7 Posts

Posted - 2009-02-11 : 20:23:28
Not sure why - after the delete of these records we are moving the database to another server and need to make sure the database was as small as possible - thought reindex / defrag would accomplish this. The database is 2 TB currently and with the delete will bring it to ~ 1.5 TB.

Also doesn't reindex / defrag improve the performance of a database after a large delete of the records in a table or tables?
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-02-11 : 22:39:45
quote:
Originally posted by akatech

Yes the database has pdf images of documents it is storing so the files are between 1 - 15 MB for each pdf file. I did search but did not find anything that fit - new to the forum scene.



Are you using Image datatype? I am not sure but I think Rebuild/Defragindex will not take care of Image,Text,ntext field.
Go to Top of Page
   

- Advertisement -