Home All Groups Group Topic Archive Search About

URGENT - Cannot find bad data in table

Author
11 Sep 2006 2:28 PM
MartyNg
I have a small table in SQL 2000 that has < 5,000 records. All of a
sudden, I cannot run most queries against it...always get a time out.
This is a CRITICAL production table, and I need to get this fixed ASAP.

I only have two indexes on the table (on varchar columns), neither of
which I can drop, becuase I get a time out. I am able to run certain
queries but only get results up until what I assume is a record with
bad data. For example, I can run:

'select top 589 * from tablename'   which returns records instantly,
but
'select top 590 * from tablename'   will just time out.

Any ideas? Thanks!

Author
11 Sep 2006 2:33 PM
Tibor Karaszi
Seems you have a blocking situation. Perhaps someone is running a huge modification, or someone has
started a transaction, modified something and didn't end the transaction. Use sp_who, sp_lock,
sp_who2 etc to track down who is doing this.

Show quoteHide quote
"MartyNg" <Mart***@gmail.com> wrote in message
news:1157984930.922037.197760@e3g2000cwe.googlegroups.com...
>I have a small table in SQL 2000 that has < 5,000 records. All of a
> sudden, I cannot run most queries against it...always get a time out.
> This is a CRITICAL production table, and I need to get this fixed ASAP.
>
> I only have two indexes on the table (on varchar columns), neither of
> which I can drop, becuase I get a time out. I am able to run certain
> queries but only get results up until what I assume is a record with
> bad data. For example, I can run:
>
> 'select top 589 * from tablename'   which returns records instantly,
> but
> 'select top 590 * from tablename'   will just time out.
>
> Any ideas? Thanks!
>
Are all your drivers up to date? click for free checkup

Author
11 Sep 2006 2:43 PM
MartyNg
Thanks! I'm not familiar with those tools, but I'll give myself a crash
course right now! Thank you!


Tibor Karaszi wrote:
Show quoteHide quote
> Seems you have a blocking situation. Perhaps someone is running a huge modification, or someone has
> started a transaction, modified something and didn't end the transaction. Use sp_who, sp_lock,
> sp_who2 etc to track down who is doing this.
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
>
> "MartyNg" <Mart***@gmail.com> wrote in message
> news:1157984930.922037.197760@e3g2000cwe.googlegroups.com...
> >I have a small table in SQL 2000 that has < 5,000 records. All of a
> > sudden, I cannot run most queries against it...always get a time out.
> > This is a CRITICAL production table, and I need to get this fixed ASAP.
> >
> > I only have two indexes on the table (on varchar columns), neither of
> > which I can drop, becuase I get a time out. I am able to run certain
> > queries but only get results up until what I assume is a record with
> > bad data. For example, I can run:
> >
> > 'select top 589 * from tablename'   which returns records instantly,
> > but
> > 'select top 590 * from tablename'   will just time out.
> >
> > Any ideas? Thanks!
> >
Author
11 Sep 2006 3:06 PM
MartyNg
There does not seem to be any sort of persistent lock on that ID for
that table. Is it possible that it is a data problem? I vaguely recall
a similar problem a couple of years back, although I can't remember how
I was able to track down the record and fix the bad data.


Tibor Karaszi wrote:
Show quoteHide quote
> Seems you have a blocking situation. Perhaps someone is running a huge modification, or someone has
> started a transaction, modified something and didn't end the transaction. Use sp_who, sp_lock,
> sp_who2 etc to track down who is doing this.
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
>
> "MartyNg" <Mart***@gmail.com> wrote in message
> news:1157984930.922037.197760@e3g2000cwe.googlegroups.com...
> >I have a small table in SQL 2000 that has < 5,000 records. All of a
> > sudden, I cannot run most queries against it...always get a time out.
> > This is a CRITICAL production table, and I need to get this fixed ASAP.
> >
> > I only have two indexes on the table (on varchar columns), neither of
> > which I can drop, becuase I get a time out. I am able to run certain
> > queries but only get results up until what I assume is a record with
> > bad data. For example, I can run:
> >
> > 'select top 589 * from tablename'   which returns records instantly,
> > but
> > 'select top 590 * from tablename'   will just time out.
> >
> > Any ideas? Thanks!
> >
Author
11 Sep 2006 3:35 PM
Tracy McKibben
MartyNg wrote:
> There does not seem to be any sort of persistent lock on that ID for
> that table. Is it possible that it is a data problem? I vaguely recall
> a similar problem a couple of years back, although I can't remember how
> I was able to track down the record and fix the bad data.
>

Start your query in one Query Analyzer session.  While it is "hung",
start a second session and look at master..sysprocesses.  Do any of the
rows in that table have a non-zero value in the "blocked" column?  If
so, that non-zero value is the SPID of the process that is causing the
block.  You can then use DBCC INPUTBUFFER to see what that SPID is doing.


--
Tracy McKibben
MCDBA
http://www.realsqlguy.com
Author
13 Sep 2006 12:37 PM
MartyNg
After lots of jumping around in these tables, I did end up finding a
process that was holding a lock, which I used the "KILL" command on.
Everything seems to be working okay now. Thank you all for your help!


Tracy McKibben wrote:
Show quoteHide quote
> MartyNg wrote:
> > There does not seem to be any sort of persistent lock on that ID for
> > that table. Is it possible that it is a data problem? I vaguely recall
> > a similar problem a couple of years back, although I can't remember how
> > I was able to track down the record and fix the bad data.
> >
>
> Start your query in one Query Analyzer session.  While it is "hung",
> start a second session and look at master..sysprocesses.  Do any of the
> rows in that table have a non-zero value in the "blocked" column?  If
> so, that non-zero value is the SPID of the process that is causing the
> block.  You can then use DBCC INPUTBUFFER to see what that SPID is doing.
>
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com

Bookmark and Share