Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon...
Transcript of Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon...
![Page 1: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/1.jpg)
©SQLskills.com 2010
Virtualisa)on* and SAN Basics for DBAs
*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.
![Page 2: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/2.jpg)
©SQLskills.com 2010
Brent Ozar -‐ @BrentO
![Page 3: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/3.jpg)
©SQLskills.com 2010
BrentOzar.com/go/san BrentOzar.com/go/virtual
![Page 4: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/4.jpg)
©SQLskills.com 2010
Today’s Agenda
! How Virtualisa7on Changes: ! CPU ! Memory ! Monitoring
! SAN ! Specific Guidelines ! General Guidelines
![Page 5: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/5.jpg)
©SQLskills.com 2010
Virtualisation is not here to make things faster.
Virtualisation is here to make things cheaper.
![Page 6: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/6.jpg)
©SQLskills.com 2010
Cheaper Can Mean:
! Less hardware ! Less soHware ! Less licensing ! Less management 7me
![Page 7: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/7.jpg)
©SQLskills.com 2010
The SQL Server DBA's Role
! Embrace cheaper and easier ! Work within virtualisa7on's rules ! Work around the hardware limits ! Try not to leave performance on the datacenter floor
![Page 8: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/8.jpg)
©SQLskills.com 2010
Virtualisa)on Changes:
! CPU (and Licensing) ! Memory ! Monitoring ! Storage ! HA/DR
![Page 9: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/9.jpg)
©SQLskills.com 2010
What % CPU average does your CIO want to see?
CPU Pop Quiz
![Page 10: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/10.jpg)
©SQLskills.com 2010
You're doing it wrong.
Photo Source: http://www.flickr.com/photos/schwenke/4496632138/
![Page 11: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/11.jpg)
©SQLskills.com 2010
CPU Speed A.V.M.
! How many virtual cores do we need? ! How many idle real cores are available? ! How fast is each physical core? (Think power saving CPUs)
! Do we get the same percentage of each? ! Did we run our last instruc7on on the same cores?
Photo Source: http://www.flickr.com/photos/schwenke/4496632138/
![Page 12: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/12.jpg)
©SQLskills.com 2010
Our Scenario
! 4-‐core host ! Mostly sits idle ! Just two guests: SQL and APP
![Page 13: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/13.jpg)
©SQLskills.com 2010
Step 1: Working
Core0
SQL
Core1
SQL
Core2
Idle
Core3
Idle
![Page 14: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/14.jpg)
©SQLskills.com 2010
Step 1: Wai)ng
Core0
Idle
Core1
Idle
Core2
Idle
Core3
Idle
![Page 15: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/15.jpg)
©SQLskills.com 2010
Step 2: Sharing
Core0
APP
Core1
APP
Core2
Idle
Core3
Idle
![Page 16: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/16.jpg)
©SQLskills.com 2010
One Approach: Cache Miss
Core0
APP
Core1
APP
Core2
SQL
Core3
SQL
![Page 17: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/17.jpg)
©SQLskills.com 2010
Another Approach: Wait
Core0
APP
SQL
Core1
APP
SQL
Core2
Idle
Core3
Idle
![Page 18: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/18.jpg)
©SQLskills.com 2010
Many Cores, One Cache
Performance Insights to Intel Hyper-Threading Technology http://software.intel.com/en-us/articles/performance-insights-to-intel-hyper-threading-technology/
![Page 19: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/19.jpg)
©SQLskills.com 2010
Uh Oh…
Performance Insights to Intel Hyper-Threading Technology http://software.intel.com/en-us/articles/performance-insights-to-intel-hyper-threading-technology/
![Page 20: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/20.jpg)
©SQLskills.com 2010
![Page 21: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/21.jpg)
©SQLskills.com 2010
ScoXy! We Need More Power!
![Page 22: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/22.jpg)
©SQLskills.com 2010
CPU-‐Z From CPUID.com
![Page 23: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/23.jpg)
©SQLskills.com 2010
VM SQL CPU Best Prac)ces
! Use the newest version of hypervisor ! Minimize number of virtual cores ! Check CPU speeds & cache with CPUID ! Strip out unnecessary virtual hardware
! Floppy drives, CD drives, etc ! Remove all background services
! Screen savers, Acrobat, file sync tools, an7virus(?) ! Monitor for throaling, other guests ! Avoid affinity masking
![Page 24: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/24.jpg)
©SQLskills.com 2010
Today’s Agenda
! How Virtualisa7on Changes: ! CPU ! Memory ! Monitoring
! SAN ! Specific Guidelines ! General Guidelines
![Page 25: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/25.jpg)
©SQLskills.com 2010
Memory Pop Quiz
Exactly how much memory does your SQL Server need?
![Page 26: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/26.jpg)
©SQLskills.com 2010
We suck at this.
Photo Source: http://www.flickr.com/photos/trojanguy/3361498441/
![Page 27: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/27.jpg)
©SQLskills.com 2010
Shameless Plug: See Page 50
! Perfmon Memory Manager Counters: ! Total Server
Memory (KB) ! Target Server
Memory (KB)
! Buffer pool only ! If Target > Total, there’s memory pressure.
![Page 28: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/28.jpg)
©SQLskills.com 2010
How the Magic Happens
! Hypervisor dedupes, compresses memory (VM, XS prototype)
! Balloon driver fakes memory pressure (HV, VM, XS)
! Worst case scenario: host page file (VM)
![Page 29: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/29.jpg)
©SQLskills.com 2010
VMware RAM Best Prac)ces
! VMware: ! Set a memory reserva7on ! Set SQL's min/max memory appropriately
! MS Hyper-‐V: ! Avoid dynamic memory for SQL Servers today
(works great for virtual desktops though)
Vmware “Performance and Scalability of Microsoft SQL Server on VMware vSphere 4” from http://www.vmware.com/resources/techresources/10033
![Page 30: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/30.jpg)
©SQLskills.com 2010
Today’s Agenda
! How Virtualisa7on Changes: ! CPU ! Memory ! Monitoring
! SAN ! Specific Guidelines ! General Guidelines
![Page 31: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/31.jpg)
©SQLskills.com 2010
New Perfmon Counters
! VMware ESX 3.5 – manual download ! VMware vSphere 4.0 – built in ! No extra permissions required ! Most VMware sysadmins don’t even know about them
![Page 32: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/32.jpg)
©SQLskills.com 2010
VM Processor Counters
! % Processor Time ! Host Processor Speed (MHz) ! Limit (MHz) ! Reserva7on (MHz)
![Page 33: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/33.jpg)
©SQLskills.com 2010
VM Memory Counters
! Memory Limit (MB) ! Memory Reserva7on (MB) ! Memory Ballooned (MB) ! Memory Swapped (MB) ! Just for curiosity:
! Memory Shared (MB) ! Memory Shared Saved (MB)
![Page 34: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/34.jpg)
©SQLskills.com 2010
Today’s Agenda
! How Virtualisa7on Changes: ! CPU ! Memory ! Monitoring
! SAN ! Specific Guidelines ! General Guidelines
![Page 35: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/35.jpg)
©SQLskills.com 2010
Who trusts their SAN administrators?
![Page 36: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/36.jpg)
©SQLskills.com 2010
Know who else doesn’t trust SAN admins?
![Page 37: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/37.jpg)
©SQLskills.com 2010
Your SAN vendor.
![Page 38: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/38.jpg)
©SQLskills.com 2010
![Page 39: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/39.jpg)
©SQLskills.com 2010
![Page 40: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/40.jpg)
©SQLskills.com 2010
![Page 41: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/41.jpg)
©SQLskills.com 2010
![Page 42: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/42.jpg)
©SQLskills.com 2010
![Page 43: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/43.jpg)
©SQLskills.com 2010
![Page 44: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/44.jpg)
©SQLskills.com 2010
![Page 45: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/45.jpg)
©SQLskills.com 2010
You don’t have to do everything exactly the way the vendor says.
But if you don’t, you need to explain why.
![Page 46: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/46.jpg)
©SQLskills.com 2010
Sample TempDB Sec)on
![Page 47: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/47.jpg)
©SQLskills.com 2010
COALESCE
! Takes first non-‐null value
! SELECT COALESCE(Field1, Field2, Field3)
! Field1 = null, Field2 = null, Field3 = ‘Brent’ Return value will be ‘Brent’
! Field1 = null, Field2 = ‘Rob’, Field3 = ‘Brent’ Return value will be ‘Rob’
![Page 48: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/48.jpg)
©SQLskills.com 2010
How SAN Guidelines Really Work SELECT COALESCE( YourTestedAndProvenSeqng, VendorGuideline, GeneralGuideline) AS WhatToDo FROM dbo.Internet WHERE source = ‘Trusted’
![Page 49: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/49.jpg)
©SQLskills.com 2010
Today’s Agenda
! How Virtualisa7on Changes: ! CPU ! Memory ! Monitoring
! SAN ! Specific Guidelines ! General Guidelines
![Page 50: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/50.jpg)
©SQLskills.com 2010
RAID 5 and RAID 10
![Page 51: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/51.jpg)
©SQLskills.com 2010
General RAID Guidelines
! RAID 10 everywhere you can afford it ! When you can’t it, RAID 5* in this order:
! TempDB data files ! TempDB log files ! User database data files ! User database log files ! Backup target
! Avoid RAID 0, not even for TempDB, unless you are okay with an outage.
* - There’s other RAID levels – we’ll get to that.
![Page 52: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/52.jpg)
©SQLskills.com 2010
RAID 0, 5, 10 Explained ! RAID 0:
! Only one copy of your data, spread out across a lot of drives
! Lose one drive, and you must restore
! RAID 10: ! Two copies of your data
! RAID 5: ! Only one copy of your data,
but there’s an extra drive for parity* ! Lose one drive, and it’ll rebuild w/a spare drive ! Lose two drives, and you must restore
* - before you raise your hand and say I’m wrong, smart guy, lemme finish. I’m teaching this slowly – I’ll explain 3 slides later.
![Page 53: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/53.jpg)
©SQLskills.com 2010
Why RAID 5 Has Slower Writes
Photo Source: http://en.wikipedia.org/wiki/Standard_RAID_levels
![Page 54: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/54.jpg)
©SQLskills.com 2010
Way Oversimplified Parity
! Drive A Sector 1 = “100” ! Drive B Sector 1 = “150” ! Drive C Sector 1 = “50” ! Parity = “300”
![Page 55: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/55.jpg)
©SQLskills.com 2010
How RAID 5 Really Works
Photo Source: http://en.wikipedia.org/wiki/Standard_RAID_levels
![Page 56: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/56.jpg)
©SQLskills.com 2010
RAID 6: RAID 5 with Extra Parity
Photo Source: http://en.wikipedia.org/wiki/Standard_RAID_levels
![Page 57: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/57.jpg)
©SQLskills.com 2010
If you have ten 1TB drives to use: RAID 5: ! One copy of your data,
less one drive for parity ! 9TB of usable space
RAID 10: ! Two copies of your data
! 5TB of usable space
If you need 5TB of usable space: RAID 5: ! One copy of your data,
plus one drive for parity ! 6 hard drives required
RAID 10: ! Two copies of your data
! 10 hard drives required
![Page 58: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/58.jpg)
©SQLskills.com 2010
General Shared vs Dedicated
! Shared Arrays: “Should I use one big pool of drives shared between lots of servers, or dedicate specific drives to specific servers?”
! Shared LUNs (Drive Leaers): “Should I put my data and log files on the same drive leaer?”
![Page 59: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/59.jpg)
©SQLskills.com 2010
Shared vs Dedicated Arrays
! If you have all these, dedicated is OK: ! A trusted SAN admin ! SAN performance monitoring soHware ! Correctly configured ac7ve/ac7ve mul7pathing ! More than a terabyte of data in one database
! If not, consider a big shared pool of drives. ! Share pools with dissimilar server load types,
not similar load types & 7mes ! Know your neighbor’s backup & virus scan 7mes
![Page 60: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/60.jpg)
©SQLskills.com 2010
Shared vs Dedicated LUNs ! LUN = Windows drive leaer* ! Consider data & logs on same LUN if:
! You’re using SAN snapshots and the mfr says to ! It’s all one big pool of drives anyway
! Consider dedicated LUNs for data & logs if: ! You’re using filegroups & par77ons ! You’re considering filegroup backups ! You can use 7ered storage (SATA + FC + SSD) ! You’re going to micromanage performance
(and I think that’s a good thing)
* - yes, smart guy, I’m simplifying this. When you teach a class, you try teaching the concept of SANs in three hours. It’s hard.
![Page 61: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/61.jpg)
©SQLskills.com 2010
General TempDB LUN Guidelines
! My default: always use a separate LUN ! May need to improve its performance separately from the user databases
! Need to avoid SAN replica7on for it ! My preference: one pool of SATA RAID 10 for all my SQL Server TempDBs ! Cheap ! Huge capacity ! Similar load paaerns
![Page 62: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/62.jpg)
©SQLskills.com 2010
General iSCSI vs Fiber Channel
! Use the fastest interface you can: ! 10GB iSCSI ! 8GB Fiber ! 4GB Fiber ! 2GB Fiber ! 1GB iSCSI
! The slower interface you have, the more you need mul7pathing.
! Know your controller’s connec7ons. ! You can probably connect more there too.
![Page 63: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/63.jpg)
©SQLskills.com 2010
General Purchasing Guideline
! Un7l you can prove your boaleneck isn’t your connec7vity, don’t buy more drives.
! SQLIO tutorial: hap://www.BrentOzar.com/go/sqlio
![Page 64: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/64.jpg)
©SQLskills.com 2010
Today’s Agenda
! How Virtualisa7on Changes: ! CPU ! Memory ! Monitoring
! SAN ! Specific Guidelines ! General Guidelines
![Page 65: Virtualisaon *- and-SAN-Basics-for-DBAs-...©SQLskills.com2010 Virtualisaon *-and-SAN-Basics-for-DBAs-*See, I used the “S” instead of the zed. I’m pretty smart for a foreigner.©SQLskills.com2010](https://reader036.fdocuments.net/reader036/viewer/2022062414/5ec5a3a6691079698166a11c/html5/thumbnails/65.jpg)
©SQLskills.com 2010
BrentOzar.com/go/san BrentOzar.com/go/virtual