LOCK

  • Hi Experts,

    I am getting an exclusive lock on a particular table whenever i ran a select * from statement. The table is having less than 3600 rows. I checked the activity monitor and in lock by processes i found an objects named dbname.dbo.spt_fallback_db.I am not able to find that object in sysobjects table.

    Please help

    TIA

  • That object exist in the master DB; however I am not sure the purpose for it. I can't find much information on these tables.

    Thanks.

    [font="Arial"]---

    Mohit K. Gupta, MCITP: Database Administrator (2005), My Blog, Twitter: @SQLCAN[/url].
    Microsoft FTE - SQL Server PFE

    * Some time its the search that counts, not the finding...
    * I didn't think so, but if I was wrong, I was wrong. I'd rather do something, and make a mistake than be frightened and be doing nothing. :smooooth:[/font]

    How to ask for help .. Read Best Practices here[/url].

  • Have you tried using query hints (nolock)?

  • spt_fallback_db is in master and is a system table.


    * Noel

  • I know its in master database but in activity monitor its showing database_name.dbo.spt_fallback_db.

    when giving NOLOCK hint there is no problem without that its worst.

    The issue get solved when i reorganized the index in that table.

    But i just want to know how and why that lock happened .The table is a very small one having less than 3600 rows.Now the query is taking less than a second.

  • SELECT * .. should have created a shared lock on the table; not an exlusive one if you find the answer please let us know :pinch:. But even shared lock would have casued blockage (mind you it would have been very breif).

    [font="Arial"]---

    Mohit K. Gupta, MCITP: Database Administrator (2005), My Blog, Twitter: @SQLCAN[/url].
    Microsoft FTE - SQL Server PFE

    * Some time its the search that counts, not the finding...
    * I didn't think so, but if I was wrong, I was wrong. I'd rather do something, and make a mistake than be frightened and be doing nothing. :smooooth:[/font]

    How to ask for help .. Read Best Practices here[/url].

  • Mohit ,the problem is that whoever runs a select * statement in that table creates lock.

  • Try update statistics and reorganize indexes.itokke njn paranju tarano.

    i told you yesterday na 😛

  • - what isolation level are you using?

    - also, I am presuming your sure that this is an exclusive lock not an index lock?

    - the optimizer will lock objects if it deems it will yield the best query performance. Out of date statistics and a fragmented index are a prime combo for this type of thing.

    Carlton ..

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply