Solved

Would runnng dbcc showcontig lockup table?

Posted on 2012-03-20
4
264 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
  • 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQl Query to find x consecutive Nbrs in a Table 30 97
Amazon RDS migrate to SQL Server 3 24
TSQL convert date to string 4 34
SQL Quer 4 21
Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
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.

839 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