<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>SQL Server Planet &#187; Maintenance</title> <atom:link href="http://sqlserverplanet.com/category/maintenance/feed/" rel="self" type="application/rss+xml" /><link>http://sqlserverplanet.com</link> <description>Tips and Articles on SQL Server</description> <lastBuildDate>Wed, 07 Jul 2010 05:16:42 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0</generator> <item><title>Rebuild and Reorganize Fragmented Indexes</title><link>http://sqlserverplanet.com/scripts/rebuild-and-reorganize-fragmented-indexes/</link> <comments>http://sqlserverplanet.com/scripts/rebuild-and-reorganize-fragmented-indexes/#comments</comments> <pubDate>Sun, 21 Jun 2009 01:05:43 +0000</pubDate> <dc:creator>Derek Dieter</dc:creator> <category><![CDATA[Indexing]]></category> <category><![CDATA[Maintenance]]></category> <category><![CDATA[Scripts]]></category> <category><![CDATA[index]]></category><guid isPermaLink="false">http://sqlserverplanet.com/?p=329</guid> <description><![CDATA[This script will automatically determine whether a rebuild or a reorganize should be used according to the fragmentation of the index. It will then execute the appropriate command. Note that performing index rebuilds online during production hours will cause contention. SET NOCOUNT ON; DECLARE @objectid int; DECLARE @indexid int; DECLARE @partitioncount bigint; DECLARE @schemaname nvarchar(258); [...]]]></description> <wfw:commentRss>http://sqlserverplanet.com/scripts/rebuild-and-reorganize-fragmented-indexes/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>How to Update Statistics</title><link>http://sqlserverplanet.com/scripts/update-statistics/</link> <comments>http://sqlserverplanet.com/scripts/update-statistics/#comments</comments> <pubDate>Sun, 21 Jun 2009 00:20:31 +0000</pubDate> <dc:creator>Derek Dieter</dc:creator> <category><![CDATA[Maintenance]]></category> <category><![CDATA[Scripts]]></category> <category><![CDATA[update statistics]]></category><guid isPermaLink="false">http://sqlserverplanet.com/?p=316</guid> <description><![CDATA[There are two ways to update statistics. The first way is the easy way. It is one line of code that will update all the statistics in the database using the default sample size of 20,000 rows per table. EXEC sp_updatestats The other way, is to use the UPDATE STATISTICS command. This command gives much [...]]]></description> <wfw:commentRss>http://sqlserverplanet.com/scripts/update-statistics/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Query Which Tables are Partitioned</title><link>http://sqlserverplanet.com/maintenance/query-which-tables-are-partitioned/</link> <comments>http://sqlserverplanet.com/maintenance/query-which-tables-are-partitioned/#comments</comments> <pubDate>Sat, 20 Jun 2009 03:12:26 +0000</pubDate> <dc:creator>Derek Dieter</dc:creator> <category><![CDATA[Maintenance]]></category> <category><![CDATA[partitioning]]></category><guid isPermaLink="false">http://sqlserverplanet.com/?p=299</guid> <description><![CDATA[List out which tables are partitioned, and what partition scheme and partition function they use: select t.name as TableName, ps.name as PartitionScheme, ps.data_space_id, pf.name as PartitionFunction, pf.function_id from sys.tables t join sys.indexes i on t.object_id = i.object_id join sys.partition_schemes ps on i.data_space_id = ps.data_space_id join sys.partition_functions pf on ps.function_id = pf.function_id where i.index_id &#38;lt; 2 [...]]]></description> <wfw:commentRss>http://sqlserverplanet.com/maintenance/query-which-tables-are-partitioned/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Reindex All Tables in a Database</title><link>http://sqlserverplanet.com/scripts/reindex-all-tables-in-a-database/</link> <comments>http://sqlserverplanet.com/scripts/reindex-all-tables-in-a-database/#comments</comments> <pubDate>Thu, 18 Jun 2009 04:13:05 +0000</pubDate> <dc:creator>Derek Dieter</dc:creator> <category><![CDATA[Indexing]]></category> <category><![CDATA[Maintenance]]></category> <category><![CDATA[SQL Server]]></category> <category><![CDATA[Scripts]]></category> <category><![CDATA[index]]></category><guid isPermaLink="false">http://sqlserverplanet.com/?p=232</guid> <description><![CDATA[Code for reindexing all tables in a database using dbreindex]]></description> <wfw:commentRss>http://sqlserverplanet.com/scripts/reindex-all-tables-in-a-database/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Find Table Fragmentation</title><link>http://sqlserverplanet.com/dmv-queries/find-table-fragmentation/</link> <comments>http://sqlserverplanet.com/dmv-queries/find-table-fragmentation/#comments</comments> <pubDate>Mon, 01 Jun 2009 06:18:06 +0000</pubDate> <dc:creator>Derek Dieter</dc:creator> <category><![CDATA[DMV Queries]]></category> <category><![CDATA[Maintenance]]></category><guid isPermaLink="false">http://sqlserverplanet.com/?p=65</guid> <description><![CDATA[DECLARE @Database VARCHAR(255) DECLARE @TableName VARCHAR(255) DECLARE @IndexName VARCHAR(255) SET @Database = 'SQLServerPlanet' SET @TableName = 'Users' SET @IndexName = NULL SELECT avg_fragmentation_in_percent ,page_count FROM sys.dm_db_index_physical_stats ( DB_ID(@Database) ,OBJECT_ID(@TableName) ,OBJECT_ID(@IndexName) ,NULL ,NULL ) Or you can still do it the old fashioned way. Just substitute the name of the table or index below. It should [...]]]></description> <wfw:commentRss>http://sqlserverplanet.com/dmv-queries/find-table-fragmentation/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 54/62 queries in 0.106 seconds using disk
Content Delivery Network via files.sqlserverplanet.com

Served from: sqlserverplanet.com @ 2010-07-31 09:08:33 -->