Re: Check database status.
- From: "Ken Varn" <nospam>
- Date: Fri, 20 May 2005 12:42:51 -0400
I am working on an embedded system that requires some administrative tools
to check the database integrity and perform repairs if necessary.
Since I don't have any corrupted databases to test with, I am not sure what
results to expect from CHECKDB if the database is in need of repair. First,
I want to first check integrity of DB and report if the database is in
error. Secondly, if repairs are performed, I want to be able to report to
the user if the repair was successful.
I don't really know what results are going to come back on a corrupt
database to know how to report it to the user.
Are there any docs on what the result fields could be when the repair is
performed?
--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.
EmailID = varnk
Domain = Diebold.com
-----------------------------------
"Elton W" <EltonW@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:092C7AB7-1C4B-41C6-83FF-65B98527213E@xxxxxxxxxxxxxxxx
> Hi Ken,
>
> I think it's OK to use DBCC CHECKDB (dbname) WITH TABLERESULTS,
NO_INFOMSGS
> to check database and report error by users.
>
> However, in me personal opinion, it's not good option to let user directly
> perform database repairing work. Database repairing work needs to be done
in
> single user mode. Anyway it's just my suggestion. And I'm not DBA role.
You
> can ask DBA people's options.
>
> HTH
>
> Elton
>
> "Ken Varn" wrote:
>
> > Thanks for the info.
> >
> > This information is really buried in the SQL Server help. I was able to
> > find it, but I have a couple other questions.
> >
> > If I call "'DBCC CHECKDB (tempdb) WITH TABLERESULTS, NO_INFOMSGS", I
get no
> > results back if the DB checks out ok. Is it a safe bet to assume that
if I
> > get no results, then the DB is ok, but if I do get results then the DB
could
> > have errors and be in need of repair?
> >
> > I am trying to come up with a method for providing the ability for my
users
> > to check the database for errors and report if it is in error.
> >
> > I also want to use this same call to repair the database if it is
broken,
> > and provide feedback on the success of the repair.
> >
> > I cannot find any info in the help to show how all of this could be
checked
> > properly with result sets.
> >
> > --
> > -----------------------------------
> > Ken Varn
> > Senior Software Engineer
> > Diebold Inc.
> >
> > EmailID = varnk
> > Domain = Diebold.com
> > -----------------------------------
> > "Elton W" <EltonW@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> > news:10BF2605-DF2D-4DAC-9C65-F9E8D734BD87@xxxxxxxxxxxxxxxx
> > > Hi Ken,
> > >
> > > In order to get result you should use option WITH TABLERESULTS. For
> > example
> > >
> > > sqlcommand.CommandText = "DBCC CHECKDB (tempdb) WITH TABLERESULTS";
> > > datareader = sqlcommand..ExecuteReader();
> > >
> > > Then you can get result in datareader.
> > >
> > > HTH
> > >
> > > Elton Wang
> > > elton_wang@xxxxxxxxxxx
> > >
> > >
> > > "Ken Varn" wrote:
> > >
> > > > I want to be able to check an SQLServer database to determine if it
is
> > not damaged or in need of repair. I looked into the DBCC CHECKDB SQL
call
> > to accomplish this. However, I cannot figure out how to check the
status of
> > the database after making this call in ADO.NET. I tried using a
> > SqlDataReader, but there is nothing returned in the reader that gives me
the
> > status of the call.
> > > >
> > > > Can someone make a recommendation on how I can check the status of a
> > database using ADO.NET?
> > > >
> > > >
> > > > --
> > > > -----------------------------------
> > > > Ken Varn
> > > > Senior Software Engineer
> > > > Diebold Inc.
> > > >
> > > > EmailID = varnk
> > > > Domain = Diebold.com
> > > > -----------------------------------
> >
> >
> >
.
- Follow-Ups:
- Re: Check database status.
- From: Elton W
- Re: Check database status.
- References:
- Check database status.
- From: Ken Varn
- RE: Check database status.
- From: Elton W
- Re: Check database status.
- From: Ken Varn
- Re: Check database status.
- From: Elton W
- Check database status.
- Prev by Date: Re: SQL Confusion in DA.Fill()
- Next by Date: Re: OleDbCommand should be disposed? Holding conn reference...
- Previous by thread: Re: Check database status.
- Next by thread: Re: Check database status.
- Index(es):
Relevant Pages
|