29
SharePoint 2010 Database Maintenance Matt Ranlett Senior Technology Architect @mranlett facebook.com/mranlett

SharePoint 2010 database maintenance

Embed Size (px)

DESCRIPTION

Presentation which accompanies the article at http://www.sharepointproconnections.com/article/microsoft-products/Database-Maintenance-for-SharePoint-.aspx

Citation preview

Page 1: SharePoint 2010 database maintenance

SharePoint 2010 Database Maintenance

Matt Ranlett

Senior Technology Architect

@mranlett

facebook.com/mranlett

Page 2: SharePoint 2010 database maintenance

Speaker Bio

Matt RanlettSlalom Senior Technology Architect

Experience:• 5-Year SharePoint Server Microsoft MVP• MCAD and MCTS (2007 & 2010) Certified• Co-founder, Atlanta Dot Net Regular Guys www.devcow.com

• Past Vice President of Technology, INETA• Author and editor of books and magazines

@mranlett

facebook.com/mranlett

I’ve lost 75 pounds since

this photo was taken!

Page 3: SharePoint 2010 database maintenance

AGENDA

Page 4: SharePoint 2010 database maintenance

Database Maintenance for SharePoint Server• What are the databases involved?• How do I ensure data integrity?• What does it take to keep things as speedy as

possible?• How can I impact database storage size and

cost?• Can these maintenance tasks be automated?

Page 5: SharePoint 2010 database maintenance

DATABASES

Page 6: SharePoint 2010 database maintenance

Supported Versions of SQL ServerSharePoint Server 2010 Functionality

SQL Server 2008 R2 Enterprise

SQL Server 2008 R2 Standard

SQL Server 2008 R2 Express

SQL Server 2008 Enterprise

SQL Server 2008 Standard

SQL Server 2008 Express

SQL Server 2005 Enterprise

SQL Server 2005 Standard

SharePoint Server 2010

64-bit only 64-bit only 64-bit only 64-bit only Service Pack (SP) 1, Cumulative Update

(CU) 2 required, CU5 or later

recommended

64-bit only SP1, CU2

required, CU5 or later

recommended

64-bit only 64-bit only SP3 CU3 required

64-bit only SP3 CU3 required

Remote BLOB storage (RBS) on a non-local deviceRequires RBS add-in from the SQL Server 2008 R2 Feature Pack.

 X

     X

       

RBS on a local device.Requires RBS add-in from the SQL Server 2008 R2 Feature Pack.

 X

 X

 X

 X

 X

 X

   

Backup compression  X

 X

   X

       

Data compression for the Search Crawl and Property databases

 X

     X

       

Table partitioning for Web Analytics Reporting databases

 X

     X

       

Transparent data encryption

 X

     X

       

Resource governor  X

     X

       

Database auditing  X

     X

       

Clustered database server

 X

(faster recovery)

 X

2 nodes only

   X

(faster recovery)

 X

2 nodes only

   X

(faster recovery)

 X

2 nodes only

Table taken from Microsoft whitepaper:SQL Server 2008 R2 and SharePoint 2010: Better Together whitepaper - http://technet.microsoft.com/en-us/library/cc990273.aspx

Page 7: SharePoint 2010 database maintenance

SharePoint 2010 Foundations Databases

Name Size and Growth

Read/Write Characteristics

Scaling Method

Recovery Model

Backup mechanisms

Mirror within farm

Mirror / log ship to another farm

SharePoint_AdminContent_GUID

Small Varies can only scale up - one DB per farm

Full SharePoint backup, SQL Server, DPM

Yes No

SharePoint_Config

Small with large log files

read-intensive

can only scale up - one DB per farm

Full SharePoint backup, SQL Server, DPM

Yes No

Configuration Databases

Page 8: SharePoint 2010 database maintenance

SharePoint 2010 Foundations Databases

Name Size and Growth

Read/Write Characteristics

Scaling Method

Recovery Model

Backup mechanisms

Mirror within farm

Mirror / log ship to another farm

WSS_Content Recommended to limit size to < 200Gb*

up to 1 TB supported in some scenarios

Varies Can scale up or split additional site collections to new databases

Full SharePoint backup, SQL Server, DPM

Yes Yes

Content Databases

Page 9: SharePoint 2010 database maintenance

SharePoint 2010 Foundations Databases

Name Size and Growth

Read/Write Characteristics

Scaling Method

Recovery Model

Backup mechanisms

Mirror within farm

Mirror / log ship to another farm

WSS_UsageApplication

Extra large write-intensive

can only scale up - one DB per farm

Simple SharePoint backup, SQL Server, DPM

Yes but why bother

Yes but why bother

WSS_Logging

Health Databases

Page 10: SharePoint 2010 database maintenance

SharePoint 2010 Foundations Databases

Name Size and Growth

Read/Write Characteristics

Scaling Method

Recovery Model

Backup mechanisms

Mirror within farm

Mirror / log ship to another farm

Application_Registry_Service_DB_GUID

Small read-intensive can only scale up - one DB per farm

Full SharePoint backup, SQL Server, DPM

Yes No

Bdc_Service_DB_GUID

Small read-intensive can only scale up - one DB per farm

Full SharePoint backup, SQL Server, DPM

Yes No

Application Databases

Page 11: SharePoint 2010 database maintenance

SharePoint Server 2010 Databases

• Managed Metadata Service_GUID • PerformancePoint Service Application_GUID • Search_Service_Application_CrawlStoreDB_GUID • Search_Service_Application_DB • Search_Service_Application_PropertyStoreDB_GUID • Secure_Store_Service_DB_GUID • StateService_GUID • User Profile Service Application_ProfileDB_GUID • User Profile Service Application_SocialDB_GUID • User Profile Service Application_SyncDB_GUID • WebAnalyticsServiceApplication_ReportingDB_GUID • WebAnalyticsServiceApplication_StagingDB_GUID • WordAutomationServices_GUID

Page 12: SharePoint 2010 database maintenance

Auto-provision or DBA provision

• When to DBA provision– guaranteed control over database names (no GUIDs in the DB

names)– guaranteed control over database sizing– procedural separation of control over application and data

environments• How to DBA provision

– PowerShell

New-SPConfigurationDatabase -DatabaseName "SharePointConfigDB1" -DatabaseServer "SQL-01" -Passphrase (ConvertTo-SecureString "MyPassword" -AsPlainText -force) -FarmCredentials (Get-Credential)

Page 13: SharePoint 2010 database maintenance

DATA INTEGRITY

Page 14: SharePoint 2010 database maintenance

DB Corruption

• Physical corruption– Tends to be caused by I/O subsystem hardware

• Logical corruption– Caused by application and user errors

• DBCC_CHECKDB– The role of backups

Page 15: SharePoint 2010 database maintenance

SPEED

Page 16: SharePoint 2010 database maintenance

Right-sizing Hardware

• 64 bit hardware and software• 16 GB memory• Numerous distinct spindles• Buckets of storage capacity

Page 17: SharePoint 2010 database maintenance

Managing database files

• Separate your log and data files to different spindles– Don’t put ANYTHING else on these spindles

• Pre-create database and log files of the appropriate size– Reduces auto-grow needs– Correctly configure auto-grow anyways!– Turn ON instant file initialization

• Grant the SQL service account  Perform Volume Maintenance  permission

Page 18: SharePoint 2010 database maintenance

Data Fragmentation

• Data stored in database pages– Header, record data, index, free space– Clustered and non-clustered indexes– GUID-based keys

• Fragmentation through normal data manipulation– Seen as growing free space and slowing performance

• Intelligently rebuild only the indexes which need it– DMV sys.dm_db_index_physical_stats

Page 19: SharePoint 2010 database maintenance

Statistics

• Queries run on execution plans• Execution plans are automatically create based on statistics• Statistics *can* get out of synch

• Remediation steps– Analyze indexes and determine which indexes to operate on and

how to do the fragmentation removal.– For all indexes that were not rebuilt, update the statistics.– Update statistics for all of the non-indexed columns.

Page 20: SharePoint 2010 database maintenance

DATA SIZING

Page 21: SharePoint 2010 database maintenance

How much space do you need?

• Database size = ((# Documents × # Versions) × Avg Size) + (10 KB ×(# List items + (# Versions × # Documents)))

Page 22: SharePoint 2010 database maintenance

Adjust the fill factor

• Database pages as phone book pages– Fill factor == blank space on each page– Reduce fragmentation– Increase disk storage requirements

Page 23: SharePoint 2010 database maintenance

Shrink databases

Page 24: SharePoint 2010 database maintenance

SOLUTION AUTOMATION

Page 25: SharePoint 2010 database maintenance

Remote Blob Storage

• Store big files outside of the database– Databases > 500 GB– BLOB files > 256 KB– Not good for write-intensive sites

• Partner implementations– AvePoint– Quest

Page 26: SharePoint 2010 database maintenance

Database Maintenance Plans pt. 1

• Remove excessive transaction log file fragmentation by ensuring the appropriate recovery model and backup schedule

• Turn off any scheduled shrink operations to reduce the risk of unnecessary index fragmentation.

• Set auto-growth correctly - by a pre-determined set file size rather than a percentage.  Follow this up by periodically examining database sizes and determining if manual database growth is necessary to ensure optimum performance.

• Turn on instant file initialization such that a database auto-growth is an instantaneous operation rather than a slow operation which requires zero-filling new space.

Page 27: SharePoint 2010 database maintenance

Database Maintenance Plans pt. 2

• Put a regular process in place to detect and remove index fragmentation.

• Turn on AUTO_CREATE_STATISTICS and AUTO_UPDATE_STATISTICS, plus have a regular process in place to update statistics.

• Turn on page checksums• Have a regular process to run DBCC CHECKDB.

Page 28: SharePoint 2010 database maintenance

QUESTIONS

Page 29: SharePoint 2010 database maintenance

Matt Ranlett

@mranlett

facebook.com/mranlett

[email protected]

www.devcow.com

Check out the SharePoint Pro Connections magazine article this presentation is based on:

http://www.sharepointproconnections.com/article/microsoft-products/Database-Maintenance-for-SharePoint-.aspx