sql best practices for sharepoint admins, the … - sql...full sql 2005 functionality supports more...

22
SQL Best Practices for SharePoint admins, the reluctant DBA ITP324 Todd Klindt

Upload: others

Post on 02-Jun-2020

18 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SQL Best Practices for SharePoint admins, the … - SQL...Full SQL 2005 functionality Supports more than 4 CPUs Support for up to 32 GB of RAM on 32 bit OS, OS limitation, not SQL’s

SQL Best Practices for SharePoint

admins, the reluctant DBA

ITP324

Todd Klindt

Page 2: SQL Best Practices for SharePoint admins, the … - SQL...Full SQL 2005 functionality Supports more than 4 CPUs Support for up to 32 GB of RAM on 32 bit OS, OS limitation, not SQL’s

Todd Klindt, MVP

Solanite Consulting, Inc.

http://www.solanite.com

http://www.toddklindt.com/blog

[email protected]

Author, Inside SharePoint 2007

Administration and Real World SharePoint

2007. Speaker at many conferences

Page 3: SQL Best Practices for SharePoint admins, the … - SQL...Full SQL 2005 functionality Supports more than 4 CPUs Support for up to 32 GB of RAM on 32 bit OS, OS limitation, not SQL’s

Session Agenda

Overview of how SharePoint uses SQL

Overview of SQL versions and which you

would use for what

Care and feeding Best Practices for your

SQL server

A couple of cool SQL 2008 features to

consider

Page 4: SQL Best Practices for SharePoint admins, the … - SQL...Full SQL 2005 functionality Supports more than 4 CPUs Support for up to 32 GB of RAM on 32 bit OS, OS limitation, not SQL’s

SQL? I’m a SharePoint admin!

WSS & MOSS

Farm configuration is stored in SQL.

All SharePoint content is stored in SQL.

No exceptions! *

Central Admin is a site collection and is in

its own content database

Search gets its own database• * Except one.

Page 5: SQL Best Practices for SharePoint admins, the … - SQL...Full SQL 2005 functionality Supports more than 4 CPUs Support for up to 32 GB of RAM on 32 bit OS, OS limitation, not SQL’s

Content Databases

A farm may have multiple Content

Databases

A Site Collection must exist completely in

a single Content Database

A Content Database may have multiple

Site Collections

Multiple SSP databases

Page 6: SQL Best Practices for SharePoint admins, the … - SQL...Full SQL 2005 functionality Supports more than 4 CPUs Support for up to 32 GB of RAM on 32 bit OS, OS limitation, not SQL’s

Which version of SQL?

SQL 2005 or 2008

64 bit

SQL 2000

32 bit

Basic Install

Page 7: SQL Best Practices for SharePoint admins, the … - SQL...Full SQL 2005 functionality Supports more than 4 CPUs Support for up to 32 GB of RAM on 32 bit OS, OS limitation, not SQL’s

Standard or Enterprise?

Standard features

Supports up to 4 CPUs (including cores)

Supports OS Maximum RAM, 4 GB of RAM

on 32 bit OS

Failover is manual and restricted to two

nodes

Supports Database Mirroring

Native 64 bit support

Page 8: SQL Best Practices for SharePoint admins, the … - SQL...Full SQL 2005 functionality Supports more than 4 CPUs Support for up to 32 GB of RAM on 32 bit OS, OS limitation, not SQL’s

Movin’ on up.

Full SQL 2005 functionality

Supports more than 4 CPUs

Support for up to 32 GB of RAM on 32 bit

OS, OS limitation, not SQL’s

Active failover for mirrors

KPI and Analysis Server built in

Comparison chart of all the versions at

http://www.microsoft.com/sql/prodinfo/feature

s/compare-features.mspx

Page 9: SQL Best Practices for SharePoint admins, the … - SQL...Full SQL 2005 functionality Supports more than 4 CPUs Support for up to 32 GB of RAM on 32 bit OS, OS limitation, not SQL’s

Keep your SQL server happy

Maintenance Plans

Can be created manually or with a wizard

Easily modified with a graphical interface

Can include a variety of operations, including

backups

Can use SMTP to email plan success

Page 10: SQL Best Practices for SharePoint admins, the … - SQL...Full SQL 2005 functionality Supports more than 4 CPUs Support for up to 32 GB of RAM on 32 bit OS, OS limitation, not SQL’s

What should I do in these?

Check Database Integrity

Reindex or Rebuild database Indexes

Update Statistics

Backups

Defrag the file system

Page 11: SQL Best Practices for SharePoint admins, the … - SQL...Full SQL 2005 functionality Supports more than 4 CPUs Support for up to 32 GB of RAM on 32 bit OS, OS limitation, not SQL’s

Things you should do

Check Database Integrity

Verifies integrity of databases

Uses T-SQL command DBCC checkdb

Very disk and CPU intensive

Page 12: SQL Best Practices for SharePoint admins, the … - SQL...Full SQL 2005 functionality Supports more than 4 CPUs Support for up to 32 GB of RAM on 32 bit OS, OS limitation, not SQL’s

Statistics

Update Statistics

Statistics help the DB engine decide the

most optimal execution path

Updating these statistics improves the

efficiency of queries

You might trigger it manually if there were a

lot of records added or deleted

Happens automatically, you should not have

to run manually

Page 13: SQL Best Practices for SharePoint admins, the … - SQL...Full SQL 2005 functionality Supports more than 4 CPUs Support for up to 32 GB of RAM on 32 bit OS, OS limitation, not SQL’s

Indexes

Reindex databases

Defragments database indexes

Rebuild Index

Completely recreates the database index

Not needed as often

Shrinking databases fragments your indexes

and your data.

Page 14: SQL Best Practices for SharePoint admins, the … - SQL...Full SQL 2005 functionality Supports more than 4 CPUs Support for up to 32 GB of RAM on 32 bit OS, OS limitation, not SQL’s

Backups

Can be part of maintenance plan.

Three types

Full

Partial

Differential

Transaction logs

Page 15: SQL Best Practices for SharePoint admins, the … - SQL...Full SQL 2005 functionality Supports more than 4 CPUs Support for up to 32 GB of RAM on 32 bit OS, OS limitation, not SQL’s

More Backup best practices

Can use built in software or third party.

Idera and Quest software allow for database

compression and encryption.

Results in smaller backups

Could also result in faster backups, if drive

speed is the bottleneck

SQL 2008 Enterprise support

compression and encryption out of the

box

Page 16: SQL Best Practices for SharePoint admins, the … - SQL...Full SQL 2005 functionality Supports more than 4 CPUs Support for up to 32 GB of RAM on 32 bit OS, OS limitation, not SQL’s

File system fragmentation

SQL will be faster if the database files are

contiguous in the file system

Using the built in defrag tool will have

performance ramifications

Consider using something like Diskeeper

and its intelligent defrag.

Consider stopping SQL if possible

Page 17: SQL Best Practices for SharePoint admins, the … - SQL...Full SQL 2005 functionality Supports more than 4 CPUs Support for up to 32 GB of RAM on 32 bit OS, OS limitation, not SQL’s

Drink me

Database size is reduced by dropping

unused space.

Do not shrink databases unless

something drastic has happened

Massive site or content deletions

Removing site collections from v2 databases

Abandoning databases

Has a heavy impact on the server

Page 18: SQL Best Practices for SharePoint admins, the … - SQL...Full SQL 2005 functionality Supports more than 4 CPUs Support for up to 32 GB of RAM on 32 bit OS, OS limitation, not SQL’s

Eat me

Databases grow, it is what they do

Grow operations are slow in SQL and will

likely result in a fragmented database file

Create database with enough space for

one year’s worth of growth

Page 19: SQL Best Practices for SharePoint admins, the … - SQL...Full SQL 2005 functionality Supports more than 4 CPUs Support for up to 32 GB of RAM on 32 bit OS, OS limitation, not SQL’s

Database Best Practices

Create multiple TempDB files

Put database and corresponding

transaction logs on different spindles

Arrange databases according to speed

Use autogrow sparingly

Keep your databases under 100 GB

Use multiple content databases

Page 20: SQL Best Practices for SharePoint admins, the … - SQL...Full SQL 2005 functionality Supports more than 4 CPUs Support for up to 32 GB of RAM on 32 bit OS, OS limitation, not SQL’s

More points to ponder

Do not alter databases. Microsoft HATES

that

If using SQL 2005, install SP2

Can use SharePoint farm backups to

back up SQL

Don’t forget your System databases

SharePoint SP1 supports SQL 2008

Page 21: SQL Best Practices for SharePoint admins, the … - SQL...Full SQL 2005 functionality Supports more than 4 CPUs Support for up to 32 GB of RAM on 32 bit OS, OS limitation, not SQL’s

A LITTLE NOODLING AROUND

IN SQL

Here we’ll look at some of the things we’ve covered

Page 22: SQL Best Practices for SharePoint admins, the … - SQL...Full SQL 2005 functionality Supports more than 4 CPUs Support for up to 32 GB of RAM on 32 bit OS, OS limitation, not SQL’s

Thank you for attending!

(This slide must always be the last

slide in your deck)

Please be sure to fill out your

session evaluation!