Showing posts with label dbcc. Show all posts
Showing posts with label dbcc. Show all posts

Monday, March 26, 2012

RebuildLog

hi friends,

one of my database corrupted , after setting that database into emergency mode , dbcc Rebuildlog was not working in sql server 2005, so how to proceed further?Hello yasodhakalimuthu. I must tell you that you have mistakenly posted in the Articles section of the SQL Server Group. The SQL Server help forum is here.

Thanks for joining. I hope that you find your way around the site.

Wednesday, March 21, 2012

Rebuild indexes

Hello,
Wich command DBCC can rebuild all indexes in my database?
Thanks
LeandroLSPlease see this script, which I got from www.sqlserverfaq.com
BEGIN
SET NOCOUNT ON
-- Basis of script taken from BOL
CREATE TABLE #fraglist (
ObjectName CHAR (255),
ObjectId INT,
IndexName CHAR (255),
IndexId INT,
Lvl INT,
CountPages INT,
CountRows INT,
MinRecSize INT,
MaxRecSize INT,
AvgRecSize INT,
ForRecCount INT,
Extents INT,
ExtentSwitches INT,
AvgFreeBytes INT,
AvgPageDensity INT,
ScanDensity DECIMAL,
BestCount INT,
ActualCount INT,
LogicalFrag DECIMAL,
ExtentFrag DECIMAL)
DECLARE tables_cur CURSOR FOR
SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
ORDER BY TABLE_NAME
OPEN tables_cur
DECLARE @.ObjectName sysname
FETCH NEXT FROM tables_cur INTO @.ObjectName
WHILE @.@.FETCH_STATUS = 0
BEGIN
EXEC( 'DBCC UPDATEUSAGE( 0, [' + @.ObjectName + '] ) WITH COUNT_ROWS,
NO_INFOMSGS' )
INSERT #fraglist
EXEC ( 'DBCC SHOWCONTIG( [' + @.ObjectName + '] ) WITH
TABLERESULTS, ALL_INDEXES, NO_INFOMSGS' )
FETCH NEXT FROM tables_cur INTO @.ObjectName
END
CLOSE tables_cur
DEALLOCATE tables_cur
DECLARE defrag_cur CURSOR FOR
SELECT ObjectName,
IndexName
FROM #fraglist fo
WHERE LogicalFrag > 1 -- % fragmentation
AND IndexID BETWEEN 1 AND 254
AND ( IndexID = 1
OR NOT EXISTS (
SELECT * -- If clustered index to defrag then don't
do anything else (no point).
FROM #fraglist fi
WHERE fi.ObjectId = fo.ObjectId
AND fi.IndexID = 1
)
)
DECLARE @.IndexName sysname
DECLARE @.sql varchar(1000)
OPEN defrag_cur
FETCH NEXT FROM defrag_cur INTO @.ObjectName, @.IndexName
WHILE @.@.FETCH_STATUS = 0
BEGIN
PRINT 'Processing dbreindex on ' + RTRIM( @.ObjectName ) + ',
indexname=' + @.IndexName
SET @.sql = 'DBCC DBREINDEX( ''' + RTRIM( @.ObjectName ) + ''', ' +
@.IndexName + ')'
PRINT @.sql
EXEC( @.sql )
PRINT 'Complete.'
FETCH NEXT FROM defrag_cur INTO @.ObjectName, @.IndexName
END
DEALLOCATE defrag_cur
DROP TABLE #fraglist
END
Cheers,
James Goodman MCSE, MCDBA
http://www.angelfire.com/sports/f1pictures|||Hi,
Use the below script to reindex all tables in a database,
DECLARE @.TableName varchar(255)
DECLARE TableCursor CURSOR FOR
SELECT table_name FROM information_schema.tables
WHERE table_type = 'base table'
OPEN TableCursor
FETCH NEXT FROM TableCursor INTO @.TableName
WHILE @.@.FETCH_STATUS = 0
BEGIN
PRINT "Reindexing - " + @.TableName
DBCC DBREINDEX(@.TableName)
FETCH NEXT FROM TableCursor INTO @.TableName
END
CLOSE TableCursor
DEALLOCATE TableCursor
Thanks
Hari
MCDBA
"Leandro Loureiro dos Santos" <leandro@.email.com> wrote in message
news:#6ODkDB4DHA.1804@.TK2MSFTNGP12.phx.gbl...
quote:

> Hello,
> Wich command DBCC can rebuild all indexes in my database?
> Thanks
> LeandroLS
>
|||Leanardo
Here's another approach
EXEC sp_msForEachTable @.COMMAND1= 'DBCC DBREINDEX ( "?")'
"Leandro Loureiro dos Santos" <leandro@.email.com> wrote in message
news:#6ODkDB4DHA.1804@.TK2MSFTNGP12.phx.gbl...
quote:

> Hello,
> Wich command DBCC can rebuild all indexes in my database?
> Thanks
> LeandroLS
>
|||Before you do this, take a moment to read the whitepaper at
http://www.microsoft.com/technet/tr...ze/ss2kidbp.asp
which will help you determine whether rebuilding or defragging is the right
way to go, and even whether your workload will benefit from either.
Regards.
--
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Leandro Loureiro dos Santos" <leandro@.email.com> wrote in message
news:#6ODkDB4DHA.1804@.TK2MSFTNGP12.phx.gbl...
quote:

> Hello,
> Wich command DBCC can rebuild all indexes in my database?
> Thanks
> LeandroLS
>

Tuesday, March 20, 2012

Rebuild indexes

Hello,
Wich command DBCC can rebuild all indexes in my database?
Thanks
LeandroLSPlease see this script, which I got from www.sqlserverfaq.com
BEGIN
SET NOCOUNT ON
-- Basis of script taken from BOL
CREATE TABLE #fraglist (
ObjectName CHAR (255),
ObjectId INT,
IndexName CHAR (255),
IndexId INT,
Lvl INT,
CountPages INT,
CountRows INT,
MinRecSize INT,
MaxRecSize INT,
AvgRecSize INT,
ForRecCount INT,
Extents INT,
ExtentSwitches INT,
AvgFreeBytes INT,
AvgPageDensity INT,
ScanDensity DECIMAL,
BestCount INT,
ActualCount INT,
LogicalFrag DECIMAL,
ExtentFrag DECIMAL)
DECLARE tables_cur CURSOR FOR
SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
ORDER BY TABLE_NAME
OPEN tables_cur
DECLARE @.ObjectName sysname
FETCH NEXT FROM tables_cur INTO @.ObjectName
WHILE @.@.FETCH_STATUS = 0
BEGIN
EXEC( 'DBCC UPDATEUSAGE( 0, [' + @.ObjectName + '] ) WITH COUNT_ROWS,
NO_INFOMSGS' )
INSERT #fraglist
EXEC ( 'DBCC SHOWCONTIG( [' + @.ObjectName + '] ) WITH
TABLERESULTS, ALL_INDEXES, NO_INFOMSGS' )
FETCH NEXT FROM tables_cur INTO @.ObjectName
END
CLOSE tables_cur
DEALLOCATE tables_cur
DECLARE defrag_cur CURSOR FOR
SELECT ObjectName,
IndexName
FROM #fraglist fo
WHERE LogicalFrag > 1 -- % fragmentation
AND IndexID BETWEEN 1 AND 254
AND ( IndexID = 1
OR NOT EXISTS (
SELECT * -- If clustered index to defrag then don't
do anything else (no point).
FROM #fraglist fi
WHERE fi.ObjectId = fo.ObjectId
AND fi.IndexID = 1
)
)
DECLARE @.IndexName sysname
DECLARE @.sql varchar(1000)
OPEN defrag_cur
FETCH NEXT FROM defrag_cur INTO @.ObjectName, @.IndexName
WHILE @.@.FETCH_STATUS = 0
BEGIN
PRINT 'Processing dbreindex on ' + RTRIM( @.ObjectName ) + ',
indexname=' + @.IndexName
SET @.sql = 'DBCC DBREINDEX( ''' + RTRIM( @.ObjectName ) + ''', ' +
@.IndexName + ')'
PRINT @.sql
EXEC( @.sql )
PRINT 'Complete.'
FETCH NEXT FROM defrag_cur INTO @.ObjectName, @.IndexName
END
DEALLOCATE defrag_cur
DROP TABLE #fraglist
END
Cheers,
James Goodman MCSE, MCDBA
http://www.angelfire.com/sports/f1pictures|||Hi,
Use the below script to reindex all tables in a database,
DECLARE @.TableName varchar(255)
DECLARE TableCursor CURSOR FOR
SELECT table_name FROM information_schema.tables
WHERE table_type = 'base table'
OPEN TableCursor
FETCH NEXT FROM TableCursor INTO @.TableName
WHILE @.@.FETCH_STATUS = 0
BEGIN
PRINT "Reindexing - " + @.TableName
DBCC DBREINDEX(@.TableName)
FETCH NEXT FROM TableCursor INTO @.TableName
END
CLOSE TableCursor
DEALLOCATE TableCursor
Thanks
Hari
MCDBA
"Leandro Loureiro dos Santos" <leandro@.email.com> wrote in message
news:#6ODkDB4DHA.1804@.TK2MSFTNGP12.phx.gbl...
> Hello,
> Wich command DBCC can rebuild all indexes in my database?
> Thanks
> LeandroLS
>|||Leanardo
Here's another approach
EXEC sp_msForEachTable @.COMMAND1= 'DBCC DBREINDEX ( "?")'
"Leandro Loureiro dos Santos" <leandro@.email.com> wrote in message
news:#6ODkDB4DHA.1804@.TK2MSFTNGP12.phx.gbl...
> Hello,
> Wich command DBCC can rebuild all indexes in my database?
> Thanks
> LeandroLS
>|||Before you do this, take a moment to read the whitepaper at
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/sql/maintain/optimize/ss2kidbp.asp
which will help you determine whether rebuilding or defragging is the right
way to go, and even whether your workload will benefit from either.
Regards.
--
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Leandro Loureiro dos Santos" <leandro@.email.com> wrote in message
news:#6ODkDB4DHA.1804@.TK2MSFTNGP12.phx.gbl...
> Hello,
> Wich command DBCC can rebuild all indexes in my database?
> Thanks
> LeandroLS
>

Rebuild index issue - - strange

Hi Folks,

SQL Server 2000 SP3 on Windows 2000. I have a database on which I ran
the command :

dbcc dbreindex ('tablename')
go

for all tables in the database. Then I compared the dbcc showcontig
with all_index output from before and after the reindex and on the
largest table in the database I found this. First output is prior to
reindex:

Table: 'PlannedTransferArchive' (1975014117); index ID: 1, database ID:
7
TABLE level scan performed.
- Pages Scanned........................: 184867
- Extents Scanned.......................: 23203
- Extent Switches.......................: 23324
- Avg. Pages per Extent..................: 8.0
- Scan Density [Best Count:Actual Count]......: 99.07% [23109:23325]
- Logical Scan Fragmentation ..............: 11.13%
- Extent Scan Fragmentation ...............: 35.46%
- Avg. Bytes Free per Page................: 60.0
- Avg. Page Density (full)................: 99.26%

Second output is from after the reindex:

DBCC SHOWCONTIG scanning 'PlannedTransferArchive' table...
Table: 'PlannedTransferArchive' (1975014117); index ID: 1, database ID:
8
TABLE level scan performed.
- Pages Scanned........................: 303177
- Extents Scanned.......................: 37964
- Extent Switches.......................: 42579
- Avg. Pages per Extent..................: 8.0
- Scan Density [Best Count:Actual Count]......: 89.00% [37898:42580]
- Logical Scan Fragmentation ..............: 43.19%
- Extent Scan Fragmentation ...............: 24.78%
- Avg. Bytes Free per Page................: 75.1
- Avg. Page Density (full)................: 99.07%

Following are my concerns:

The following numbers are all higher after reindex than before reindex:

pages scanned, extent switches, logical scan fragmentation, avg bytes
free per page, avg page density.

scan density is lower after reindex than before reindex

Seems to me that the numbers that are higher after reindex should be
lower and numbers that are lower after reindex should be higher? I
didn't specify the fill factor in the dbcc reindex command so it should
have used the default fill factor. The fill factor has never been
changed on this machine.

Am I missing something?

Thanks,
Raziq.

*** Sent via Developersdex http://www.developersdex.com ***if you look at your database ID's, they are different. did you run
this on 2 different databases?

Raziq Shekha wrote:
> Hi Folks,
> SQL Server 2000 SP3 on Windows 2000. I have a database on which I ran
> the command :
> dbcc dbreindex ('tablename')
> go
> for all tables in the database. Then I compared the dbcc showcontig
> with all_index output from before and after the reindex and on the
> largest table in the database I found this. First output is prior to
> reindex:
>
> Table: 'PlannedTransferArchive' (1975014117); index ID: 1, database ID:
> 7
> TABLE level scan performed.
> - Pages Scanned........................: 184867
> - Extents Scanned.......................: 23203
> - Extent Switches.......................: 23324
> - Avg. Pages per Extent..................: 8.0
> - Scan Density [Best Count:Actual Count]......: 99.07% [23109:23325]
> - Logical Scan Fragmentation ..............: 11.13%
> - Extent Scan Fragmentation ...............: 35.46%
> - Avg. Bytes Free per Page................: 60.0
> - Avg. Page Density (full)................: 99.26%
>
> Second output is from after the reindex:
>
> DBCC SHOWCONTIG scanning 'PlannedTransferArchive' table...
> Table: 'PlannedTransferArchive' (1975014117); index ID: 1, database ID:
> 8
> TABLE level scan performed.
> - Pages Scanned........................: 303177
> - Extents Scanned.......................: 37964
> - Extent Switches.......................: 42579
> - Avg. Pages per Extent..................: 8.0
> - Scan Density [Best Count:Actual Count]......: 89.00% [37898:42580]
> - Logical Scan Fragmentation ..............: 43.19%
> - Extent Scan Fragmentation ...............: 24.78%
> - Avg. Bytes Free per Page................: 75.1
> - Avg. Page Density (full)................: 99.07%
>
> Following are my concerns:
> The following numbers are all higher after reindex than before reindex:
> pages scanned, extent switches, logical scan fragmentation, avg bytes
> free per page, avg page density.
> scan density is lower after reindex than before reindex
> Seems to me that the numbers that are higher after reindex should be
> lower and numbers that are lower after reindex should be higher? I
> didn't specify the fill factor in the dbcc reindex command so it should
> have used the default fill factor. The fill factor has never been
> changed on this machine.
> Am I missing something?
> Thanks,
> Raziq.
> *** Sent via Developersdex http://www.developersdex.com ***

Friday, March 9, 2012

Reasons why DBCC INDEXDEFRAG would not work

I am performing DBCC INDEXDEFRAG on my indexes in a table because I have
really bad extent scan fragmentation. After I run it though nothing has
seemingly changed. Can someone explain some reasons why this would be
happening?What index id are you looking at? Don't look at index id 0, as this is the d
ata in a heap table
(table without clustered index). In such, there is no order between the rows
, so the value is
meaningless.
If you are looking at an index (index id between 1 and 250), what does logic
al scan fragmentation
say?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Andre" <Andre@.discussions.microsoft.com> wrote in message
news:3D1ADA79-7827-48CD-BC51-0AEB4D54F164@.microsoft.com...
>I am performing DBCC INDEXDEFRAG on my indexes in a table because I have
> really bad extent scan fragmentation. After I run it though nothing has
> seemingly changed. Can someone explain some reasons why this would be
> happening?|||In addition to what Tibor stated if you have multiple files in your
filegroup you should pay attention to the Logical Fragmentation.
Andrew J. Kelly SQL MVP
"Andre" <Andre@.discussions.microsoft.com> wrote in message
news:3D1ADA79-7827-48CD-BC51-0AEB4D54F164@.microsoft.com...
>I am performing DBCC INDEXDEFRAG on my indexes in a table because I have
> really bad extent scan fragmentation. After I run it though nothing has
> seemingly changed. Can someone explain some reasons why this would be
> happening?|||Run INDEXDEFRAG again in QA, output to text and paste it here.
"Andre" <Andre@.discussions.microsoft.com> wrote in message
news:3D1ADA79-7827-48CD-BC51-0AEB4D54F164@.microsoft.com...
>I am performing DBCC INDEXDEFRAG on my indexes in a table because I have
> really bad extent scan fragmentation. After I run it though nothing has
> seemingly changed. Can someone explain some reasons why this would be
> happening?|||I think you mean DBCC SHOWCONTIG?
Andrew J. Kelly SQL MVP
"JT" <someone@.microsoft.com> wrote in message
news:OPK0LivjFHA.3936@.TK2MSFTNGP10.phx.gbl...
> Run INDEXDEFRAG again in QA, output to text and paste it here.
> "Andre" <Andre@.discussions.microsoft.com> wrote in message
> news:3D1ADA79-7827-48CD-BC51-0AEB4D54F164@.microsoft.com...
>|||Here is the output of DBCC SHOWCONTIG (Faxes) with all_indexes
DBCC SHOWCONTIG scanning 'Faxes' table...
Table: 'Faxes' (1893581784); index ID: 1, database ID: 5
TABLE level scan performed.
- Pages Scanned........................: 31251
- Extents Scanned.......................: 3921
- Extent Switches.......................: 3929
- Avg. Pages per Extent..................: 8.0
- Scan Density [Best Count:Actual Count]......: 99.41% [3907:3930]
- Logical Scan Fragmentation ..............: 0.04%
- Extent Scan Fragmentation ...............: 0.51%
- Avg. Bytes Free per Page................: 748.9
- Avg. Page Density (full)................: 90.75%
DBCC SHOWCONTIG scanning 'Faxes' table...
Table: 'Faxes' (1893581784); index ID: 2, database ID: 5
LEAF level scan performed.
- Pages Scanned........................: 5482
- Extents Scanned.......................: 696
- Extent Switches.......................: 704
- Avg. Pages per Extent..................: 7.9
- Scan Density [Best Count:Actual Count]......: 97.30% [686:705]
- Logical Scan Fragmentation ..............: 0.29%
- Extent Scan Fragmentation ...............: 1.44%
- Avg. Bytes Free per Page................: 822.8
- Avg. Page Density (full)................: 89.83%
DBCC SHOWCONTIG scanning 'Faxes' table...
Table: 'Faxes' (1893581784); index ID: 3, database ID: 5
LEAF level scan performed.
- Pages Scanned........................: 10091
- Extents Scanned.......................: 1276
- Extent Switches.......................: 1353
- Avg. Pages per Extent..................: 7.9
- Scan Density [Best Count:Actual Count]......: 93.21% [1262:1354]
- Logical Scan Fragmentation ..............: 0.50%
- Extent Scan Fragmentation ...............: 1.18%
- Avg. Bytes Free per Page................: 800.6
- Avg. Page Density (full)................: 90.11%
DBCC SHOWCONTIG scanning 'Faxes' table...
Table: 'Faxes' (1893581784); index ID: 4, database ID: 5
LEAF level scan performed.
- Pages Scanned........................: 6900
- Extents Scanned.......................: 873
- Extent Switches.......................: 974
- Avg. Pages per Extent..................: 7.9
- Scan Density [Best Count:Actual Count]......: 88.51% [863:975]
- Logical Scan Fragmentation ..............: 0.96%
- Extent Scan Fragmentation ...............: 2.75%
- Avg. Bytes Free per Page................: 867.0
- Avg. Page Density (full)................: 89.29%
DBCC SHOWCONTIG scanning 'Faxes' table...
Table: 'Faxes' (1893581784); index ID: 5, database ID: 5
LEAF level scan performed.
- Pages Scanned........................: 7654
- Extents Scanned.......................: 966
- Extent Switches.......................: 1071
- Avg. Pages per Extent..................: 7.9
- Scan Density [Best Count:Actual Count]......: 89.27% [957:1072]
- Logical Scan Fragmentation ..............: 0.78%
- Extent Scan Fragmentation ...............: 2.17%
- Avg. Bytes Free per Page................: 855.0
- Avg. Page Density (full)................: 89.44%
DBCC SHOWCONTIG scanning 'Faxes' table...
Table: 'Faxes' (1893581784); index ID: 6, database ID: 5
LEAF level scan performed.
- Pages Scanned........................: 9499
- Extents Scanned.......................: 1197
- Extent Switches.......................: 1325
- Avg. Pages per Extent..................: 7.9
- Scan Density [Best Count:Actual Count]......: 89.59% [1188:1326]
- Logical Scan Fragmentation ..............: 0.88%
- Extent Scan Fragmentation ...............: 38.43%
- Avg. Bytes Free per Page................: 851.5
- Avg. Page Density (full)................: 89.48%
DBCC SHOWCONTIG scanning 'Faxes' table...
Table: 'Faxes' (1893581784); index ID: 7, database ID: 5
LEAF level scan performed.
- Pages Scanned........................: 7911
- Extents Scanned.......................: 999
- Extent Switches.......................: 1088
- Avg. Pages per Extent..................: 7.9
- Scan Density [Best Count:Actual Count]......: 90.82% [989:1089]
- Logical Scan Fragmentation ..............: 0.70%
- Extent Scan Fragmentation ...............: 60.26%
- Avg. Bytes Free per Page................: 856.8
- Avg. Page Density (full)................: 89.41%
DBCC SHOWCONTIG scanning 'Faxes' table...
Table: 'Faxes' (1893581784); index ID: 8, database ID: 5
LEAF level scan performed.
- Pages Scanned........................: 8900
- Extents Scanned.......................: 1124
- Extent Switches.......................: 1249
- Avg. Pages per Extent..................: 7.9
- Scan Density [Best Count:Actual Count]......: 89.04% [1113:1250]
- Logical Scan Fragmentation ..............: 0.79%
- Extent Scan Fragmentation ...............: 58.19%
- Avg. Bytes Free per Page................: 836.1
- Avg. Page Density (full)................: 89.67%
DBCC execution completed. If DBCC printed error messages, contact your
system administrator.
"Tibor Karaszi" wrote:

> What index id are you looking at? Don't look at index id 0, as this is the
data in a heap table
> (table without clustered index). In such, there is no order between the ro
ws, so the value is
> meaningless.
> If you are looking at an index (index id between 1 and 250), what does log
ical scan fragmentation
> say?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Andre" <Andre@.discussions.microsoft.com> wrote in message
> news:3D1ADA79-7827-48CD-BC51-0AEB4D54F164@.microsoft.com...
>|||That too.
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:OBNVykvjFHA.3064@.TK2MSFTNGP15.phx.gbl...
>I think you mean DBCC SHOWCONTIG?
> --
> Andrew J. Kelly SQL MVP
>
> "JT" <someone@.microsoft.com> wrote in message
> news:OPK0LivjFHA.3936@.TK2MSFTNGP10.phx.gbl...
>|||Your Logical fragmentation is fine and is what you should be concerned with.
I suspect you have more than 1 file in that filegroup and that is what is
causing the higher numbers of Physical Fragmentation. Is that true? What
does sp_helpdb 'yourDB' show? By the way do you really need 8 indexes on a
Fax table?
Andrew J. Kelly SQL MVP
"Andre" <Andre@.discussions.microsoft.com> wrote in message
news:A8CFC75C-77C5-4A61-857F-DA43BA4FC451@.microsoft.com...
> Here is the output of DBCC SHOWCONTIG (Faxes) with all_indexes
> DBCC SHOWCONTIG scanning 'Faxes' table...
> Table: 'Faxes' (1893581784); index ID: 1, database ID: 5
> TABLE level scan performed.
> - Pages Scanned........................: 31251
> - Extents Scanned.......................: 3921
> - Extent Switches.......................: 3929
> - Avg. Pages per Extent..................: 8.0
> - Scan Density [Best Count:Actual Count]......: 99.41% [3907:3930]
> - Logical Scan Fragmentation ..............: 0.04%
> - Extent Scan Fragmentation ...............: 0.51%
> - Avg. Bytes Free per Page................: 748.9
> - Avg. Page Density (full)................: 90.75%
> DBCC SHOWCONTIG scanning 'Faxes' table...
> Table: 'Faxes' (1893581784); index ID: 2, database ID: 5
> LEAF level scan performed.
> - Pages Scanned........................: 5482
> - Extents Scanned.......................: 696
> - Extent Switches.......................: 704
> - Avg. Pages per Extent..................: 7.9
> - Scan Density [Best Count:Actual Count]......: 97.30% [686:705]
> - Logical Scan Fragmentation ..............: 0.29%
> - Extent Scan Fragmentation ...............: 1.44%
> - Avg. Bytes Free per Page................: 822.8
> - Avg. Page Density (full)................: 89.83%
> DBCC SHOWCONTIG scanning 'Faxes' table...
> Table: 'Faxes' (1893581784); index ID: 3, database ID: 5
> LEAF level scan performed.
> - Pages Scanned........................: 10091
> - Extents Scanned.......................: 1276
> - Extent Switches.......................: 1353
> - Avg. Pages per Extent..................: 7.9
> - Scan Density [Best Count:Actual Count]......: 93.21% [1262:1354]
> - Logical Scan Fragmentation ..............: 0.50%
> - Extent Scan Fragmentation ...............: 1.18%
> - Avg. Bytes Free per Page................: 800.6
> - Avg. Page Density (full)................: 90.11%
> DBCC SHOWCONTIG scanning 'Faxes' table...
> Table: 'Faxes' (1893581784); index ID: 4, database ID: 5
> LEAF level scan performed.
> - Pages Scanned........................: 6900
> - Extents Scanned.......................: 873
> - Extent Switches.......................: 974
> - Avg. Pages per Extent..................: 7.9
> - Scan Density [Best Count:Actual Count]......: 88.51% [863:975]
> - Logical Scan Fragmentation ..............: 0.96%
> - Extent Scan Fragmentation ...............: 2.75%
> - Avg. Bytes Free per Page................: 867.0
> - Avg. Page Density (full)................: 89.29%
> DBCC SHOWCONTIG scanning 'Faxes' table...
> Table: 'Faxes' (1893581784); index ID: 5, database ID: 5
> LEAF level scan performed.
> - Pages Scanned........................: 7654
> - Extents Scanned.......................: 966
> - Extent Switches.......................: 1071
> - Avg. Pages per Extent..................: 7.9
> - Scan Density [Best Count:Actual Count]......: 89.27% [957:1072]
> - Logical Scan Fragmentation ..............: 0.78%
> - Extent Scan Fragmentation ...............: 2.17%
> - Avg. Bytes Free per Page................: 855.0
> - Avg. Page Density (full)................: 89.44%
> DBCC SHOWCONTIG scanning 'Faxes' table...
> Table: 'Faxes' (1893581784); index ID: 6, database ID: 5
> LEAF level scan performed.
> - Pages Scanned........................: 9499
> - Extents Scanned.......................: 1197
> - Extent Switches.......................: 1325
> - Avg. Pages per Extent..................: 7.9
> - Scan Density [Best Count:Actual Count]......: 89.59% [1188:1326]
> - Logical Scan Fragmentation ..............: 0.88%
> - Extent Scan Fragmentation ...............: 38.43%
> - Avg. Bytes Free per Page................: 851.5
> - Avg. Page Density (full)................: 89.48%
> DBCC SHOWCONTIG scanning 'Faxes' table...
> Table: 'Faxes' (1893581784); index ID: 7, database ID: 5
> LEAF level scan performed.
> - Pages Scanned........................: 7911
> - Extents Scanned.......................: 999
> - Extent Switches.......................: 1088
> - Avg. Pages per Extent..................: 7.9
> - Scan Density [Best Count:Actual Count]......: 90.82% [989:1089]
> - Logical Scan Fragmentation ..............: 0.70%
> - Extent Scan Fragmentation ...............: 60.26%
> - Avg. Bytes Free per Page................: 856.8
> - Avg. Page Density (full)................: 89.41%
> DBCC SHOWCONTIG scanning 'Faxes' table...
> Table: 'Faxes' (1893581784); index ID: 8, database ID: 5
> LEAF level scan performed.
> - Pages Scanned........................: 8900
> - Extents Scanned.......................: 1124
> - Extent Switches.......................: 1249
> - Avg. Pages per Extent..................: 7.9
> - Scan Density [Best Count:Actual Count]......: 89.04% [1113:1250]
> - Logical Scan Fragmentation ..............: 0.79%
> - Extent Scan Fragmentation ...............: 58.19%
> - Avg. Bytes Free per Page................: 836.1
> - Avg. Page Density (full)................: 89.67%
> DBCC execution completed. If DBCC printed error messages, contact your
> system administrator.
> "Tibor Karaszi" wrote:
>|||No. I have a primary file group with one file and an index file group with
one file.
"Andrew J. Kelly" wrote:

> Your Logical fragmentation is fine and is what you should be concerned wit
h.
> I suspect you have more than 1 file in that filegroup and that is what is
> causing the higher numbers of Physical Fragmentation. Is that true? What
> does sp_helpdb 'yourDB' show? By the way do you really need 8 indexes on
a
> Fax table?
> --
> Andrew J. Kelly SQL MVP
>
> "Andre" <Andre@.discussions.microsoft.com> wrote in message
> news:A8CFC75C-77C5-4A61-857F-DA43BA4FC451@.microsoft.com...
>
>|||I just realized you are using INDEXDEFRAG. Have you tried using DBCC
DBREINDEX instead? In either case I wouldn't worry too much about it and
concentrate on the logical fragmentation instead.
Andrew J. Kelly SQL MVP
"Andre" <Andre@.discussions.microsoft.com> wrote in message
news:578E75D1-9A3B-434C-8166-4871D498FB91@.microsoft.com...
> No. I have a primary file group with one file and an index file group
> with
> one file.
> "Andrew J. Kelly" wrote:
>

reasons for allocation/consistency errors

What are the reasons for why me may see allocation or consistency errors
when we run DBCC CHECKDB ? Using SQL 2000.
Basically looking for all possible causes
That is kind of a big question, and is probably why no one answers... None
of us have a list of all of the reasons...
In my experience, if you run your DBCC without going to read only or single
user mode, and others are using the system for insert, update, delete during
the dbcc, you will probably get some errors. These are probably due to
changes made by the other users... If you get such an error, rerun dbcc on
the table in question... if the error disappears, or moves to another page,
consider it a transient error and ignore it... If the same error occurs on
the same page, it is a hard error and work to fix it..
Otherwise the most common reasons for DBCC errors is hardware failures.
These can include memory chip failures, disk controllers, and disk drives...
Often re-occuring dbcc errors are the first warning you will get regarding
an impending hardware failure...
Software bugs in the OS and SQL can also cause corruptions, but this occurs
less frequently.
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:unQs66aIEHA.2688@.tk2msftngp13.phx.gbl...
> What are the reasons for why me may see allocation or consistency errors
> when we run DBCC CHECKDB ? Using SQL 2000.
> Basically looking for all possible causes
>
>

reasons for allocation/consistency errors

What are the reasons for why me may see allocation or consistency errors
when we run DBCC CHECKDB ? Using SQL 2000.
Basically looking for all possible causesThat is kind of a big question, and is probably why no one answers... None
of us have a list of all of the reasons...
In my experience, if you run your DBCC without going to read only or single
user mode, and others are using the system for insert, update, delete during
the dbcc, you will probably get some errors. These are probably due to
changes made by the other users... If you get such an error, rerun dbcc on
the table in question... if the error disappears, or moves to another page,
consider it a transient error and ignore it... If the same error occurs on
the same page, it is a hard error and work to fix it..
Otherwise the most common reasons for DBCC errors is hardware failures.
These can include memory chip failures, disk controllers, and disk drives...
Often re-occuring dbcc errors are the first warning you will get regarding
an impending hardware failure...
Software bugs in the OS and SQL can also cause corruptions, but this occurs
less frequently.
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:unQs66aIEHA.2688@.tk2msftngp13.phx.gbl...
> What are the reasons for why me may see allocation or consistency errors
> when we run DBCC CHECKDB ? Using SQL 2000.
> Basically looking for all possible causes
>
>

reasons for allocation/consistency errors

What are the reasons for why me may see allocation or consistency errors
when we run DBCC CHECKDB ? Using SQL 2000.
Basically looking for all possible causesThat is kind of a big question, and is probably why no one answers... None
of us have a list of all of the reasons...
In my experience, if you run your DBCC without going to read only or single
user mode, and others are using the system for insert, update, delete during
the dbcc, you will probably get some errors. These are probably due to
changes made by the other users... If you get such an error, rerun dbcc on
the table in question... if the error disappears, or moves to another page,
consider it a transient error and ignore it... If the same error occurs on
the same page, it is a hard error and work to fix it..
Otherwise the most common reasons for DBCC errors is hardware failures.
These can include memory chip failures, disk controllers, and disk drives...
Often re-occuring dbcc errors are the first warning you will get regarding
an impending hardware failure...
Software bugs in the OS and SQL can also cause corruptions, but this occurs
less frequently.
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:unQs66aIEHA.2688@.tk2msftngp13.phx.gbl...
> What are the reasons for why me may see allocation or consistency errors
> when we run DBCC CHECKDB ? Using SQL 2000.
> Basically looking for all possible causes
>
>