sharepoint 2010 database maintenance
DESCRIPTION
Presentation which accompanies the article at http://www.sharepointproconnections.com/article/microsoft-products/Database-Maintenance-for-SharePoint-.aspxTRANSCRIPT
SharePoint 2010 Database Maintenance
Matt Ranlett
Senior Technology Architect
@mranlett
facebook.com/mranlett
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!
AGENDA
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?
DATABASES
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
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
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
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
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
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
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)
DATA INTEGRITY
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
SPEED
Right-sizing Hardware
• 64 bit hardware and software• 16 GB memory• Numerous distinct spindles• Buckets of storage capacity
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
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
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.
DATA SIZING
How much space do you need?
• Database size = ((# Documents × # Versions) × Avg Size) + (10 KB ×(# List items + (# Versions × # Documents)))
Adjust the fill factor
• Database pages as phone book pages– Fill factor == blank space on each page– Reduce fragmentation– Increase disk storage requirements
Shrink databases
SOLUTION AUTOMATION
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
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.
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.
QUESTIONS
Matt Ranlett
@mranlett
facebook.com/mranlett
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