SQL Server Storage: The Terabyte Level. Brent Ozar, Microsoft Certified Master, MVP Consultant & Trainer, SQLskills.com



Similar documents
Database Maintenance Essentials

50238: Introduction to SQL Server 2008 Administration

Implementing a Microsoft SQL Server 2005 Database

Redundancy Options. Presented By: Chris Williams

6231A - Maintaining a Microsoft SQL Server 2008 Database

MCTS Microsoft SQL Server 2005 Implementation & Maintenance

10 Things DBAs Probably Don t Know LiteSpeed Can Do. written by Brent Ozar, SQL Server DBA

SQL Server 2008 Designing, Optimizing, and Maintaining a Database Session 1

Server 2008 SQL. Administration in Action ROD COLLEDGE MANNING. Greenwich. (74 w. long.)

MS SQL Server 2014 New Features and Database Administration

MOC Administering Microsoft SQL Server 2014 Databases

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

DBA 101: Best Practices All DBAs Should Follow

SQL Server for Database Administrators Course Syllabus

Backups and Maintenance

Designing Database Solutions for Microsoft SQL Server 2012 MOC 20465

Microsoft SQL Database Administrator Certification

Explain how to prepare the hardware and other resources necessary to install SQL Server. Install SQL Server. Manage and configure SQL Server.

MOC 20462C: Administering Microsoft SQL Server Databases

Maintaining a Microsoft SQL Server 2008 Database

SQL Server 2014

Computer Visions Course Outline

Best Practices Every SQL Server DBA Must Know

Backup and Recovery by using SANWatch - Snapshot

Virtualisa)on* and SAN Basics for DBAs. *See, I used the S instead of the zed. I m pretty smart for a foreigner.

Course Syllabus. Maintaining a Microsoft SQL Server 2005 Database. At Course Completion

A review of BackupAssist within a Hyper-V Environment

Course Syllabus. At Course Completion

Best Practices. Best Practices for Installing and Configuring SQL Server 2005 on an LSI CTS2600 System

Module 14: Scalability and High Availability

ONSITE TRAINING CATALOG

SQL Server Developer Training Program. Topics Covered

MS Administering Microsoft SQL Server Databases

SQL Server 2014 New Features/In- Memory Store. Juergen Thomas Microsoft Corporation

Backup, Restore and Options for SQL Server

Designing, Optimizing and Maintaining a Database Administrative Solution for Microsoft SQL Server 2008

IDERA WHITEPAPER. The paper will cover the following ten areas: Monitoring Management. WRITTEN BY Greg Robidoux

Getting to Know the SQL Server Management Studio

W I S E. SQL Server 2008/2008 R2 Advanced DBA Performance & WISE LTD.

Nimble Storage Best Practices for Microsoft SQL Server

Designing and Deploying Messaging Solutions with Microsoft Exchange Server 2010 Service Pack B; 5 days, Instructor-led

StarWind iscsi SAN Software: Implementation of Enhanced Data Protection Using StarWind Continuous Data Protection

6231B: Maintaining a Microsoft SQL Server 2008 R2 Database

MS Design, Optimize and Maintain Database for Microsoft SQL Server 2008

Microsoft SQL Server for Oracle DBAs Course 40045; 4 Days, Instructor-led

How To Backup A Database In Navision

MySQL Enterprise Backup

Administering Microsoft SQL Server Databases MOC 20462

SQL Server 2008 Administration

Real World Enterprise SQL Server Replication Implementations. Presented by Kun Lee

Administering Microsoft SQL Server 2012 Databases

SQL Server Training Course Content

NUTECH COMPUTER TRAINING INSTITUTE 1682 E. GUDE DRIVE #102, ROCKVILLE, MD WEB: TEL:

SSMS Built in Reports for Server and Database Monitoring

Back From the Dead: How to Restore a SQL Server in 60 Minutes or Less*

VERITAS NetBackup 6.0 Database and Application Protection

EZManage SQL Pro. Quick guide for installation and implementation

End-to-End Availability for Microsoft SQL Server

Securing Your Microsoft SQL Server Databases in an Enterprise Environment

DB2 9 for LUW Advanced Database Recovery CL492; 4 days, Instructor-led

Enhancements of ETERNUS DX / SF

MySQL Administration and Management Essentials

Course. Overview. Length: 5 Day(s) Published: English. IT Professionals. Level: Type: Method: Delivery. Enroll now (CAL)

How To Improve Performance In A Database

SEP sesam Online/Hot Backup & Restore for Databases and Application Protection

SQL Server Performance Tuning for DBAs

Oracle Maximum Availability Architecture Best Practices for Oracle Exadata (CON8392)

Backup and Restore Back to Basics with SQL LiteSpeed

A SURVEY OF POPULAR CLUSTERING TECHNOLOGIES

<Insert Picture Here> Considerations for Enterprise Cloud Computing

Maximizing Business Continuity and Minimizing Recovery Time Objectives in Windows Server Environments

Administering a Microsoft SQL Server 2000 Database

Course 6231B: Maintaining a Microsoft SQL Server 2008 R2 Database

UBGP008: Maximizing SQL Server Performance with Microsoft Dynamics GP. John Lowther

SQL Server Solutions GETTING STARTED WITH. SQL Safe Backup

Microsoft SQL Server 2008 R2 Enterprise Edition and Microsoft SharePoint Server 2010

Exam : Transition Your MCTS on SQL Server 2008 to MCSA: SQL Server 2012, Part 2. Title : The safer, easier way to help you pass any IT exams.

Backup and Recovery Solutions for Exadata. Ľubomír Vaňo Principal Sales Consultant

Basic knowledge of the Microsoft Windows operating system and its core functionality Working knowledge of Transact-SQL and relational databases

Data Compression in Blackbaud CRM Databases

Backup and Restore Strategies for SQL Server Database. Nexio Motion. 10-February Revsion: DRAFT

General DBA Best Practices

Nexio Motion 4 Database Backup and Restore

Would-be system and database administrators. PREREQUISITES: At least 6 months experience with a Windows operating system.

Server and Storage Virtualization with IP Storage. David Dale, NetApp

with the ArchiveSync Add-On Evaluator s Guide 2015 Software Pursuits, Inc.

Administering Microsoft SQL Server Databases

SQL Server Virtualization 101. David Klee, Group Principal and Practice Lead. SQL PASS Virtualization VC,

Computer Backup Strategies

AVALANCHE MC 5.3 AND DATABASE MANAGEMENT SYSTEMS

MS-10775: Administering Microsoft SQL Server 2012 Databases. Course Objectives. Required Exam(s) Price. Duration. Methods of Delivery.

SQL Server Database Administrator s Guide

mylittleadmin for MS SQL Server 2005 from a Webhosting Perspective Anthony Wilko President, Infuseweb LLC

Administering Microsoft SQL Server Databases

Upgrading Your SQL Server 2000 Database Administration (DBA) Skills to SQL Server 2008 DBA Skills Course 6317A: Three days; Instructor-Led

ExecuTrain Course Outline MOC 6231B: Maintaining a Microsoft SQL Server 2008 R2 Database

Transcription:

SQL Server Storage: The Terabyte Level Brent Ozar, Microsoft Certified Master, MVP Consultant & Trainer, SQLskills.com

BrentOzar.com/go/san

Race Facts 333 miles 375 boats invited 33 DNFs

Typical Terabyte Troubles Restores Backups DBCCs Querying Bad Ideas for: Schema Indexes (CL/NCL) Partitioning Storage

What Do We Restore Most Often? 1. The whole server 2. One whole database 3. One whole table 4. A few records 5. A schema change (like an SP or view)

The 1TB DBA s Worst Enemy Picture Source http://www.flickr.com/photos/slworking/2825225419/

Oops is a four letter word. Photo: http://www.flickr.com/photos/litherland/2118607755/

The Before You Touch That Backup Snapshot: instant backup Near-zero time of database size Near-zero space required Very easy to restore the whole thing Somewhat easy to restore objects

Database Snapshots: CONTROL-Z SQL 2005 & newer Enterprise Edition Looks like a DB Great for ad-hoc safety plans Photo: http://www.flickr.com/photos/croma/557971148/

Database Snapshot Pros & Cons Ad-hoc backups before app upgrades Let users query DB during ETL loads Presto, locking problems disappear Automated switching is messy Snapshots stop some operations Watch that disk space Still live on this database server

SAN Snapshot Backups

SAN Snapshots Not related to SQL Server at all Does require SQL Server awareness Involves doing a SQL Server backup Back up any size database in seconds Restore any whole database to any server in seconds*

* Well, Not Really. May be groups of databases May involve attaching more drives May require the SAN admin s help May not involve the transaction log

SAN Snapshot Benefits Backup speed nearly instantaneous Tape work offloaded to SAN controller Can keep many backups online Easy to run DBCCs on live backups Refresh dev/qa servers instantly

SAN Snapshot Drawbacks Can be very expensive Presenting snapshots to dev/qa servers can slow down production Doesn t help log shipping

SQL Server Database Snapshots: Before oops moments SAN Snapshots: Refresh QA, dev Run DBCC there Test version upgrades, new versions

Our Sample Database Config Tables Current Data Archive Data Calculated Data

Online Piecemeal Restore Restore PRIMARY filegroup first Database is instantly online Restore other filegroups individually Tables come online with each FG Demo: BrentOzar.com/go/piecemeal

Our Sample Database Config Tables Current Data Archive Data Calculated Data

Designing for Restores Keep PRIMARY filegroup very small Stop new PRIMARY objects (incl. indexes) using DDL triggers Design filegroups for recovery needs Keep related schema, objects together (including indexes)

The Easy Button for Restores Instant File Initialization SQL Server 2005+, all editions Instantly grows/creates data files Doesn t work with log files All gain, no pain

Typical Terabyte Troubles Restores Backups DBCCs Querying Bad Ideas for: Schema Indexes (CL/NCL) Partitioning Storage

Read-Only Filegroups Separate frozen data Enable compression Set 100% fill factor Update statistics Set FG to read-only Redesign backups Picture Source http://www.flickr.com/photos/guilleavalos/2139208615/

Read-Only Backup Strategy Full Backup Transaction logs every X minutes Filegroup differentials for active FGs

Restore Strategy Restore PRIMARY FG from full Restore read-only FGs from full Restore active FGs from: Old full Most recent diff Transaction logs

Who Does This? Not supported in GUI Barely supported in third party tools Totally inconvenient

Better Option: Back Up Less* Compress the backups Compress the data Archive data out

Native Backup Compression Only one setting Compresses everything, every time Picture Source http://www.flickr.com/photos/20052121@n00/2247588193/

Compress the Data 2005+ Enterprise Edition only Compress it once and you re done Often saves >50% Faster SELECT queries Bad for write-biased OLTP

Compression Gotchas No inheritance No built-in alerting Must revisit frequently

Archive Data Out of the DB It may not be your job to build an archiving strategy, but it is your job to sell one.

Typical Terabyte Troubles Restores Backups DBCCs Querying Bad Ideas for: Schema Indexes (CL/NCL) Partitioning Storage

Why do DBCCs? Picture Source http://www.flickr.com/photos/taniwha/62716776/

The Corruption Timeline Tuesday 1AM: Full backup Every 15 minutes: t-log backup Tuesday 11AM: User reports corruption What do we restore?

Sad Facts About Corruption It s not logged when it happens Error 825 Informational only No idea which backups to restore Page may have changed at any time Bigger databases = more to corrupt

Sad Facts About DBCC Time-intensive Resource-intensive No progress indicator

EZ DBCCs on VLDBs SAN snapshots 1 st thing after refreshing dev/qa Break DBCC into small chunks: BrentOzar.com/go/vldbdbcc

Typical Terabyte Troubles Restores Backups DBCCs Querying Bad Ideas for: Schema Indexes (CL/NCL) Partitioning Storage

When Do Statistics Update? 1. When 1% of the data changes 2. When 10% of the data changes 3. When 20% of the data changes 4. When 50% of the data changes 5. It depends

When Do Statistics Update? 1. When 1% of the data changes 2. When 10% of the data changes 3. When 20% of the data changes 4. When 50% of the data changes 5. It depends

How Do Statistics Update? 1. By sampling 1% of the data 2. By sampling 10% of the data 3. By sampling 20% of the data 4. By scanning of the data 5. It depends

How Do Statistics Update? 1. By sampling 1% of the data 2. By sampling 10% of the data 3. By sampling 20% of the data 4. By scanning of the data 5. It depends

How Statistics Update When an index is rebuilt: statistics updated with full scan When you update statistics: uses specified sampling rate (or whatever SQL decides)

Updating Stats In a Perfect World Set a weekly maintenance window (not outage, just slowdown) Integrate stats update with ETL Track which indexes you rebuild Only touch stats that weren t touched

SQLfool.com

Typical Terabyte Troubles Restores Backups DBCCs Querying Bad Ideas for: Schema Indexes (CL/NCL) Partitioning Storage

Eureka! Let s separate data and indexes into filegroups! Picture Source http://www.flickr.com/photos/20052121@n00/2247588193/

You-Reek-A - May Not Be Able To: Identify and control IO paths Control parallelism Back up & restore units of data Use SAN snapshots Set one filegroup to read-only

Eureka! Let s partition the data and SQL Server queries will be faster!

You-Reek-A It Doesn t Work Partition elimination rarely works Have to know your queries intimately Bottom line: great for management, archiving, sliding loads but not faster queries

Eureka! We re low on space - let s add a big empty file instead of growing these. File 1 95% used File 2 95% used File 3 95% used Picture Source http://www.flickr.com/photos/lifeisaprayer/2282011834/

Eureka! Guess where the inserts go? File 1 95% used File 2 95% used File 3 95% used File 4 0% used Picture Source http://www.flickr.com/photos/lifeisaprayer/2282011834/

The Better Way Start with 4 files per filegroup Put all on different IO paths (maybe) Add new filegroups, move objects to it Rebuild all indexes after adding files Extremely important for 1GB iscsi

Typical Terabyte Troubles Restores Backups DBCCs Querying Bad Ideas for: Schema Indexes (CL/NCL) Partitioning Storage

BrentOzar.com/go/san