?
Solved

Would runnng dbcc showcontig lockup table?

Posted on 2012-03-20
4
Medium Priority
?
277 Views
Last Modified: 2012-03-31
I have a huge table, maybe 200 million rows, no clustered index.  I want to see the fragmentation on it by running dbcc showcontig. Should I be doing this off hours? would it lock up that table? This is SQL Server 2000
0
Comment
Question by:Camillia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 8

Expert Comment

by:gpizzuto
ID: 37742465
try to use the option "FAST". Or, better, use sys.dm_db_index_physical_stats (but don't know if it works in Sql 2000), with the "LIMITED" option.
0
 
LVL 7

Author Comment

by:Camillia
ID: 37742481
so it would lock up the table? this is sql 2000, what is "FAST" and i know it doesnt have that sys.dm_db_index_physical
0
 
LVL 8

Accepted Solution

by:
gpizzuto earned 2000 total points
ID: 37742566
This is the sintax of dbcc showcontig:

DBCC SHOWCONTIG
[ (
    { table_name | table_id | view_name | view_id }
    [ , index_name | index_id ]
) ]
    [ WITH
        {
         [ , [ ALL_INDEXES ] ]
         [ , [ TABLERESULTS ] ]
         [ , [ FAST ] ]
         [ , [ ALL_LEVELS ] ]
         [ NO_INFOMSGS ]
         }
    ]

as stated in MS documentation:

[...] The operation only requires an intent-shared (IS) table lock. This way all updates and inserts can be performed, except those that require an exclusive (X) table lock. This allows for a tradeoff between speed of execution and no reduction in concurrency against the number of statistics returned. However, if the command is being used only to gauge fragmentation, we recommend using the WITH FAST option for optimal performance. [...]
0
 
LVL 7

Author Comment

by:Camillia
ID: 37742640
so it locks the table.
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question