Wednesday, March 7, 2012

How to compact & repair a database in SQL Server?

Hi,
I am facing a problem. I have a table with indexes (integers). These
occur out of sequence i.e. not in serial order. Due to this the performance
has decreased. I have tried the following commands but of no help :
1) dbcc checkdb
2) dbcc dbreindex
3) dbcc indexdefrag
Is there any other way to resolve this problem?
Regards,
HarshadHow did you determine that fragmented indexes are your problem? DBCC SHOWCON
TIG? Can you post the
result from DBCC SHOWCONTIG?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Harshad Phadnis" <HarshadPhadnis@.discussions.microsoft.com> wrote in messag
e
news:4845A140-D9BC-4B76-965B-1C29E3121893@.microsoft.com...
> Hi,
> I am facing a problem. I have a table with indexes (integers). These
> occur out of sequence i.e. not in serial order. Due to this the performanc
e
> has decreased. I have tried the following commands but of no help :
> 1) dbcc checkdb
> 2) dbcc dbreindex
> 3) dbcc indexdefrag
> Is there any other way to resolve this problem?
> Regards,
> Harshad|||Are you refering to gaps in the values of an identity column? Those are
completely irrelevant.
Use "dbcc showcontig" to analyze actual data fragmentation.
ML|||What do you mean by "not in serial order"? A table is an unordered set of
data. It has no serial order. Unless you can explain differently I suspect
you just need to use an ORDER BY statement in your queries.
David Portas
SQL Server MVP
--
"Harshad Phadnis" wrote:

> Hi,
> I am facing a problem. I have a table with indexes (integers). Thes
e
> occur out of sequence i.e. not in serial order. Due to this the performanc
e
> has decreased. I have tried the following commands but of no help :
> 1) dbcc checkdb
> 2) dbcc dbreindex
> 3) dbcc indexdefrag
> Is there any other way to resolve this problem?
> Regards,
> Harshad

No comments:

Post a Comment