Dear sir
I understand the term fragmentation.Will u please giude me regarding what is meant by internal fragmentation and external fragmentation their difference and given an output of DBCC SHOWCONTIG how do we determine wheather the there is interfragmentation or external fragmentation
I was attempting to run the dbcc command on a couple of my databases and I get some errors on some servers but not others. Is there a reason for this? What am I doing wrong? Is there a server setting that stops dbcc commands?
Here are the commands and errors
dbcc showcontig
Server: Msg 2583, Level 16, State 3, Line 1 An incorrect number of parameters was given to the DBCC statement.
dbcc showcontig (PS_ABS_HIST_COM_UK)
Server: Msg 2560, Level 16, State 14, Line 1 Parameter 1 is incorrect for this DBCC statement.
Here us the Output of DBCC SHOWCONTIG for one of my tables
Row Size = 82 (i.e Sum of the lengths of all the Columns) No: of Rows = 162 (No of Rows in the table)
162 Rows can fit in two pages, Is there any way to make sure that these pages go on a same Extent so that my Scan Density will be 100.00% ( Ratio of Extent Switches to the Extent Scanned)
I tried all the Combinations of rebuilding the Clustered Indexes,BCP out the data and BCP IN, But all in vain....It does not put the pages in a same extent.
Does anyone know of a way to capture the results of DBCC ShowContig. My intentions are to capture these results, particularly the Avg. Page Density value and build my Reindexing jobs based on those values. Any ideas would be appreciated. Thanks Joe
Hi, Ive just created a table, clustered index with fillfactor 70% (as it will be doing thousands of inserts and deletions daily). After a few thousand inserts, i run dbcc showcontig on the table.
***the Extent switches just balloons out, and scan density drops badly. is this terrible?
Also - What is the main difference between "Logical Scan Fragmentation" & "Extent Scan Fragmentation". Every time, its either one of these values is much higher than the other. What is the best practice, which of the 2 should I be trying to keep fragmentation low?
I have been trying to up my sql knowledge and have been reading the following; http://www.sql-server-performance.com/articles/dba/dt_dbcc_showcontig_p1.aspx]
Now I think I understand it fully but I have a question about this. I understand Scan density, logical and extent scan fragmentation and I also now understand page density. My question. How do you know depending on your scenario how much to leave in your pages? Would you reindex heavily read tables to be of high scan density with low logical and extent fragmentation and aim for as much page density as possible? Well what if you have a heavily read table that also has a lot of inserts on it daily. What percentage of page density would you tell dbcc reindex to leave in your pages in order to avoid page splits? Or rather, would you allow them to occur and just have dbcc reindex run often? As im migrating from sql 2000 this is the first sql 2005 function I have started to look at and I already have so many questions...
I'm new to SQL Server, can somebody please give me a good explaination about whats wrong in the following table stats. I tried to see it in BOL, but I wuold appreciate if someone can suggest me the rules here, for expample what should be the ideal scan density and so on. Also let me know what one should do if there are some problems like mentioned below:
DBCC SHOWCONTIG WITH TABLERESULTS will show a ROW column for an index's row count. However, on an important table with quite a few indexes that I am using as a baseline, ROW is NULL for all indexes. Why? BOL definines ROWS as:-
"Number of data or index records at that level of the index. For a heap, this is the number of data records in the entire heap."
By the way, if I select from sysindexes for a one of the above indexes, there is a correct rowcount for the index.
hi, I am running this : dbcc showcontig (EMPLOYEE_EXTRACT) i got error below:
Server: Msg 2501, Level 16, State 45, Line 1 Could not find a table or object named 'EMPLOYEE_EXTRACT'. Check sysobjects. DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Then i look for that table name in sysobjects table it return me a record with that name select [name] from sysobjects where [name] ='EMPLOYEE_EXTRACT'
what is the problem here? - Any idea would be greatly appreciated. I run dbcc showcontig on other table , it runs fine. Thanks
I have a table where I store around 1 million rows for 7 days.I run a DBCC SHOWCONTIG every week and I noticed that the number ofRows and the Average Free Bytes are stable but the number of Extentsand the Average Record Size keeps increasing.Any idea how to explain this incrase? and how to stop it? Will DBCCDBREINDEX will help?Here is my data:Rows: 1166273 (same as last week)Extents: 147099 (+10% since last week)Max RecordSize: 7050Average Record Size: 7688 (+10% since last week)AverageFreeBytes: 372Average Page Density: 95Scan density: 30
I ran a DBCC Showcontig (tableid) and it tell me that one of my tables is only putting 0.19% data on each page. How can I control this for more data on a page. It tells me that I have 8078.8 bytes free per page.
I ran an INDEXDEFRAG against the tables in my DB, & yet the results in DBCC SHOWCONTIG are the same before and after for some of the tables that it defragmented. Why?
In the DBCC SHOWCONTIG before defragging, this was a sample table:
I ran the script from the BOL entry for 'DBCC SHOWCONTIG' to defragment all indexes in a database , under letter E, with @maxfrag = 5%. It returned the following results (there are 5 nonclustered indexes):
Dear All, i've used the DBCC showcontig command against my table table103 but i dont know how to analyze the results of fragmentation levels. please give me some explanations or some good links.....
please guide me as to why will we use these 2 commands. their basic use and what information do we have to check from the results of these commands. and what changes do we have to make?
how can we improve performance by using these commands?
please also tell me if these commands are to be used in conjunction with other commands.
Can someone please help me interpret this result set below and suggeston way I can speed up my table? What changes should I make?DBCC SHOWCONTIG scanning 'tblListing' table...Table: 'tblListing' (1092914965); index ID: 1, database ID: 13TABLE level scan performed.- Pages Scanned................................: 97044- Extents Scanned..............................: 12177- Extent Switches..............................: 13452- Avg. Pages per Extent........................: 8.0- Scan Density [Best Count:Actual Count].......: 90.17% [12131:13453]- Logical Scan Fragmentation ..................: 0.86%- Extent Scan Fragmentation ...................: 2.68%- Avg. Bytes Free per Page.....................: 1415.8- Avg. Page Density (full).....................: 82.51%DBCC execution completed. If DBCC printed error messages, contact yoursystem administrator.Thank you.
how could I load "DBCC showcontig (@TableName) with tableResults" to a table? I created a table and let insert to it via above "DBCC...." but problem is the results with "DBCC execution completed. If DBCC printed error messages, contact your system administrator.", or how could I mute this output line for each table ? thanks David --========================================= DBCC execution completed. If DBCC printed error messages, contact your system administrator. ObjectName ObjectId IndexName IndexId Level Pages Rows MinimumRecordSize MaximumRecordSize AverageRecordSize ForwardedRecords Extents ExtentSwitches AverageFreeBytes AveragePageDensity ScanDensity BestCount ActualCount LogicalFragmentation ExtentFragmentation -------------------------------------------------------------------------------------------------------------------------------- ----------- -------------------------------------------------------------------------------------------------------------------------------- ----------- ----------- -------------------- -------------------- ----------------- ----------------- ---------------------- -------------------- -------------------- -------------------- ---------------------- ---------------------- ---------------------- -------------------- -------------------- ---------------------- ---------------------- sysproxylogin 37575172 clust 1 0 0 0 0 0 0 0 0 0 0 0 100 0 0 0 0
I am playing with DBCC command to check the contsrainst on a perticular table (DBCC CHECKCONSTRAINTS ('myTable') WITH ALL_CONSTRAINTS), it always gives the following result:
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Is there a way to simply capture only the Table Name (or tbl ID), Index Name (or Idx ID) and Scan Density information from the output of DBCC Showcontig?
I would like to dump these elements into a table for some additional analysis/queries.
Hi,i'm on windows nt4 sp6a , sql server 7.00.0842i have something that i don't understand.The table 'source' is taking lot of space but when i bcp out, the file takeonly 11MB (fixed delimiter option)i issue showontig and it says me that Avg. Page Density(full).....................: 4.33%so if i understand there are a lot of space wasted per pageso i issue DBCC DBREINDEX('dbo.source', '', 50) and i expect to have Avg.Page Density (full).....................: 50%but it's still the same even after dbcc update usage on that tableat alst, i've done a select * into test from source and the test table takeonly 11MB like the bcp out. (1290 pages insted of 32923 pages of the sourcetable)so what can i do to reduce the 'source' table ?if anayone can help me ?the table 'source' the ddl is :CREATE TABLE dbo.source(f1_id numeric(18,0) NOT NULL,f2_id numeric(18,0) NOT NULL,f3_id numeric(28,0) IDENTITY,f4_id char(300) NOT NULL,CONSTRAINT pk_source_compid_tranidPRIMARY KEY NONCLUSTERED (f1_id,f2_id,f3x_id) WITH FILLFACTOR=50 ON[PRIMARY])sp_spaceused 'source'name rows reserved data index_size unusedsource 29701 287088 KB 263400 KB 23400 KB 288 KBUSE appligoDBCC UPDATEUSAGE('appli', 'dbo.source')WITH COUNT_ROWSgoDBCC SHOWCONTIG(702625546)goDBCC DBREINDEX('dbo.source', '', 50)goDBCC UPDATEUSAGE('appli', 'dbo.source')WITH COUNT_ROWSgoDBCC SHOWCONTIG(702625546)The command executed successfully with no results returned.DBCC execution completed. If DBCC printed error messages, contact yoursystem administrator.DBCC SHOWCONTIG scanning 'source' table...Table: 'source' (702625546); index ID: 0, database ID: 12TABLE level scan performed.- Pages Scanned................................: 32923- Extents Scanned..............................: 4122- Extent Switches..............................: 4121- Avg. Pages per Extent........................: 8.0- Scan Density [Best Count:Actual Count].......: 99.85% [4116:4122]- Extent Scan Fragmentation ...................: 95.41%- Avg. Bytes Free per Page.....................: 7743.9- Avg. Page Density (full).....................: 4.33%DBCC execution completed. If DBCC printed error messages, contact yoursystem administrator.Index (ID = 2) is being rebuilt.Index (ID = 3) is being rebuilt.Index (ID = 4) is being rebuilt.Index (ID = 5) is being rebuilt.Index (ID = 6) is being rebuilt.DBCC execution completed. If DBCC printed error messages, contact yoursystem administrator.DBCC UPDATEUSAGE: sysindexes row updated for table 'source' (index ID 2):USED pages: Changed from (2391) to (2390) pages.RSVD pages: Changed from (2400) to (2401) pages.DBCC UPDATEUSAGE: sysindexes row updated for table 'source' (index ID 3):USED pages: Changed from (201) to (200) pages.RSVD pages: Changed from (208) to (209) pages.DBCC UPDATEUSAGE: sysindexes row updated for table 'source' (index ID 4):USED pages: Changed from (335) to (334) pages.RSVD pages: Changed from (344) to (345) pages.DBCC UPDATEUSAGE: sysindexes row updated for table 'source' (index ID 0):USED pages: Changed from (35843) to (35849) pages.RSVD pages: Changed from (35882) to (35885) pages.DBCC execution completed. If DBCC printed error messages, contact yoursystem administrator.DBCC SHOWCONTIG scanning 'source' table...Table: 'source' (702625546); index ID: 0, database ID: 12TABLE level scan performed.- Pages Scanned................................: 32923- Extents Scanned..............................: 4122- Extent Switches..............................: 4121- Avg. Pages per Extent........................: 8.0- Scan Density [Best Count:Actual Count].......: 99.85% [4116:4122]- Extent Scan Fragmentation ...................: 95.41%- Avg. Bytes Free per Page.....................: 7743.9- Avg. Page Density (full).....................: 4.33%DBCC execution completed. If DBCC printed error messages, contact yoursystem administrator.
I'm currently on a company with an ms sql server 2000. I'm looking into the indexes and tables to see if there are some bottlenecks there but the LogicalFramentation is very low in the index I have searched.
However, this table has a logicalFragmentation of 99,9215698242188 which I get when I do DBCC SHOWCONTIG ([TInsurance]) WITH TABLERESULTS. Is that a value to be trusted or not to be trusted since this does not check an index? If it is, how do I defrag a table? I know only how to defrag an index. (example: DBCC INDEXDEFRAG (MFSSEK,[TInsurance], PK_InsuranceID) )
Tipps, suggestions, help, all is very wellcome! :-)
DBCC SHOWCONTIG scanning 'TInsurance' table... Table: 'TInsurance' (2051694557); index ID: 0, database ID: 17 TABLE level scan performed. - Pages Scanned................................: 1275 - Extents Scanned..............................: 225 - Extent Switches..............................: 224 - Avg. Pages per Extent........................: 5.7 - Scan Density [Best Count:Actual Count].......: 71.11% [160:225] - Extent Scan Fragmentation ...................: 74.67% - Avg. Bytes Free per Page.....................: 520.0 - Avg. Page Density (full).....................: 93.58% DBCC execution completed. If DBCC printed error messages, contact your system administrator.
I followed the advice of Paul Randal, but Im stumped as I am not able to determin what the corruption issues are. This is SQL 2000 and the database is a Solomon database that was recently upgraded to 6.5. the error I get when running the DBCC checkdb is as follows:
Server: Msg 8966, Level 16, State 1, Line 1 Could not read and latch page (1:18645) with latch type SH. sysindexes failed. DBCC execution completed. If DBCC printed error messages, contact your system administrator.
DBCC execution completed. If DBCC printed error messages, contact your system administrator. DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Now, the bad news. I am a bit of a novice and have picked this up from someone who left my company. It appears the latch error has been around for some time and only reared up when I instituted a new back up system that runs a dbcc check befor backing up. I don't think I have any clean backups.
reindex just ran on friday... how is it possible to have a logical scan fragmentation of 97% ... is it because fillfactor is set to 100 and pages cannot be reorganized any better with this arrangement? thanks