Saturday, February 25, 2012

Newbie:preparation to reindex SQL db

Hello,
A third-party vendor tells me a SQL db contains various errors and suggests
that I 'reindex' the db.
I see that I can go to SQL Query Analyzer, pick the db I need and run
DBCC DBREINDEX
Question is this, what's the implication of running this without specifying
a specific table ? Is that alright run this on the 'entire' database ?> Question is this, what's the implication of running this without
> specifying
> a specific table ? Is that alright run this on the 'entire' database ?
How large is the database? What is your tolerance for downtime?
I would make a backup of the database, restore it on another server, and
test out the reindex there. Not only will you get an idea of time/CPU/I/O
requirements, you will also be able to test how your application(s) will
work against it during the reindexing of the tables.
My guess is that in the long run you'll want to break up the operation into
smaller chunks (e.g. one or two tables at a time). But it's tough to say
without more information specific to *your* environment. I know what I
can't do here in mine. :-)|||Hi,
DBCC DBREINDEX will recreate the Index, But for identifying errors you need
to execute either DBCC CHECKDB or DBCC CHECKTABLE commands.
Once you identify the errors you need to execute DBCC CHECKDB with
REPAIR_REBUILD to clear the errors.
DBCC DBREINDEX can be used to remove the fragmentation in your table and
this command will lock your table. Due to this you can execute this command
only offline. So check your vendor whether to exeecute DBCC CHECKDB or
REINDEX.
Thanks
Hari
SQL Server MVP
"Magoo" <magoo-nospam@.hotmail.com> wrote in message
news:usGs49MUFHA.3280@.TK2MSFTNGP09.phx.gbl...
> Hello,
> A third-party vendor tells me a SQL db contains various errors and
suggests
> that I 'reindex' the db.
> I see that I can go to SQL Query Analyzer, pick the db I need and run
> DBCC DBREINDEX
> Question is this, what's the implication of running this without
specifying
> a specific table ? Is that alright run this on the 'entire' database ?
>|||What errors exactly did this vendor say you had in the database?
--
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:udIZZpRUFHA.2124@.TK2MSFTNGP14.phx.gbl...
> Hi,
> DBCC DBREINDEX will recreate the Index, But for identifying errors you
need
> to execute either DBCC CHECKDB or DBCC CHECKTABLE commands.
> Once you identify the errors you need to execute DBCC CHECKDB with
> REPAIR_REBUILD to clear the errors.
> DBCC DBREINDEX can be used to remove the fragmentation in your table and
> this command will lock your table. Due to this you can execute this
command
> only offline. So check your vendor whether to exeecute DBCC CHECKDB or
> REINDEX.
> Thanks
> Hari
> SQL Server MVP
> "Magoo" <magoo-nospam@.hotmail.com> wrote in message
> news:usGs49MUFHA.3280@.TK2MSFTNGP09.phx.gbl...
> > Hello,
> >
> > A third-party vendor tells me a SQL db contains various errors and
> suggests
> > that I 'reindex' the db.
> >
> > I see that I can go to SQL Query Analyzer, pick the db I need and run
> > DBCC DBREINDEX
> >
> > Question is this, what's the implication of running this without
> specifying
> > a specific table ? Is that alright run this on the 'entire' database ?
> >
> >
>

No comments:

Post a Comment