Tuesday, February 14, 2012

DB Growth Issue

I have done this experiment on one of the tables. There is table called
build havinf nvText Field with large no of records. I want to drop that
column and recover space. These are the results I got.

SP_SPACEUSED BUILD Results
name rows reserved data index_size unused

1. Before Deleting nvText Field
Build 663211 341440 KB 339464 KB 1944 KB 32 KB

2. After Deleting nvText Field
Build 663211 341440 KB 339464 KB 1944 KB 32 KB

3. After Executing the Shrink Database from Enterprise Manager.
Build 663211 608280 KB 604744 KB 3456 KB 80 K

4. After Executing DBCC DBReindex (build,'',70)

Build 663211 124096 KB 123392 KB 712 KB -8 KB

Can anyone please explain me after executing step 3 i.e shrink data
column as well as index_size shows an increased figure whereas logically
it should be a reduced figure.

Regards,
Harcharan

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!Harcharan Jassal <hjjassal@.yahoo.com> wrote in message news:<41218aa5$0$14438$c397aba@.news.newsgroups.ws>...
> I have done this experiment on one of the tables. There is table called
> build havinf nvText Field with large no of records. I want to drop that
> column and recover space. These are the results I got.
> SP_SPACEUSED ?BUILD? Results
> name rows reserved data index_size unused
> 1. Before Deleting nvText Field
> Build 663211 341440 KB 339464 KB 1944 KB 32 KB
> 2. After Deleting nvText Field
> Build 663211 341440 KB 339464 KB 1944 KB 32 KB
> 3. After Executing the Shrink Database from Enterprise Manager.
> Build 663211 608280 KB 604744 KB 3456 KB 80 K
> 4. After Executing DBCC DBReindex (build,'',70)
> Build 663211 124096 KB 123392 KB 712 KB -8 KB
> Can anyone please explain me after executing step 3 i.e shrink data
> column as well as index_size shows an increased figure whereas logically
> it should be a reduced figure.
> Regards,
> Harcharan
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

As Books Online mentions, in some situations the data returned by
sp_spaceused "may not be current". You can try using @.updateusage to
see if that returns correct information:

exec sp_spaceused 'build', 'true'

See the Remarks section of sp_spaceused and also DBCC UPDATEUSAGE in
Books Online.

Simon

No comments:

Post a Comment