SlideShare a Scribd company logo
1 of 30
Building Perfect SQL
Servers, Every Time
Joey D’Antoni
PASS DBA Fundamentals Virtual Chapter
01-April-2014
Joey D’Antoni
• Joey has over 15 years of experience with a wide variety of data platforms, in both Fortune 50
companies as well as smaller organizations
• He is a frequent speaker on database administration, big data, and career management
• He is the co-president of the Philadelphia SQL Server User’s Group
• MSCE, Business Intelligence
• He wants you to make sure you can restore your data
Joedantoni.wordpress.com – Blog, Slides
http://bit.ly/SQLColumnstore -- Slides, Resources
Overview
SQL Server Default Installation
What Do You Need to Fix?
The Importance of Standards
Automating the Process
Building a Private Cloud
SQL Server Installation
Set Max Memory
• The default setting for max server memory is 2147483647 MB
(2.1 Petabytes!!!)
• If this setting is not changed SQL Server will attempt to grab all
of the memory on the box
• This can lead to paging of the Windows O/S
• Best Practice is to allocate 80% of memory to SQL Server
• The one exception is very large memory servers—
Windows generally needs about 6-8 GB to run
comfortably
• Minimum Memory doesn’t need to be set generally
Configure MaxDOP
• Default setting is 0 which uses all
available processors in parallel
query execution
• This can lead to CXPACKET and
Scheduler waits
• Best Practice
• For servers > 8 CPUs = MAXDOP=8
• For servers < 8 CPUs = MAXDOP 0 to
n (where N=CPUs per NUMA node)
• Sharepoint MAXDOP=1
Change Model File Sizes
• Initial Size and Autogrowth are
way too small initially
• There is no right number—base
on roughly how big your
databases will be
• Definitely, change autogrowth
to remove percentage growth
and go with fixed value
• Goal is to avoid file system
fragmentation
Change Model Recovery Model
• By default—Model is in full recovery mode
• Typically I set to simple—if a database
needs to be in full recovery mode, set it
manually
• If you need databases in full recovery mode
be sure to set up transaction log backups*
Add Files to TempDB
• If the number of logical processors
< 8 then number of TempDB Files =
number of CPUs (but start with 4)
• If logical processors > 8, then
number of TempDB Files = 8
• If contention continues add files in
multiples of 4
• All TempDB files should be the
same size and have same
autogrowth settings
• Consider using trace flags
(1117,1118)
Create SQL Agent Alerts for Critical Errors
• Ensures you get notified when something bad happens on
your server
• Know that problems are happening before your users do
• Can tie alerts to actions and/or pages
Cost Threshold for Parallelism
• This is a your mileage
may vary setting
• The default of 5 is
generally too low for
everything except pure
OLTP
• Start with 50 and move
from there
Backup Compression
• This costs a little bit of CPU—
but your backups and
restores will greatly benefit
• In Standard Edition from
2008 R2 forward
Instant File Initialization
• SQL Server will by default
zero out a data file on a
growth
• Grant Windows permission to
SQL Server process account to
“Perform Volume
Maintenance Tasks”
Remote Dedicated Administrator
Connection
• Provides dedicated CPU,
memory and scheduler
• By default, only works via
RDP or physically on server
Maintenance
• The built in maintenance
plans in SQL Server aren’t
bad—they just aren’t
good
• Ola Hallengren SQL Server
Maintenance Solution
• CheckDB, Index
Maintenance, Statistics, B
ackups
Patch SQL Server
• Find out the current Service Pack and Cumulative Update level
(sqlserverbuilds.blogspot.com)
• Patch your server—no time like install time
If you are using SQL Server 2012 and up:
• Updatesource parameter
• Can use Windows Update (MU)
• Or local source UNC or local path
The Cloud
• ALL OF THE ABOVE APPLIES TO AZURE VMs!
Standards Are Important
Standards
• Having written build standards is important
• Consider everything
• Drive Locations
• Standard Volume Sizes
• Storage
• Editions, settings, builds
• O/S
• HA and DR options
• Security
• Revisit standards at least every 6 months
Standards Cont’d
• Standard HW is good and can really help
• Work with Sys Admin teams for guidance on O/S level
Exceptions
Process Automation
Infrastructure Server
• This is optional—but can be
really handy
• Store installation files
• Use as update source for SQL
Server installs
• Use as metadata and monitoring
hub for your environment
• Should be very secured
• Can be VM
Script your Installs
• Don’t use the GUI
• Automate for consistency, and speed
• You should still QA—this process is
dependent on things like having
standard disk letters
Virtual Machines
• This can get a little complicated
• I’ve taken two approaches
• Install SQL at build time (messy)
• Clone VM and make changes
• You may want different settings
Trust But Verify
• Even though you doing this great
process
• Still verify everything
• Leverage your infrastructure server
• Build Pretty Reports
Building A Private Cloud
• Case Study
• Make Decisions for 80% of
your environment
• SQL Server Components
aren’t bad—Windows is a
little trickier
• This process had more
management/sprawl issues
than technical ones
Private Cloud
User Interface
(Intranet)
Service
Management Layer
(System Center,
Others)
Backend
Infrastructure
Lessons Learned
• Capture Owner Info
• Acknowledge servers may not be managed
• Release a little bit of control
Summary
• Do this stuff
• Automate and Repeat
• Your Servers will love you
Slides joedantoni.wordpress.com
Twitter @jdanton
Email jdanton1@yahoo.com

More Related Content

What's hot

EDB Postgres DBA Best Practices
EDB Postgres DBA Best PracticesEDB Postgres DBA Best Practices
EDB Postgres DBA Best PracticesEDB
 
Oracle VM 3.4.1 Installation
Oracle VM 3.4.1 InstallationOracle VM 3.4.1 Installation
Oracle VM 3.4.1 InstallationSimo Vilmunen
 
VMworld Europe 2014: Advanced SQL Server on vSphere Techniques and Best Pract...
VMworld Europe 2014: Advanced SQL Server on vSphere Techniques and Best Pract...VMworld Europe 2014: Advanced SQL Server on vSphere Techniques and Best Pract...
VMworld Europe 2014: Advanced SQL Server on vSphere Techniques and Best Pract...VMworld
 
Nordic VMUG User Conference 2014 - Design VMware vCenter Server
Nordic VMUG User Conference 2014 - Design VMware vCenter ServerNordic VMUG User Conference 2014 - Design VMware vCenter Server
Nordic VMUG User Conference 2014 - Design VMware vCenter ServerAndrea Mauro
 
Building a Better Workstation
Building a Better WorkstationBuilding a Better Workstation
Building a Better WorkstationSteve Wake
 
End-to-end Troubleshooting Checklist for Microsoft SQL Server
End-to-end Troubleshooting Checklist for Microsoft SQL ServerEnd-to-end Troubleshooting Checklist for Microsoft SQL Server
End-to-end Troubleshooting Checklist for Microsoft SQL ServerKevin Kline
 
VMworld Europe 2014: Storage DRS - Deep Dive and Best Practices
VMworld Europe 2014: Storage DRS - Deep Dive and Best PracticesVMworld Europe 2014: Storage DRS - Deep Dive and Best Practices
VMworld Europe 2014: Storage DRS - Deep Dive and Best PracticesVMworld
 
KScope14 Oracle EPM Troubleshooting
KScope14 Oracle EPM TroubleshootingKScope14 Oracle EPM Troubleshooting
KScope14 Oracle EPM TroubleshootingAlithya
 
SQL Server 2014 New Features (Sql Server 2014 Yenilikleri)
SQL Server 2014 New Features (Sql Server 2014 Yenilikleri)SQL Server 2014 New Features (Sql Server 2014 Yenilikleri)
SQL Server 2014 New Features (Sql Server 2014 Yenilikleri)BT Akademi
 
be the captain of your connections deployment
be the captain of your connections deploymentbe the captain of your connections deployment
be the captain of your connections deploymentSharon James
 
VMworld Europe 2014: Virtual SAN Best Practices and Use Cases
VMworld Europe 2014: Virtual SAN Best Practices and Use CasesVMworld Europe 2014: Virtual SAN Best Practices and Use Cases
VMworld Europe 2014: Virtual SAN Best Practices and Use CasesVMworld
 
Who wants to be a DBA? Roles and Responsibilities
Who wants to be a DBA? Roles and ResponsibilitiesWho wants to be a DBA? Roles and Responsibilities
Who wants to be a DBA? Roles and ResponsibilitiesKevin Kline
 
Pascal benois performance_troubleshooting-spsbe18
Pascal benois performance_troubleshooting-spsbe18Pascal benois performance_troubleshooting-spsbe18
Pascal benois performance_troubleshooting-spsbe18BIWUG
 
Connections Migration soccnx12
Connections Migration soccnx12Connections Migration soccnx12
Connections Migration soccnx12Sharon James
 
Ten query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowTen query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowKevin Kline
 
Pre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctlyPre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctlyAntonios Chatzipavlis
 
Nagios, Getting Started.
Nagios, Getting Started.Nagios, Getting Started.
Nagios, Getting Started.Hitesh Bhatia
 
Oracle VM 3 hard partitioning
Oracle VM 3 hard partitioningOracle VM 3 hard partitioning
Oracle VM 3 hard partitioningGary Waldrom
 
Deploying Maximum HA Architecture With PostgreSQL
Deploying Maximum HA Architecture With PostgreSQLDeploying Maximum HA Architecture With PostgreSQL
Deploying Maximum HA Architecture With PostgreSQLDenish Patel
 

What's hot (20)

EDB Postgres DBA Best Practices
EDB Postgres DBA Best PracticesEDB Postgres DBA Best Practices
EDB Postgres DBA Best Practices
 
Oracle VM 3.4.1 Installation
Oracle VM 3.4.1 InstallationOracle VM 3.4.1 Installation
Oracle VM 3.4.1 Installation
 
VMworld Europe 2014: Advanced SQL Server on vSphere Techniques and Best Pract...
VMworld Europe 2014: Advanced SQL Server on vSphere Techniques and Best Pract...VMworld Europe 2014: Advanced SQL Server on vSphere Techniques and Best Pract...
VMworld Europe 2014: Advanced SQL Server on vSphere Techniques and Best Pract...
 
Nordic VMUG User Conference 2014 - Design VMware vCenter Server
Nordic VMUG User Conference 2014 - Design VMware vCenter ServerNordic VMUG User Conference 2014 - Design VMware vCenter Server
Nordic VMUG User Conference 2014 - Design VMware vCenter Server
 
Building a Better Workstation
Building a Better WorkstationBuilding a Better Workstation
Building a Better Workstation
 
End-to-end Troubleshooting Checklist for Microsoft SQL Server
End-to-end Troubleshooting Checklist for Microsoft SQL ServerEnd-to-end Troubleshooting Checklist for Microsoft SQL Server
End-to-end Troubleshooting Checklist for Microsoft SQL Server
 
VMworld Europe 2014: Storage DRS - Deep Dive and Best Practices
VMworld Europe 2014: Storage DRS - Deep Dive and Best PracticesVMworld Europe 2014: Storage DRS - Deep Dive and Best Practices
VMworld Europe 2014: Storage DRS - Deep Dive and Best Practices
 
KScope14 Oracle EPM Troubleshooting
KScope14 Oracle EPM TroubleshootingKScope14 Oracle EPM Troubleshooting
KScope14 Oracle EPM Troubleshooting
 
SQL Server 2014 New Features (Sql Server 2014 Yenilikleri)
SQL Server 2014 New Features (Sql Server 2014 Yenilikleri)SQL Server 2014 New Features (Sql Server 2014 Yenilikleri)
SQL Server 2014 New Features (Sql Server 2014 Yenilikleri)
 
be the captain of your connections deployment
be the captain of your connections deploymentbe the captain of your connections deployment
be the captain of your connections deployment
 
VMworld Europe 2014: Virtual SAN Best Practices and Use Cases
VMworld Europe 2014: Virtual SAN Best Practices and Use CasesVMworld Europe 2014: Virtual SAN Best Practices and Use Cases
VMworld Europe 2014: Virtual SAN Best Practices and Use Cases
 
Who wants to be a DBA? Roles and Responsibilities
Who wants to be a DBA? Roles and ResponsibilitiesWho wants to be a DBA? Roles and Responsibilities
Who wants to be a DBA? Roles and Responsibilities
 
Pascal benois performance_troubleshooting-spsbe18
Pascal benois performance_troubleshooting-spsbe18Pascal benois performance_troubleshooting-spsbe18
Pascal benois performance_troubleshooting-spsbe18
 
Connections Migration soccnx12
Connections Migration soccnx12Connections Migration soccnx12
Connections Migration soccnx12
 
Ten query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowTen query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should know
 
OEM_Case_Study_ABC
OEM_Case_Study_ABCOEM_Case_Study_ABC
OEM_Case_Study_ABC
 
Pre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctlyPre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctly
 
Nagios, Getting Started.
Nagios, Getting Started.Nagios, Getting Started.
Nagios, Getting Started.
 
Oracle VM 3 hard partitioning
Oracle VM 3 hard partitioningOracle VM 3 hard partitioning
Oracle VM 3 hard partitioning
 
Deploying Maximum HA Architecture With PostgreSQL
Deploying Maximum HA Architecture With PostgreSQLDeploying Maximum HA Architecture With PostgreSQL
Deploying Maximum HA Architecture With PostgreSQL
 

Similar to Building perfect sql servers, every time -oops

Connections Upgrades and Migrations the Easy Way
Connections Upgrades and Migrations the Easy WayConnections Upgrades and Migrations the Easy Way
Connections Upgrades and Migrations the Easy WayLetsConnect
 
Connections Migrations the easy way Soccnx10
Connections Migrations the easy way Soccnx10Connections Migrations the easy way Soccnx10
Connections Migrations the easy way Soccnx10Sharon James
 
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...BIWUG
 
SQL Server Best Practices - Install SQL Server like a boss (RELOADED)
SQL Server Best Practices - Install SQL Server like a boss (RELOADED)SQL Server Best Practices - Install SQL Server like a boss (RELOADED)
SQL Server Best Practices - Install SQL Server like a boss (RELOADED)Andre Essing
 
Performance Tuning
Performance TuningPerformance Tuning
Performance TuningJannet Peetz
 
Managing Exchange 2016 - Paul Robichaux
Managing Exchange 2016 - Paul RobichauxManaging Exchange 2016 - Paul Robichaux
Managing Exchange 2016 - Paul RobichauxSummit 7 Systems
 
Migrating to Connections 6.0 – Been there, done that!
Migrating to Connections 6.0 – Been there, done that!Migrating to Connections 6.0 – Been there, done that!
Migrating to Connections 6.0 – Been there, done that!LetsConnect
 
TFS 2015 Upgrade Tips & Tricks
TFS 2015 Upgrade Tips & TricksTFS 2015 Upgrade Tips & Tricks
TFS 2015 Upgrade Tips & TricksInCycleSoftware
 
Tfs 2015 Upgrade Tips and Tricks
Tfs 2015 Upgrade Tips and TricksTfs 2015 Upgrade Tips and Tricks
Tfs 2015 Upgrade Tips and TricksInCycleSoftware
 
SharePoint 2013 on Azure: Your Dedicated Farm in the Cloud
SharePoint 2013 on Azure: Your Dedicated Farm in the CloudSharePoint 2013 on Azure: Your Dedicated Farm in the Cloud
SharePoint 2013 on Azure: Your Dedicated Farm in the CloudJamie McAllister
 
Server Management
Server ManagementServer Management
Server ManagementDell World
 
Roman Rehak: 24/7 Database Administration + Database Mail Unleashed
Roman Rehak: 24/7 Database Administration + Database Mail UnleashedRoman Rehak: 24/7 Database Administration + Database Mail Unleashed
Roman Rehak: 24/7 Database Administration + Database Mail UnleashedMSDEVMTL
 
The Future of Database Development
The Future of Database DevelopmentThe Future of Database Development
The Future of Database DevelopmentSteve Jones
 
You don't want to do it like that
You don't want to do it like thatYou don't want to do it like that
You don't want to do it like thatSharon James
 
Connections install in 45 mins
Connections install in 45 minsConnections install in 45 mins
Connections install in 45 minsSharon James
 
MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014Ryusuke Kajiyama
 
Midwest PHP - Scaling Magento
Midwest PHP - Scaling MagentoMidwest PHP - Scaling Magento
Midwest PHP - Scaling MagentoMathew Beane
 
Database Provisioning in EM12c: Provision me a Database Now!
Database Provisioning in EM12c: Provision me a Database Now!Database Provisioning in EM12c: Provision me a Database Now!
Database Provisioning in EM12c: Provision me a Database Now!Maaz Anjum
 
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site ReviewECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site ReviewKenny Buntinx
 
Got Problems? Let's Do a Health Check
Got Problems? Let's Do a Health CheckGot Problems? Let's Do a Health Check
Got Problems? Let's Do a Health CheckLuis Guirigay
 

Similar to Building perfect sql servers, every time -oops (20)

Connections Upgrades and Migrations the Easy Way
Connections Upgrades and Migrations the Easy WayConnections Upgrades and Migrations the Easy Way
Connections Upgrades and Migrations the Easy Way
 
Connections Migrations the easy way Soccnx10
Connections Migrations the easy way Soccnx10Connections Migrations the easy way Soccnx10
Connections Migrations the easy way Soccnx10
 
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
 
SQL Server Best Practices - Install SQL Server like a boss (RELOADED)
SQL Server Best Practices - Install SQL Server like a boss (RELOADED)SQL Server Best Practices - Install SQL Server like a boss (RELOADED)
SQL Server Best Practices - Install SQL Server like a boss (RELOADED)
 
Performance Tuning
Performance TuningPerformance Tuning
Performance Tuning
 
Managing Exchange 2016 - Paul Robichaux
Managing Exchange 2016 - Paul RobichauxManaging Exchange 2016 - Paul Robichaux
Managing Exchange 2016 - Paul Robichaux
 
Migrating to Connections 6.0 – Been there, done that!
Migrating to Connections 6.0 – Been there, done that!Migrating to Connections 6.0 – Been there, done that!
Migrating to Connections 6.0 – Been there, done that!
 
TFS 2015 Upgrade Tips & Tricks
TFS 2015 Upgrade Tips & TricksTFS 2015 Upgrade Tips & Tricks
TFS 2015 Upgrade Tips & Tricks
 
Tfs 2015 Upgrade Tips and Tricks
Tfs 2015 Upgrade Tips and TricksTfs 2015 Upgrade Tips and Tricks
Tfs 2015 Upgrade Tips and Tricks
 
SharePoint 2013 on Azure: Your Dedicated Farm in the Cloud
SharePoint 2013 on Azure: Your Dedicated Farm in the CloudSharePoint 2013 on Azure: Your Dedicated Farm in the Cloud
SharePoint 2013 on Azure: Your Dedicated Farm in the Cloud
 
Server Management
Server ManagementServer Management
Server Management
 
Roman Rehak: 24/7 Database Administration + Database Mail Unleashed
Roman Rehak: 24/7 Database Administration + Database Mail UnleashedRoman Rehak: 24/7 Database Administration + Database Mail Unleashed
Roman Rehak: 24/7 Database Administration + Database Mail Unleashed
 
The Future of Database Development
The Future of Database DevelopmentThe Future of Database Development
The Future of Database Development
 
You don't want to do it like that
You don't want to do it like thatYou don't want to do it like that
You don't want to do it like that
 
Connections install in 45 mins
Connections install in 45 minsConnections install in 45 mins
Connections install in 45 mins
 
MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014
 
Midwest PHP - Scaling Magento
Midwest PHP - Scaling MagentoMidwest PHP - Scaling Magento
Midwest PHP - Scaling Magento
 
Database Provisioning in EM12c: Provision me a Database Now!
Database Provisioning in EM12c: Provision me a Database Now!Database Provisioning in EM12c: Provision me a Database Now!
Database Provisioning in EM12c: Provision me a Database Now!
 
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site ReviewECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review
 
Got Problems? Let's Do a Health Check
Got Problems? Let's Do a Health CheckGot Problems? Let's Do a Health Check
Got Problems? Let's Do a Health Check
 

More from Joseph D'Antoni

The modern analytics architecture
The modern analytics architectureThe modern analytics architecture
The modern analytics architectureJoseph D'Antoni
 
Pass 2013 dantoni azure a gs
Pass 2013 dantoni azure a gsPass 2013 dantoni azure a gs
Pass 2013 dantoni azure a gsJoseph D'Antoni
 
Accelerating Database Performance Using Compression
Accelerating Database Performance Using CompressionAccelerating Database Performance Using Compression
Accelerating Database Performance Using CompressionJoseph D'Antoni
 
Sql server 2012 ha and dr sql saturday boston
Sql server 2012 ha and dr sql saturday bostonSql server 2012 ha and dr sql saturday boston
Sql server 2012 ha and dr sql saturday bostonJoseph D'Antoni
 
Accelerating Database Performance with Compression
Accelerating Database Performance with CompressionAccelerating Database Performance with Compression
Accelerating Database Performance with CompressionJoseph D'Antoni
 
Sql Server 2012 HA and DR -- SQL Saturday Richmond
Sql Server 2012 HA and DR -- SQL Saturday RichmondSql Server 2012 HA and DR -- SQL Saturday Richmond
Sql Server 2012 HA and DR -- SQL Saturday RichmondJoseph D'Antoni
 
Sql server 2012 ha and dr sql saturday tampa
Sql server 2012 ha and dr sql saturday tampaSql server 2012 ha and dr sql saturday tampa
Sql server 2012 ha and dr sql saturday tampaJoseph D'Antoni
 
Windows server 2012 failover clustering new features
Windows server 2012 failover clustering new featuresWindows server 2012 failover clustering new features
Windows server 2012 failover clustering new featuresJoseph D'Antoni
 
Sql server 2012 ha and dr sql saturday dc
Sql server 2012 ha and dr sql saturday dcSql server 2012 ha and dr sql saturday dc
Sql server 2012 ha and dr sql saturday dcJoseph D'Antoni
 
San presentation nov 2012 central pa
San presentation nov 2012 central paSan presentation nov 2012 central pa
San presentation nov 2012 central paJoseph D'Antoni
 
Always on availability groups way too deep
Always on availability groups way too deepAlways on availability groups way too deep
Always on availability groups way too deepJoseph D'Antoni
 
South jersey sql virtualization
South jersey sql virtualizationSouth jersey sql virtualization
South jersey sql virtualizationJoseph D'Antoni
 
Sql server 2012 ha dr 24_hop_final
Sql server 2012 ha dr 24_hop_finalSql server 2012 ha dr 24_hop_final
Sql server 2012 ha dr 24_hop_finalJoseph D'Antoni
 
Sql server 2012 ha dr 24_hop_final
Sql server 2012 ha dr 24_hop_finalSql server 2012 ha dr 24_hop_final
Sql server 2012 ha dr 24_hop_finalJoseph D'Antoni
 
Sql server 2012 ha dr nova
Sql server 2012 ha dr novaSql server 2012 ha dr nova
Sql server 2012 ha dr novaJoseph D'Antoni
 
Sql saturday powerpoint dc_san
Sql saturday powerpoint dc_sanSql saturday powerpoint dc_san
Sql saturday powerpoint dc_sanJoseph D'Antoni
 

More from Joseph D'Antoni (20)

DBA Fundamentals VC
DBA Fundamentals VCDBA Fundamentals VC
DBA Fundamentals VC
 
The modern analytics architecture
The modern analytics architectureThe modern analytics architecture
The modern analytics architecture
 
Pass 2013 dantoni azure a gs
Pass 2013 dantoni azure a gsPass 2013 dantoni azure a gs
Pass 2013 dantoni azure a gs
 
Accelerating Database Performance Using Compression
Accelerating Database Performance Using CompressionAccelerating Database Performance Using Compression
Accelerating Database Performance Using Compression
 
Pass bac jd_sm
Pass bac jd_smPass bac jd_sm
Pass bac jd_sm
 
Sql server 2012 ha and dr sql saturday boston
Sql server 2012 ha and dr sql saturday bostonSql server 2012 ha and dr sql saturday boston
Sql server 2012 ha and dr sql saturday boston
 
Accelerating Database Performance with Compression
Accelerating Database Performance with CompressionAccelerating Database Performance with Compression
Accelerating Database Performance with Compression
 
Sql Server 2012 HA and DR -- SQL Saturday Richmond
Sql Server 2012 HA and DR -- SQL Saturday RichmondSql Server 2012 HA and DR -- SQL Saturday Richmond
Sql Server 2012 HA and DR -- SQL Saturday Richmond
 
Sql server 2012 ha and dr sql saturday tampa
Sql server 2012 ha and dr sql saturday tampaSql server 2012 ha and dr sql saturday tampa
Sql server 2012 ha and dr sql saturday tampa
 
Windows server 2012 failover clustering new features
Windows server 2012 failover clustering new featuresWindows server 2012 failover clustering new features
Windows server 2012 failover clustering new features
 
Sql server 2012 ha and dr sql saturday dc
Sql server 2012 ha and dr sql saturday dcSql server 2012 ha and dr sql saturday dc
Sql server 2012 ha and dr sql saturday dc
 
San presentation nov 2012 central pa
San presentation nov 2012 central paSan presentation nov 2012 central pa
San presentation nov 2012 central pa
 
Always on availability groups way too deep
Always on availability groups way too deepAlways on availability groups way too deep
Always on availability groups way too deep
 
South jersey sql virtualization
South jersey sql virtualizationSouth jersey sql virtualization
South jersey sql virtualization
 
Virtualization for DBA
Virtualization for DBAVirtualization for DBA
Virtualization for DBA
 
Sql server 2012 ha dr 24_hop_final
Sql server 2012 ha dr 24_hop_finalSql server 2012 ha dr 24_hop_final
Sql server 2012 ha dr 24_hop_final
 
Sql server 2012 ha dr 24_hop_final
Sql server 2012 ha dr 24_hop_finalSql server 2012 ha dr 24_hop_final
Sql server 2012 ha dr 24_hop_final
 
Sql server 2012 ha dr nova
Sql server 2012 ha dr novaSql server 2012 ha dr nova
Sql server 2012 ha dr nova
 
Sql server 2012 ha dr
Sql server 2012 ha drSql server 2012 ha dr
Sql server 2012 ha dr
 
Sql saturday powerpoint dc_san
Sql saturday powerpoint dc_sanSql saturday powerpoint dc_san
Sql saturday powerpoint dc_san
 

Building perfect sql servers, every time -oops

  • 1. Building Perfect SQL Servers, Every Time Joey D’Antoni PASS DBA Fundamentals Virtual Chapter 01-April-2014
  • 2. Joey D’Antoni • Joey has over 15 years of experience with a wide variety of data platforms, in both Fortune 50 companies as well as smaller organizations • He is a frequent speaker on database administration, big data, and career management • He is the co-president of the Philadelphia SQL Server User’s Group • MSCE, Business Intelligence • He wants you to make sure you can restore your data Joedantoni.wordpress.com – Blog, Slides http://bit.ly/SQLColumnstore -- Slides, Resources
  • 3. Overview SQL Server Default Installation What Do You Need to Fix? The Importance of Standards Automating the Process Building a Private Cloud
  • 5. Set Max Memory • The default setting for max server memory is 2147483647 MB (2.1 Petabytes!!!) • If this setting is not changed SQL Server will attempt to grab all of the memory on the box • This can lead to paging of the Windows O/S • Best Practice is to allocate 80% of memory to SQL Server • The one exception is very large memory servers— Windows generally needs about 6-8 GB to run comfortably • Minimum Memory doesn’t need to be set generally
  • 6. Configure MaxDOP • Default setting is 0 which uses all available processors in parallel query execution • This can lead to CXPACKET and Scheduler waits • Best Practice • For servers > 8 CPUs = MAXDOP=8 • For servers < 8 CPUs = MAXDOP 0 to n (where N=CPUs per NUMA node) • Sharepoint MAXDOP=1
  • 7. Change Model File Sizes • Initial Size and Autogrowth are way too small initially • There is no right number—base on roughly how big your databases will be • Definitely, change autogrowth to remove percentage growth and go with fixed value • Goal is to avoid file system fragmentation
  • 8. Change Model Recovery Model • By default—Model is in full recovery mode • Typically I set to simple—if a database needs to be in full recovery mode, set it manually • If you need databases in full recovery mode be sure to set up transaction log backups*
  • 9. Add Files to TempDB • If the number of logical processors < 8 then number of TempDB Files = number of CPUs (but start with 4) • If logical processors > 8, then number of TempDB Files = 8 • If contention continues add files in multiples of 4 • All TempDB files should be the same size and have same autogrowth settings • Consider using trace flags (1117,1118)
  • 10. Create SQL Agent Alerts for Critical Errors • Ensures you get notified when something bad happens on your server • Know that problems are happening before your users do • Can tie alerts to actions and/or pages
  • 11. Cost Threshold for Parallelism • This is a your mileage may vary setting • The default of 5 is generally too low for everything except pure OLTP • Start with 50 and move from there
  • 12. Backup Compression • This costs a little bit of CPU— but your backups and restores will greatly benefit • In Standard Edition from 2008 R2 forward
  • 13. Instant File Initialization • SQL Server will by default zero out a data file on a growth • Grant Windows permission to SQL Server process account to “Perform Volume Maintenance Tasks”
  • 14. Remote Dedicated Administrator Connection • Provides dedicated CPU, memory and scheduler • By default, only works via RDP or physically on server
  • 15. Maintenance • The built in maintenance plans in SQL Server aren’t bad—they just aren’t good • Ola Hallengren SQL Server Maintenance Solution • CheckDB, Index Maintenance, Statistics, B ackups
  • 16. Patch SQL Server • Find out the current Service Pack and Cumulative Update level (sqlserverbuilds.blogspot.com) • Patch your server—no time like install time If you are using SQL Server 2012 and up: • Updatesource parameter • Can use Windows Update (MU) • Or local source UNC or local path
  • 17. The Cloud • ALL OF THE ABOVE APPLIES TO AZURE VMs!
  • 19. Standards • Having written build standards is important • Consider everything • Drive Locations • Standard Volume Sizes • Storage • Editions, settings, builds • O/S • HA and DR options • Security • Revisit standards at least every 6 months
  • 20. Standards Cont’d • Standard HW is good and can really help • Work with Sys Admin teams for guidance on O/S level
  • 23. Infrastructure Server • This is optional—but can be really handy • Store installation files • Use as update source for SQL Server installs • Use as metadata and monitoring hub for your environment • Should be very secured • Can be VM
  • 24. Script your Installs • Don’t use the GUI • Automate for consistency, and speed • You should still QA—this process is dependent on things like having standard disk letters
  • 25. Virtual Machines • This can get a little complicated • I’ve taken two approaches • Install SQL at build time (messy) • Clone VM and make changes • You may want different settings
  • 26. Trust But Verify • Even though you doing this great process • Still verify everything • Leverage your infrastructure server • Build Pretty Reports
  • 27. Building A Private Cloud • Case Study • Make Decisions for 80% of your environment • SQL Server Components aren’t bad—Windows is a little trickier • This process had more management/sprawl issues than technical ones
  • 28. Private Cloud User Interface (Intranet) Service Management Layer (System Center, Others) Backend Infrastructure
  • 29. Lessons Learned • Capture Owner Info • Acknowledge servers may not be managed • Release a little bit of control
  • 30. Summary • Do this stuff • Automate and Repeat • Your Servers will love you Slides joedantoni.wordpress.com Twitter @jdanton Email jdanton1@yahoo.com