30
SharePoint Admins: The Reluctant DBAs

SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

SharePoint Admins:The Reluctant DBAs

Page 2: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Who is this Todd guy?

• SharePoint MVP since 2006

• Speaker, writer, consultant, Aquarius

• Personal Blogwww.toddklindt.com/blog

• Company web sitewww.sharepoint911.com

[email protected]

• Twitter me! @toddklindt

• Netcast

• http://www.toddklindt.com/netcast

Page 3: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

My next book

http://www.toddklindt.com/prosp20

13admin

Page 4: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Agenda

• Why is SQL so important to SharePoint?

• SQL versions

• SQL terminology

• Proper care and feeding of your SQL server and database

• Slides at http://www.toddklindt.com/slospug

Page 5: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SQL is hard, let’s go shopping

• Used by every version of SharePoint since WSS v2

• Entire Farm configuration is stored in SQL

• All content is stored or is referenced to in SQL

• Central Admin is a web application rendered out of SQL

• Most service applications have databases as well• Search has at least 4

• User Profile has 3

• Managed Metadata

• Secure Store

• BCS

• If SQL ain’t happy, nobody’s happy

Page 6: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

A Few Words about Content Databases

• Each Web Application has at least one content database

• Most will have multiple content databases

• A Site Collection must exist entirely in one content database*

• However, a content database can, and usually does, contain multiple site collections

• A content database should not be larger than 200 GB• Can go larger for specialized databases

• Be very, very careful

Page 7: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Worlds Greatest Slide

ItemsFiles, Calendar items, Contacts, Customers, Images, Custom

ListsDoc Libs, Pages, Events, Discussions, Surveys, Etc

Webs – SPWebPortal, Wikis, Blogs, Team, Doc, Workspaces, Search Center

Site Collections – SPSiteThe Bag

Databases – SPContentDatabaseContent Database

Web Applications – SPWebApplicationCentral Admin, Content

Servers - SPServerWeb Front End, APP

Farm – SPFarm

Page 8: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Which version of SQL?

• SQL 2008 R2 SP1

• SQL 2012

• Must be 64 bit

• Can use SQL Express for no cost option• 10 GB database limit

• 1 GB of RAM

• 1 CPU up to 4 cores

• Hardware and software requirements

• http://technet.microsoft.com/en-us/library/cc262485(v=office.15).aspx

Page 9: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SQL 2012 Edition ComparisonStandard Enterprise

CPUs (sockets) 4 (or 16 cores) OS Max

Memory 64 GB OS Max

Max Database Size 524 PB 524 PB

Mirroring Single threaded, Full Safety Full

Clustering 2 nodes OS Max

Database Snapshots X

PowerPivot X

AlwaysOn Availability Groups X

Reporting Services X X

Walks your dog X

Bucks $ $$$$$

Page 10: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SQL Terminology

• Server – Physical box. Something you can kick. Also often erroneously used in place of Instance

• Instance – SQL process on a server. Has its own settings, databases and security. A server can have many Instances

• Database – An MDF file and one or more NDF files. Where the data is actually stored.

• Transaction Log - An LDF file. Used to store transactions before they’re written to a database

• File – MDF, NDF or LDF files that store information.

• Filegroup – A file or group of files that store a partition of a database.

• Role – SQL security boundary. Roles have permissions, users and logins go into Roles to get permissions.

Page 11: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Let’s talk about Transaction Logs

User’s Desktop SharePoint Server SQL Server RAM Transaction log Database File

Page 12: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Care and feeding of SQL

• Maintenance Plans are key• Can be easily created manually or with a wizard

• Easily modified after they’re created

• Can include a variety of operations, including backups

• http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=248

• Can email you

• Must create yourself as an operator

• What should you use them for?

Page 13: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Check Database Integrity

• Corrupt data backs up every bit as well as uncorrupt data

• Uses T-SQL command DBCC checkdb

• Can be very disk and CPU intensive

• Can use PHYSICAL_ONLY switch to shorten time and impact

• Can run against non-live copies of your databases

• http://msdn.microsoft.com/en-us/library/ms176064.aspx

Page 14: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Backups

• Three types

• Full

• Partial

• Differential

• Can back up database and transaction logs

• Regular transaction log backups keep your hard drives happy

• Use backup compression to save space and time

• Don’t forget third party solutions

• RBS complicates this

• A lot!

• Really!

Page 15: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

File System Fragmentation

• Fragmented MDF, NDF and LDF files slow SQL down

• Using the built-in tool may lock databases

• 3rd party tools are a better option

• Pregrow databases to minimize fragmentation

Page 16: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Size your databases wisely

• Databases get larger over time, it’s their job

• SQL grow operations are slow and will likely result in fragmented databases

• Your database should always have white space. Always

• Monitor your databases and pregrow them to maintain whitespace

• Change autogrow settings to something more reasonable

• Autogrow is a last resort

• Consider setting a maximum database size

Page 17: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Don’t shrink databases, dummy

• Database size is reduced by dropping unused space.

• Do not shrink databases unless something drastic has happened

• Massive web, site collection, or content deletions

• Abandoning databases

• You lost a bet

• Forces databases to grow again later

• Has a heavy impact on the server

• Fragments database indexes, which results in slower performance

Page 18: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

What about RBS?

• Storage of blobs outside of SQL

• Bolts in to SharePoint 2013

• Increase scale

• Increase performance

• Complicates disaster recovery

• Repeat after me, “I will not use the SQL Filestream provider in Production.”

Page 19: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Some SQL Best Practices

• Create multiple TempDB files

• Put databases and transaction logs on separate spindles

• Arrange databases according to speed of drives

• Change Autogrow

• Increase the growth rate

• For databases and logs

• Consider setting a maximum size

• Keep your databases under 200 GB, realistically 50 GB

• Use multiple content databases

Page 20: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

More good ideas

• Do not access your databases in SQL

• pretend they don’t exist

• Here’s what’s supported

• http://support.microsoft.com/kb/841057

• Farm backups in SharePoint also do database backups

• Backup your System databases too

• Install SQL Server Management Studio on one of your SharePoint servers

• Or use Query Express

• http://www.albahari.com/queryexpress.aspx

Page 21: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SQL Instance settings

• Set Max RAM

Page 22: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

• Compression

• File Location

Page 23: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

• Set MaxDOP = 1

Page 24: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Shenanigans

Page 25: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

More Shenanigans

Page 26: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

SQL Alias

• Like a HOSTS file for SQL connections

• Allows us to move SharePoint to a different SQL without SharePoint knowing

• Use CLICONFG.EXE to config

• Must configure for 64 and 32 bit

• Definitive work on the subject, http://www.toddklindt.com/sqlalias

Page 27: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Fun links

• SharePoint 2013 Hardware and Software requirements• http://technet.microsoft.com/en-us/library/cc262485.aspx

• Tips for database maintenance• http://technet.microsoft.com/en-

us/magazine/2008.08.database.aspx

• Plan for RBS in SharePoint 2013• http://technet.microsoft.com/en-us/library/ff628583.aspx

• Storage and SQL Server capacity planning • Not updated yet for SharePoint 2013

• http://technet.microsoft.com/en-us/library/cc298801.aspx

Page 28: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

Questions?

Page 29: SharePoint Admins: The Reluctant DBAs - Todd Klindt for... · 2013-04-16 · SQL is hard, let’s go shopping •Used by every version of SharePoint since WSS v2 •Entire Farm configuration

RACKSPACE® HOSTING | WWW.RACKSPACE.COM

http://www.Rackspace.com/sharepoint

Free 45 day trial of SharePoint 2013

http://www.Rackspace.com/hosting-solution/Rackspace-sharepoint.php