Solved

Would runnng dbcc showcontig lockup table?

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now