Solved

Would runnng dbcc showcontig lockup table?

Posted on 2012-03-20
4
266 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 500 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

749 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