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
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.....
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
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
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):
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.
Does anyone know if there is a simple way to get the results of a DBCCINPUTBUFFER() request into a table? I have a process for monitoringactivity that will give me the results of sp_who2 into a temp table,and want to scroll through the active connections and get the inputbuffers into another table for review:Insert into #TmpWhoexec sp_who2 'active'Something like that with the dbcc command.I am using SQL 2000 SP4.Thanks,Tom
with actividades_secundarias as ( select a.*, r.Antigo, r.Novo, rn = row_number() over (PARTITION BY a.nif_antigo, r.novo ORDER BY a.nif_antigo) from ACT_SECUNDARIAS a inner join ((select
[Code] ....
I want to make a delete statement like this:
select * into #table1 from actvidades_secundarias where rn>1 Delete from act_secundarias where act_secundarias.nif_antigo = #table1.nif_antigo and act_secundarias.cod_cae = #table1.cod_cae
I have a results table that was created from many different sources in SSIS. I have done calculations and created derived columns in it. I am trying to figure out if there is a way to remove duplicate rows from this table without first writing it to a temp sql table and then parsing through it to remove them.
each row has a like key in a column - I would like to remove like rows keeping specific columns in the resulting row based on the data in this key field.
I run DBCC PAGE (dbname, 1, 136, 3) with trace 3604 on:
Server: Msg 8968, Level 16, State 1, Line 1 Table error: DBCC PAGE page (1:136) (object ID 0, index ID 0) is out of the range of this database. DBCC execution completed. If DBCC printed error messages, contact your system administrator.
One of our databases seems to be looking dodgy as some scheduled jobs are failing, but DBCC CHECKDB is no use since it has been running for over 1/2 hour without giving me any results, just the spinning globe.
How do I find out what is wrong without resorting to backups?
I have lost the reference but I read somewhere that when running DBCC DBREINDEX against a clustered index, all the secondary indexes on the table are automatically re-indexed as well. I did a test of this on a small table and it seemed to confirm this. However, now I've put this into practice, I am finding that it doesn't seem to work this way. I noticed that having run DBCC DBREINDEX against a table's clustered index (DBCC DBREINDEX ('tablename', 'clusteredIndexName', fill_factor)), the secondary indexes were not automatically re-indexed - as born out by the fact that they remained badly fragmented.
First of all, do the dba's who read this beleive it is correct that DBCC DBREINDEX run against a clustered index will automatically rebuild the secondary indexes too? If so, why wouldn't it work in all cases?
Normally, after I use DBCC DBREINDEX, I can be sure that Scan Density on a clustered or non-clustered index is very good - eg. 99% or 100%. However, I have one database where there are a number of indexes that are not showing any improvement in Scan Density after running DBCC DBREINDEX. In on case, a clustered index, I run it on two days in succession and Scan Density actually go worse! Can anyone give me a reason for this? Can anyone suggest how to fix it?
Guys, I need to send a group of people a list of specific processes running on the server, one of the requirements is to send them what's actually being ran on the machine. I have the information I was on the sysprocess tabke and the results of the DBCC Inputbuffer. Is there a way to link both result sets?
This is the criteria of the processes that neeed to be sent out to my users:
SELECT * FROM master.dbo.sysprocesses p WHERE last_batch < DATEADD(mi, -5, GETDATE()) AND dbo.fncGetNumLocks(p.spid, DB_ID('EngDataMart')) > 1 GROUP BY p.spid, p.loginame, p.hostname, dbo.fncGetNumLocks(p.spid, db_id('DBName')) ORDER BY p.spid
I can find many examples of loading DBCC results into tables. They all begin with a create table statement defining the results. My question is , other than trial and error, is there a way to determine what data types will be returned. Sure you can say that first element looks like an integer, but is it really a bigint, and that text string can be varchar(max) but will char(2) work.
I'm not looking for an answer for a specific DBCC function, but rather a generic way I can determine the characteristics of any DBCC result set.
I tried
SELECT * INTO #tmp FROM OPENROWSET('SQLOLEDB', 'Server=ray;Trusted_Connection=Yes;Database=Ed_sandbox', 'Set FmtOnly OFF; DBCC loginfo WITH tableresults ')
but I got back
Msg 11527, Level 16, State 1, Procedure sp_describe_first_result_set, Line 1
The metadata could not be determined because statement 'DBCC loginfo WITH tableresults' does not support metadata discovery.