Pre and post tips to installing sql server correctly

Antonios Chatzipavlis
Antonios ChatzipavlisSQL Server Expert at Enterprise Infrastructure and Data Analysis
th
EVENT Pre and Post tips to
Installing SQL Server
correctly
SQL Server 2008, 2008R2, 2012,2014Antonios Chatzipavlis
Database Architect • SQL Server Evangelist • Trainer
MCT, MCSE, MCITP, MCPD,MCSD,MCDBA,MCSA,MCTS, MCAD,MCP, OCA,ITIL-F
Jan 22, 2015
51
I have been started with computers.
I started my professional carrier in computers industry.
I have been started to work with SQL Server version 6.0
I earned my first certification at Microsoft as Microsoft Certified Solution Developer (3rd in
Greece) and started my carrier as Microsoft Certified Trainer (MCT) with more than 20.000
hours of training until now!
I became for first time Microsoft MVP on SQL Server
I created the SQL School Greece (www.sqlschool.gr)
I became MCT Regional Lead by Microsoft Learning Program.
I was certified as MCSE : Data Platform, MCSE: Business Intelligence
Antonios Chatzipavlis
Database Architect • SQL Server Evangelist • Trainer • Speaker
MCT, MCSE, MCITP, MCPD, MCSD, MCDBA, MCSA, MCTS, MCAD, MCP, OCA, ITIL-F
 1982
 1988
 1996
 1998
 2010
 2012
 2013
Follow us in social media
Twitter @antoniosch / @sqlschool
Facebook fb/sqlschoolgr
YouTube yt/user/achatzipavlis
LinkedIn SQL School Greece group
Pinterest pi/SQLschool/
help@sqlschool.gr
Selecting and Sizing the Server
51th AUTOEXEC.GR EVENT
SQL Server places different demands on its underlying hardware depending on what
type of database workload is running against the instance of SQL Server
• OLTP workloads
• OLAP workloads
You also have to keep in mind that very few database workloads are pure OLTP- or
pure DW-type workloads, so you will often have to deal with mixed workload types.
You also might have to host multiple databases on a single SQL Server instance,
where each database has a different type of workload
Understanding your Workload
51th AUTOEXEC.GR EVENT
• Characterized by a high number
• of short-duration transactions
• and queries
that are usually executed on a single thread of execution.
• They can have a higher percentage of write activity
• The data in some tables can be extremely volatile.
• These characteristics have important implications for the
hardware selection and configuration process.
OLTP Workloads
51th AUTOEXEC.GR EVENT
• Characterized by longer running queries against more static data.
• These queries are often parallelized by the query optimizer, so having a higher
number of physical cores in your processors can be very beneficial.
• Having a large amount of physical RAM is very useful for DW
workloads
• Because you will be able to have more data in the SQL Server buffer cache, which
will reduce the read pressure on the I/O subsystem.
• Tends to have very little write activity
• DW-type queries read large amounts of data as they calculate aggregates
• So good sequential read I/O performance is very important.
• Which will also affect how you configure your I/O subsystem in terms of storage
type and RAID level
OLAP Workloads
51th AUTOEXEC.GR EVENT
• Server Processor Count Selection
• One common mistake is to assume that a “bigger” server in terms of
physical processor count is a faster server compared to a smaller server.
• Processor Vendor Selection
• Intel or AMD
• Processor Model Selection
• The performance of SQL Server is hugely dependent on the size of the L2
and L3 caches.
• Economizing on the L2 and L3 cache size is not usually an good choice.
Processor Selection
51th AUTOEXEC.GR EVENT
• The basic rule of thumb for SQL Server is that
• You can never have too much memory
• Total number of memory slots
• More slots is better
• SMP vs NUMA
Memory Selection
Selecting and Configuring Windows OS
51th AUTOEXEC.GR EVENT
• Windows Server 2012 R2
• Highly recommended especially for server than need to be
highly available.
• Avoid Windows Server 2008 R2 and older versions
Choosing Windows OS
51th AUTOEXEC.GR EVENT
• If you plan to use AlwaysOn AG it is important to apply the
following patches
• Windows Server 2008 R2 SP1 – KB2545685
• Windows Server 2012 – KB2784261
• Windows Server 2012 R2 – KB2920151
• Prerequisites, Restrictions, and Recommendations for AlwaysOn Availability
Groups
Apply patches and hotfixes on WinOS
51th AUTOEXEC.GR EVENT
• SQL Server does not need a giant page file
• If SQL Server is the major service on the box a 2GB page file
on system drive it’s enough
• Beware removing the page file (KB254649)
Configure the Windows page file
51th AUTOEXEC.GR EVENT
• Confirm that the Windows power plan is set to high
performance
• Confirm that the processors are running at full speed using
CPU-Z
Power Option
Setting Anti-Virus
51th AUTOEXEC.GR EVENT
• The servers is public on the Internet.
• The server have open ports to servers that are not behind a
firewall.
• The server read or execute files from other servers.
• The server run HTTP servers
• The server hosting file shares.
• The server use Database Mail to handle incoming or outgoing
email messages.
Use Anti-Virus when…
51th AUTOEXEC.GR EVENT
• Directories of SQL Server instance
• SQL Server data files
• SQL Server backup files
• Full-Text catalog files
• Trace files
• SQL audit files
• SQL query files
• SQL Server service
Setting Anti-Virus exclusions
Configuring Disks Storage subsystem
51th AUTOEXEC.GR EVENT
• Minimum RAID 1 for all drives
• Including OS system drive
• Even SSD or PCI-Express
• RAID 10 for best performance
• Use 128GB drive for OS system drive
• Test the I/O performance SQLIO/SQLIOSIM
Use RAID
51th AUTOEXEC.GR EVENT
• OS System drive should be formatted with the default (4K)
cluster size.
• All drives holding data & log files should be formatted with
64K cluster size
• Check your storage for partition alignment
• Follow this rule even if it’s a VM on shared storage
Disk Drive Format
51th AUTOEXEC.GR EVENT
• SQL Server application folders
• SQL Server database data files
• SQL Server database log file
• including TempDB
• TempDB data files
• Backups
Use separate drive for
Configuring Network
51th AUTOEXEC.GR EVENT
• The connectivity with SQL Server is important!
• You have Failover clustering or Availability Groups
• It’s a good practice even for standalone server
• Teaming NICs
Use Multiple Physical Network Cards when
Configuring Server for Security
and Performance
51th AUTOEXEC.GR EVENT
• Use dedicated domain user account with no special rights on
the domain.
• You do not need or want this account to be a local admin on
the machine where SQL Server will be installed.
• Use a separate, dedicated domain user account for the SQL
Server Agent service.
• If you are going to be installing and using other SQL Server
related services, you will want dedicated domain accounts for
each service.
SQL Server services accounts
51th AUTOEXEC.GR EVENT
• Enable Instant File Initialization
• Perform Volume Maintenance Tasks
• Grant Lock pages in memory
• Common on SQL Server 2005 / Windows 2003
• Less common with newer versions
(Still it is a good idea to enable LPIM on a new system)
• Add the permissions to the Service Account in AD - KB319723
• readServicePrincipalName
• writeServicePrincipalName
Policy Settings and Rights for the SQL Server service account
SQL Server Installation
51th AUTOEXEC.GR EVENT
• Install only the features you actually need
• This will reduce your attack surface
• It will speed future maintenance of the instance because there are fewer
components to patch
• Install Services Packs or CUs
• Enter a strong password for the sa account if you choose
Mixed Mode authentication
• Set the Data Directories according to plan
• Do not use C: drive
SQL Server Installation
Configuring SQL Server
51th AUTOEXEC.GR EVENT
• 1118
• This trace flag switches allocations in tempdb from single-page at a time for
the first 8 pages, to immediately allocate an extent (8 pages).
• 2371
• that you can use to control when the query optimizer generates autostats
on a table
Trace Flags to enable
51th AUTOEXEC.GR EVENT
• Enable compressed backups
• Setting Default backup media retention (days)
• Setting Database default location for
• Data files
• Log files
• Backups
Server Properties
51th AUTOEXEC.GR EVENT
• Max Worker Threads
• Priority Boost
• Lightweight Pooling
• Maximum number of concurrent connections
• Network Packet Size
Server Properties
51th AUTOEXEC.GR EVENT
• Set Max Server Memory
• Important when LPIM is enabled
• Use this formula to calculate SQL Server
Memory
• Reserve 1GB for OS
• Reserve 1GB for each 4GB after the first 4GB and until
16GB
• Reserve 1GB for each 8GB after the first 16GB
• Monitor the Memory:Available MB
performance counter
SQL Server Memory
Server Memory 64GB
1GB for OS
3GB for 4-16GB
6GB for 16-64GB
10GB in total
64-10 = 54 Max SQL
Server memory
51th AUTOEXEC.GR EVENT
• Change the default size for data and log files
• Change the file growth to fixed units
Tweak Model database
51th AUTOEXEC.GR EVENT
• Move TempDB to its own drive
• Grow the size of data file
• Add additional data files as the number of logical processors
up to 8 logical CPUs
• Each file must have the same size
• Pre-allocate the space.
• KB2154845
Configure TempDB
51th AUTOEXEC.GR EVENT
• Set this to the number of physical cores in a single NUMA
node socket on your hardware or less
• Always use an even value
• Use the value of 1 only of you have specific vendor
requirements
• SharePoint
• BizTalk
• SAP
• KB2806353
Configure MAXDOP
51th AUTOEXEC.GR EVENT
• General default value of 5 is low for most OLTP workloads
and should be increased.
• Base value of 20-25 used for most server installs.
Cost Threshold of Parallelism
51th AUTOEXEC.GR EVENT
• Control the amount of memory that is used by single-use, ad
hoc query plans in the plan cache.
• SQL Server store only a small stub of an ad hoc query plan in
the plan cache the first time that the ad hoc plan is executed
• Reduces the memory required for that plan in the plan cache.
• It’s not a panacea for single-use ad hoc query plans
• http://www.sqlschool.gr/blog/do-you-have-optimize-for-ad-
hoc-workloads-on-sql-server-2008-r2-instances-380.aspx
Optimize for Ad-hoc workloads
51th AUTOEXEC.GR EVENT
• Enable TCP/IP
• Firewall exceptions
• TCP port of instance
• UTP 1434 for SQL Browser
SQL Server Network Connectivity
51th AUTOEXEC.GR EVENT
• Configure Database Mail
• Create Operators
• Configure SQL Agent to use Database Mail
• Create Alerts for Severity 16 to 25
• Create Alerts for Errors 823, 824, 825
• Adding Ola Hallengren’s Maintenance Solution
• Install Adam Machanic sp_WhoIsActive
• Install and run Brent Ozar sp_Blitz
Configure Alerting and Monitoring
User Databases Creation
51th AUTOEXEC.GR EVENT
• Don’t use the default file size
• Don’t use presentence as file growth
• Pay attention on T-Log size and growth to produce equal
VLFs
• Use more than one filegroups
• In PRIMARY leave system object
• Put all user objects to another filegroup
• Use more than one data files
• Even this are in the same drive
Create Database
51th AUTOEXEC.GR EVENT
• Don’t set Auto Close
• Don’t set Auto Shrink
• Don’t unset Auto Create/Update Statistics
Database Properties
Pre and post tips to installing sql server correctly
SELECT
KNOWLEDGE
FROM
SQL SERVER
http://www.sqlschool.gr
Copyright © 2015 SQL School Greece
1 of 46

Recommended

Configuring sql server - SQL Saturday, Athens Oct 2014 by
Configuring sql server - SQL Saturday, Athens Oct 2014Configuring sql server - SQL Saturday, Athens Oct 2014
Configuring sql server - SQL Saturday, Athens Oct 2014Antonios Chatzipavlis
1.4K views38 slides
Troubleshooting sql server by
Troubleshooting sql serverTroubleshooting sql server
Troubleshooting sql serverAntonios Chatzipavlis
1.6K views40 slides
Tips to install and manage always on availability groups in sql server 2012 &... by
Tips to install and manage always on availability groups in sql server 2012 &...Tips to install and manage always on availability groups in sql server 2012 &...
Tips to install and manage always on availability groups in sql server 2012 &...Antonios Chatzipavlis
5.7K views19 slides
Sql server 2014 online operations by
Sql server 2014 online operationsSql server 2014 online operations
Sql server 2014 online operationsAntonios Chatzipavlis
691 views22 slides
Sql server troubleshooting by
Sql server troubleshootingSql server troubleshooting
Sql server troubleshootingNathan Winters
1.2K views24 slides
SQL Server High Availability Solutions (Pros & Cons) by
SQL Server High Availability Solutions (Pros & Cons)SQL Server High Availability Solutions (Pros & Cons)
SQL Server High Availability Solutions (Pros & Cons)Hamid J. Fard
10.2K views5 slides

More Related Content

What's hot

Sql server 2012 ha dr 24_hop_final by
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
2K views48 slides
SQL Server AlwaysOn for Dummies SQLSaturday #202 Edition by
SQL Server AlwaysOn for Dummies SQLSaturday #202 EditionSQL Server AlwaysOn for Dummies SQLSaturday #202 Edition
SQL Server AlwaysOn for Dummies SQLSaturday #202 EditionMark Broadbent
5K views33 slides
Microsoft Azure, My First IaaS by
Microsoft Azure, My First IaaSMicrosoft Azure, My First IaaS
Microsoft Azure, My First IaaSJohn Martin
420 views18 slides
AUDWC 2016 - Using SQL Server 20146 AlwaysOn Availability Groups for SharePoi... by
AUDWC 2016 - Using SQL Server 20146 AlwaysOn Availability Groups for SharePoi...AUDWC 2016 - Using SQL Server 20146 AlwaysOn Availability Groups for SharePoi...
AUDWC 2016 - Using SQL Server 20146 AlwaysOn Availability Groups for SharePoi...Michael Noel
2.1K views28 slides
Alwayson AG enhancements by
Alwayson AG enhancementsAlwayson AG enhancements
Alwayson AG enhancementsHarsh Chawla
1.1K views19 slides
Implementing sql server always on by
Implementing sql server always onImplementing sql server always on
Implementing sql server always onSarabpreet Anand
2.9K views12 slides

What's hot(20)

SQL Server AlwaysOn for Dummies SQLSaturday #202 Edition by Mark Broadbent
SQL Server AlwaysOn for Dummies SQLSaturday #202 EditionSQL Server AlwaysOn for Dummies SQLSaturday #202 Edition
SQL Server AlwaysOn for Dummies SQLSaturday #202 Edition
Mark Broadbent5K views
Microsoft Azure, My First IaaS by John Martin
Microsoft Azure, My First IaaSMicrosoft Azure, My First IaaS
Microsoft Azure, My First IaaS
John Martin420 views
AUDWC 2016 - Using SQL Server 20146 AlwaysOn Availability Groups for SharePoi... by Michael Noel
AUDWC 2016 - Using SQL Server 20146 AlwaysOn Availability Groups for SharePoi...AUDWC 2016 - Using SQL Server 20146 AlwaysOn Availability Groups for SharePoi...
AUDWC 2016 - Using SQL Server 20146 AlwaysOn Availability Groups for SharePoi...
Michael Noel2.1K views
Alwayson AG enhancements by Harsh Chawla
Alwayson AG enhancementsAlwayson AG enhancements
Alwayson AG enhancements
Harsh Chawla1.1K views
Implementing sql server always on by Sarabpreet Anand
Implementing sql server always onImplementing sql server always on
Implementing sql server always on
Sarabpreet Anand2.9K views
Sql server 2012 - always on deep dive - bob duffy by Anuradha
Sql server 2012 - always on deep dive - bob duffySql server 2012 - always on deep dive - bob duffy
Sql server 2012 - always on deep dive - bob duffy
Anuradha 3K views
End-to-end Troubleshooting Checklist for Microsoft SQL Server by Kevin Kline
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
Kevin Kline5.7K views
Microsoft SQL Server Query Tuning by Mark Ginnebaugh
Microsoft SQL Server Query TuningMicrosoft SQL Server Query Tuning
Microsoft SQL Server Query Tuning
Mark Ginnebaugh2.4K views
KoprowskiT_SQLSat219_Kiev_2AM-aDisasterJustbegan by Tobias Koprowski
KoprowskiT_SQLSat219_Kiev_2AM-aDisasterJustbeganKoprowskiT_SQLSat219_Kiev_2AM-aDisasterJustbegan
KoprowskiT_SQLSat219_Kiev_2AM-aDisasterJustbegan
Tobias Koprowski445 views
Configurando Aplicaciones para Réplicas de Lectura de SQL-Server AlwaysOn - C... by SpanishPASSVC
Configurando Aplicaciones para Réplicas de Lectura de SQL-Server AlwaysOn - C...Configurando Aplicaciones para Réplicas de Lectura de SQL-Server AlwaysOn - C...
Configurando Aplicaciones para Réplicas de Lectura de SQL-Server AlwaysOn - C...
SpanishPASSVC1.3K views
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners by Tobias Koprowski
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginnersSQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
Tobias Koprowski555 views
Sql server backup internals by Hamid J. Fard
Sql server backup internalsSql server backup internals
Sql server backup internals
Hamid J. Fard861 views
High Availability & Disaster Recovery with SQL Server 2012 AlwaysOn Availabil... by turgaysahtiyan
High Availability & Disaster Recovery with SQL Server 2012 AlwaysOn Availabil...High Availability & Disaster Recovery with SQL Server 2012 AlwaysOn Availabil...
High Availability & Disaster Recovery with SQL Server 2012 AlwaysOn Availabil...
turgaysahtiyan1.8K views
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer by Marek Maśko
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft EngineerPLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
Marek Maśko545 views
KoprowskiT_it_camp2013 - 2amADisasterJustBegan by Tobias Koprowski
KoprowskiT_it_camp2013 - 2amADisasterJustBeganKoprowskiT_it_camp2013 - 2amADisasterJustBegan
KoprowskiT_it_camp2013 - 2amADisasterJustBegan
Tobias Koprowski864 views
SQL 2012 AlwaysOn Availability Groups for SharePoint 2013 - SharePoint Connec... by Michael Noel
SQL 2012 AlwaysOn Availability Groups for SharePoint 2013 - SharePoint Connec...SQL 2012 AlwaysOn Availability Groups for SharePoint 2013 - SharePoint Connec...
SQL 2012 AlwaysOn Availability Groups for SharePoint 2013 - SharePoint Connec...
Michael Noel11.8K views

Viewers also liked

Stretch db sql server 2016 (sn0028) by
Stretch db   sql server 2016 (sn0028)Stretch db   sql server 2016 (sn0028)
Stretch db sql server 2016 (sn0028)Antonios Chatzipavlis
893 views33 slides
Department Row Level Security Customization For People Soft General Ledger.Ppt by
Department Row Level Security Customization For People Soft General Ledger.PptDepartment Row Level Security Customization For People Soft General Ledger.Ppt
Department Row Level Security Customization For People Soft General Ledger.Pptwonga6
1.2K views23 slides
Auditing Data Access in SQL Server by
Auditing Data Access in SQL ServerAuditing Data Access in SQL Server
Auditing Data Access in SQL ServerAntonios Chatzipavlis
1.3K views45 slides
Project 2 Final presentation. December 2016 by
Project 2 Final presentation. December 2016Project 2 Final presentation. December 2016
Project 2 Final presentation. December 2016enterpriseresearchcentre
172 views22 slides
Row level security by
Row level securityRow level security
Row level securityAntonios Chatzipavlis
1.9K views25 slides
Implementing Mobile Reports in SQL Sserver 2016 Reporting Services by
Implementing Mobile Reports in SQL Sserver 2016 Reporting ServicesImplementing Mobile Reports in SQL Sserver 2016 Reporting Services
Implementing Mobile Reports in SQL Sserver 2016 Reporting ServicesAntonios Chatzipavlis
770 views35 slides

Viewers also liked(18)

Department Row Level Security Customization For People Soft General Ledger.Ppt by wonga6
Department Row Level Security Customization For People Soft General Ledger.PptDepartment Row Level Security Customization For People Soft General Ledger.Ppt
Department Row Level Security Customization For People Soft General Ledger.Ppt
wonga61.2K views
Implementing Mobile Reports in SQL Sserver 2016 Reporting Services by Antonios Chatzipavlis
Implementing Mobile Reports in SQL Sserver 2016 Reporting ServicesImplementing Mobile Reports in SQL Sserver 2016 Reporting Services
Implementing Mobile Reports in SQL Sserver 2016 Reporting Services
What's New for the BI workload in SharePoint 2016 and SQL Server 2016 by SPC Adriatics
What's New for the BI workload in SharePoint 2016 and SQL Server 2016What's New for the BI workload in SharePoint 2016 and SQL Server 2016
What's New for the BI workload in SharePoint 2016 and SQL Server 2016
SPC Adriatics974 views
Live Query Statistics & Query Store in SQL Server 2016 by Antonios Chatzipavlis
Live Query Statistics & Query Store in SQL Server 2016Live Query Statistics & Query Store in SQL Server 2016
Live Query Statistics & Query Store in SQL Server 2016
How to secure your data in Office 365 by SPC Adriatics
How to secure your data in Office 365 How to secure your data in Office 365
How to secure your data in Office 365
SPC Adriatics682 views
Automating Big Data (Dec-2016) by Seth Familian
Automating Big Data  (Dec-2016)Automating Big Data  (Dec-2016)
Automating Big Data (Dec-2016)
Seth Familian2.4K views
Working With Big Data - Nov 2016 by Seth Familian
Working With Big Data - Nov 2016Working With Big Data - Nov 2016
Working With Big Data - Nov 2016
Seth Familian2.3K views
Designing Teams for Emerging Challenges by Aaron Irizarry
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging Challenges
Aaron Irizarry1.1M views
Visual Design with Data by Seth Familian
Visual Design with DataVisual Design with Data
Visual Design with Data
Seth Familian2.9M views

Similar to Pre and post tips to installing sql server correctly

ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review by
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
600 views24 slides
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle by
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle Ashnikbiz
4.6K views56 slides
Configuring Sage 500 for Performance by
Configuring Sage 500 for PerformanceConfiguring Sage 500 for Performance
Configuring Sage 500 for PerformanceRKLeSolutions
223 views44 slides
Common SQL Server Mistakes and How to Avoid Them with Tim Radney by
Common SQL Server Mistakes and How to Avoid Them with Tim RadneyCommon SQL Server Mistakes and How to Avoid Them with Tim Radney
Common SQL Server Mistakes and How to Avoid Them with Tim RadneyEmbarcadero Technologies
472 views13 slides
SharePoint 2013 Performance Analysis - Robi Vončina by
SharePoint 2013 Performance Analysis - Robi VončinaSharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSPC Adriatics
6.5K views54 slides
Optimization SQL Server for Dynamics AX 2012 R3 by
Optimization SQL Server for Dynamics AX 2012 R3Optimization SQL Server for Dynamics AX 2012 R3
Optimization SQL Server for Dynamics AX 2012 R3Juan Fabian
4.5K views29 slides

Similar to Pre and post tips to installing sql server correctly(20)

ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review by Kenny Buntinx
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
Kenny Buntinx600 views
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle by Ashnikbiz
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle
Ashnikbiz4.6K views
Configuring Sage 500 for Performance by RKLeSolutions
Configuring Sage 500 for PerformanceConfiguring Sage 500 for Performance
Configuring Sage 500 for Performance
RKLeSolutions223 views
SharePoint 2013 Performance Analysis - Robi Vončina by SPC Adriatics
SharePoint 2013 Performance Analysis - Robi VončinaSharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi Vončina
SPC Adriatics6.5K views
Optimization SQL Server for Dynamics AX 2012 R3 by Juan Fabian
Optimization SQL Server for Dynamics AX 2012 R3Optimization SQL Server for Dynamics AX 2012 R3
Optimization SQL Server for Dynamics AX 2012 R3
Juan Fabian4.5K views
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning by Severalnines
Webinar slides: Our Guide to MySQL & MariaDB Performance TuningWebinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Severalnines947 views
Technical Introduction to PostgreSQL and PPAS by Ashnikbiz
Technical Introduction to PostgreSQL and PPASTechnical Introduction to PostgreSQL and PPAS
Technical Introduction to PostgreSQL and PPAS
Ashnikbiz5.5K views
NGENSTOR_ODA_P2V_V5 by UniFabric
NGENSTOR_ODA_P2V_V5NGENSTOR_ODA_P2V_V5
NGENSTOR_ODA_P2V_V5
UniFabric362 views
MySQL Performance Tuning at COSCUP 2014 by Ryusuke Kajiyama
MySQL Performance Tuning at COSCUP 2014MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014
Ryusuke Kajiyama9.2K views
VMworld Europe 2014: Advanced SQL Server on vSphere Techniques and Best Pract... by VMworld
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...
VMworld972 views
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20... by LarryZaman
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
LarryZaman5 views
Pascal benois performance_troubleshooting-spsbe18 by BIWUG
Pascal benois performance_troubleshooting-spsbe18Pascal benois performance_troubleshooting-spsbe18
Pascal benois performance_troubleshooting-spsbe18
BIWUG471 views
SQL 2014 In-Memory OLTP by Amber Keyse
SQL 2014 In-Memory  OLTPSQL 2014 In-Memory  OLTP
SQL 2014 In-Memory OLTP
Amber Keyse251 views
Powering GIS Application with PostgreSQL and Postgres Plus by Ashnikbiz
Powering GIS Application with PostgreSQL and Postgres Plus Powering GIS Application with PostgreSQL and Postgres Plus
Powering GIS Application with PostgreSQL and Postgres Plus
Ashnikbiz1.8K views
Databases love nutanix by NEXTtour
Databases love nutanixDatabases love nutanix
Databases love nutanix
NEXTtour2.2K views
Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA... by Maaz Anjum
Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...
Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...
Maaz Anjum638 views

More from Antonios Chatzipavlis

Data virtualization using polybase by
Data virtualization using polybaseData virtualization using polybase
Data virtualization using polybaseAntonios Chatzipavlis
351 views36 slides
SQL server Backup Restore Revealed by
SQL server Backup Restore RevealedSQL server Backup Restore Revealed
SQL server Backup Restore RevealedAntonios Chatzipavlis
455 views70 slides
Migrate SQL Workloads to Azure by
Migrate SQL Workloads to AzureMigrate SQL Workloads to Azure
Migrate SQL Workloads to AzureAntonios Chatzipavlis
328 views46 slides
Machine Learning in SQL Server 2019 by
Machine Learning in SQL Server 2019Machine Learning in SQL Server 2019
Machine Learning in SQL Server 2019Antonios Chatzipavlis
289 views35 slides
Workload Management in SQL Server 2019 by
Workload Management in SQL Server 2019Workload Management in SQL Server 2019
Workload Management in SQL Server 2019Antonios Chatzipavlis
291 views23 slides
Loading Data into Azure SQL DW (Synapse Analytics) by
Loading Data into Azure SQL DW (Synapse Analytics)Loading Data into Azure SQL DW (Synapse Analytics)
Loading Data into Azure SQL DW (Synapse Analytics)Antonios Chatzipavlis
552 views17 slides

More from Antonios Chatzipavlis(20)

Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018 by Antonios Chatzipavlis
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018 Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018

Recently uploaded

Empathic Computing: Delivering the Potential of the Metaverse by
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the MetaverseMark Billinghurst
470 views80 slides
Transcript: The Details of Description Techniques tips and tangents on altern... by
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...BookNet Canada
130 views15 slides
Lilypad @ Labweek, Istanbul, 2023.pdf by
Lilypad @ Labweek, Istanbul, 2023.pdfLilypad @ Labweek, Istanbul, 2023.pdf
Lilypad @ Labweek, Istanbul, 2023.pdfAlly339821
9 views45 slides
From chaos to control: Managing migrations and Microsoft 365 with ShareGate! by
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!From chaos to control: Managing migrations and Microsoft 365 with ShareGate!
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!sammart93
9 views39 slides
Tunable Laser (1).pptx by
Tunable Laser (1).pptxTunable Laser (1).pptx
Tunable Laser (1).pptxHajira Mahmood
23 views37 slides
The details of description: Techniques, tips, and tangents on alternative tex... by
The details of description: Techniques, tips, and tangents on alternative tex...The details of description: Techniques, tips, and tangents on alternative tex...
The details of description: Techniques, tips, and tangents on alternative tex...BookNet Canada
121 views24 slides

Recently uploaded(20)

Empathic Computing: Delivering the Potential of the Metaverse by Mark Billinghurst
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the Metaverse
Mark Billinghurst470 views
Transcript: The Details of Description Techniques tips and tangents on altern... by BookNet Canada
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...
BookNet Canada130 views
Lilypad @ Labweek, Istanbul, 2023.pdf by Ally339821
Lilypad @ Labweek, Istanbul, 2023.pdfLilypad @ Labweek, Istanbul, 2023.pdf
Lilypad @ Labweek, Istanbul, 2023.pdf
Ally3398219 views
From chaos to control: Managing migrations and Microsoft 365 with ShareGate! by sammart93
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!From chaos to control: Managing migrations and Microsoft 365 with ShareGate!
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!
sammart939 views
The details of description: Techniques, tips, and tangents on alternative tex... by BookNet Canada
The details of description: Techniques, tips, and tangents on alternative tex...The details of description: Techniques, tips, and tangents on alternative tex...
The details of description: Techniques, tips, and tangents on alternative tex...
BookNet Canada121 views
Piloting & Scaling Successfully With Microsoft Viva by Richard Harbridge
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft Viva
Special_edition_innovator_2023.pdf by WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2216 views
Web Dev - 1 PPT.pdf by gdsczhcet
Web Dev - 1 PPT.pdfWeb Dev - 1 PPT.pdf
Web Dev - 1 PPT.pdf
gdsczhcet55 views
PharoJS - Zürich Smalltalk Group Meetup November 2023 by Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi120 views
Data-centric AI and the convergence of data and model engineering: opportunit... by Paolo Missier
Data-centric AI and the convergence of data and model engineering:opportunit...Data-centric AI and the convergence of data and model engineering:opportunit...
Data-centric AI and the convergence of data and model engineering: opportunit...
Paolo Missier34 views
1st parposal presentation.pptx by i238212
1st parposal presentation.pptx1st parposal presentation.pptx
1st parposal presentation.pptx
i2382129 views
Five Things You SHOULD Know About Postman by Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman27 views
Perth MeetUp November 2023 by Michael Price
Perth MeetUp November 2023 Perth MeetUp November 2023
Perth MeetUp November 2023
Michael Price15 views

Pre and post tips to installing sql server correctly

  • 1. th EVENT Pre and Post tips to Installing SQL Server correctly SQL Server 2008, 2008R2, 2012,2014Antonios Chatzipavlis Database Architect • SQL Server Evangelist • Trainer MCT, MCSE, MCITP, MCPD,MCSD,MCDBA,MCSA,MCTS, MCAD,MCP, OCA,ITIL-F Jan 22, 2015 51
  • 2. I have been started with computers. I started my professional carrier in computers industry. I have been started to work with SQL Server version 6.0 I earned my first certification at Microsoft as Microsoft Certified Solution Developer (3rd in Greece) and started my carrier as Microsoft Certified Trainer (MCT) with more than 20.000 hours of training until now! I became for first time Microsoft MVP on SQL Server I created the SQL School Greece (www.sqlschool.gr) I became MCT Regional Lead by Microsoft Learning Program. I was certified as MCSE : Data Platform, MCSE: Business Intelligence Antonios Chatzipavlis Database Architect • SQL Server Evangelist • Trainer • Speaker MCT, MCSE, MCITP, MCPD, MCSD, MCDBA, MCSA, MCTS, MCAD, MCP, OCA, ITIL-F  1982  1988  1996  1998  2010  2012  2013
  • 3. Follow us in social media Twitter @antoniosch / @sqlschool Facebook fb/sqlschoolgr YouTube yt/user/achatzipavlis LinkedIn SQL School Greece group Pinterest pi/SQLschool/
  • 5. Selecting and Sizing the Server
  • 6. 51th AUTOEXEC.GR EVENT SQL Server places different demands on its underlying hardware depending on what type of database workload is running against the instance of SQL Server • OLTP workloads • OLAP workloads You also have to keep in mind that very few database workloads are pure OLTP- or pure DW-type workloads, so you will often have to deal with mixed workload types. You also might have to host multiple databases on a single SQL Server instance, where each database has a different type of workload Understanding your Workload
  • 7. 51th AUTOEXEC.GR EVENT • Characterized by a high number • of short-duration transactions • and queries that are usually executed on a single thread of execution. • They can have a higher percentage of write activity • The data in some tables can be extremely volatile. • These characteristics have important implications for the hardware selection and configuration process. OLTP Workloads
  • 8. 51th AUTOEXEC.GR EVENT • Characterized by longer running queries against more static data. • These queries are often parallelized by the query optimizer, so having a higher number of physical cores in your processors can be very beneficial. • Having a large amount of physical RAM is very useful for DW workloads • Because you will be able to have more data in the SQL Server buffer cache, which will reduce the read pressure on the I/O subsystem. • Tends to have very little write activity • DW-type queries read large amounts of data as they calculate aggregates • So good sequential read I/O performance is very important. • Which will also affect how you configure your I/O subsystem in terms of storage type and RAID level OLAP Workloads
  • 9. 51th AUTOEXEC.GR EVENT • Server Processor Count Selection • One common mistake is to assume that a “bigger” server in terms of physical processor count is a faster server compared to a smaller server. • Processor Vendor Selection • Intel or AMD • Processor Model Selection • The performance of SQL Server is hugely dependent on the size of the L2 and L3 caches. • Economizing on the L2 and L3 cache size is not usually an good choice. Processor Selection
  • 10. 51th AUTOEXEC.GR EVENT • The basic rule of thumb for SQL Server is that • You can never have too much memory • Total number of memory slots • More slots is better • SMP vs NUMA Memory Selection
  • 12. 51th AUTOEXEC.GR EVENT • Windows Server 2012 R2 • Highly recommended especially for server than need to be highly available. • Avoid Windows Server 2008 R2 and older versions Choosing Windows OS
  • 13. 51th AUTOEXEC.GR EVENT • If you plan to use AlwaysOn AG it is important to apply the following patches • Windows Server 2008 R2 SP1 – KB2545685 • Windows Server 2012 – KB2784261 • Windows Server 2012 R2 – KB2920151 • Prerequisites, Restrictions, and Recommendations for AlwaysOn Availability Groups Apply patches and hotfixes on WinOS
  • 14. 51th AUTOEXEC.GR EVENT • SQL Server does not need a giant page file • If SQL Server is the major service on the box a 2GB page file on system drive it’s enough • Beware removing the page file (KB254649) Configure the Windows page file
  • 15. 51th AUTOEXEC.GR EVENT • Confirm that the Windows power plan is set to high performance • Confirm that the processors are running at full speed using CPU-Z Power Option
  • 17. 51th AUTOEXEC.GR EVENT • The servers is public on the Internet. • The server have open ports to servers that are not behind a firewall. • The server read or execute files from other servers. • The server run HTTP servers • The server hosting file shares. • The server use Database Mail to handle incoming or outgoing email messages. Use Anti-Virus when…
  • 18. 51th AUTOEXEC.GR EVENT • Directories of SQL Server instance • SQL Server data files • SQL Server backup files • Full-Text catalog files • Trace files • SQL audit files • SQL query files • SQL Server service Setting Anti-Virus exclusions
  • 20. 51th AUTOEXEC.GR EVENT • Minimum RAID 1 for all drives • Including OS system drive • Even SSD or PCI-Express • RAID 10 for best performance • Use 128GB drive for OS system drive • Test the I/O performance SQLIO/SQLIOSIM Use RAID
  • 21. 51th AUTOEXEC.GR EVENT • OS System drive should be formatted with the default (4K) cluster size. • All drives holding data & log files should be formatted with 64K cluster size • Check your storage for partition alignment • Follow this rule even if it’s a VM on shared storage Disk Drive Format
  • 22. 51th AUTOEXEC.GR EVENT • SQL Server application folders • SQL Server database data files • SQL Server database log file • including TempDB • TempDB data files • Backups Use separate drive for
  • 24. 51th AUTOEXEC.GR EVENT • The connectivity with SQL Server is important! • You have Failover clustering or Availability Groups • It’s a good practice even for standalone server • Teaming NICs Use Multiple Physical Network Cards when
  • 25. Configuring Server for Security and Performance
  • 26. 51th AUTOEXEC.GR EVENT • Use dedicated domain user account with no special rights on the domain. • You do not need or want this account to be a local admin on the machine where SQL Server will be installed. • Use a separate, dedicated domain user account for the SQL Server Agent service. • If you are going to be installing and using other SQL Server related services, you will want dedicated domain accounts for each service. SQL Server services accounts
  • 27. 51th AUTOEXEC.GR EVENT • Enable Instant File Initialization • Perform Volume Maintenance Tasks • Grant Lock pages in memory • Common on SQL Server 2005 / Windows 2003 • Less common with newer versions (Still it is a good idea to enable LPIM on a new system) • Add the permissions to the Service Account in AD - KB319723 • readServicePrincipalName • writeServicePrincipalName Policy Settings and Rights for the SQL Server service account
  • 29. 51th AUTOEXEC.GR EVENT • Install only the features you actually need • This will reduce your attack surface • It will speed future maintenance of the instance because there are fewer components to patch • Install Services Packs or CUs • Enter a strong password for the sa account if you choose Mixed Mode authentication • Set the Data Directories according to plan • Do not use C: drive SQL Server Installation
  • 31. 51th AUTOEXEC.GR EVENT • 1118 • This trace flag switches allocations in tempdb from single-page at a time for the first 8 pages, to immediately allocate an extent (8 pages). • 2371 • that you can use to control when the query optimizer generates autostats on a table Trace Flags to enable
  • 32. 51th AUTOEXEC.GR EVENT • Enable compressed backups • Setting Default backup media retention (days) • Setting Database default location for • Data files • Log files • Backups Server Properties
  • 33. 51th AUTOEXEC.GR EVENT • Max Worker Threads • Priority Boost • Lightweight Pooling • Maximum number of concurrent connections • Network Packet Size Server Properties
  • 34. 51th AUTOEXEC.GR EVENT • Set Max Server Memory • Important when LPIM is enabled • Use this formula to calculate SQL Server Memory • Reserve 1GB for OS • Reserve 1GB for each 4GB after the first 4GB and until 16GB • Reserve 1GB for each 8GB after the first 16GB • Monitor the Memory:Available MB performance counter SQL Server Memory Server Memory 64GB 1GB for OS 3GB for 4-16GB 6GB for 16-64GB 10GB in total 64-10 = 54 Max SQL Server memory
  • 35. 51th AUTOEXEC.GR EVENT • Change the default size for data and log files • Change the file growth to fixed units Tweak Model database
  • 36. 51th AUTOEXEC.GR EVENT • Move TempDB to its own drive • Grow the size of data file • Add additional data files as the number of logical processors up to 8 logical CPUs • Each file must have the same size • Pre-allocate the space. • KB2154845 Configure TempDB
  • 37. 51th AUTOEXEC.GR EVENT • Set this to the number of physical cores in a single NUMA node socket on your hardware or less • Always use an even value • Use the value of 1 only of you have specific vendor requirements • SharePoint • BizTalk • SAP • KB2806353 Configure MAXDOP
  • 38. 51th AUTOEXEC.GR EVENT • General default value of 5 is low for most OLTP workloads and should be increased. • Base value of 20-25 used for most server installs. Cost Threshold of Parallelism
  • 39. 51th AUTOEXEC.GR EVENT • Control the amount of memory that is used by single-use, ad hoc query plans in the plan cache. • SQL Server store only a small stub of an ad hoc query plan in the plan cache the first time that the ad hoc plan is executed • Reduces the memory required for that plan in the plan cache. • It’s not a panacea for single-use ad hoc query plans • http://www.sqlschool.gr/blog/do-you-have-optimize-for-ad- hoc-workloads-on-sql-server-2008-r2-instances-380.aspx Optimize for Ad-hoc workloads
  • 40. 51th AUTOEXEC.GR EVENT • Enable TCP/IP • Firewall exceptions • TCP port of instance • UTP 1434 for SQL Browser SQL Server Network Connectivity
  • 41. 51th AUTOEXEC.GR EVENT • Configure Database Mail • Create Operators • Configure SQL Agent to use Database Mail • Create Alerts for Severity 16 to 25 • Create Alerts for Errors 823, 824, 825 • Adding Ola Hallengren’s Maintenance Solution • Install Adam Machanic sp_WhoIsActive • Install and run Brent Ozar sp_Blitz Configure Alerting and Monitoring
  • 43. 51th AUTOEXEC.GR EVENT • Don’t use the default file size • Don’t use presentence as file growth • Pay attention on T-Log size and growth to produce equal VLFs • Use more than one filegroups • In PRIMARY leave system object • Put all user objects to another filegroup • Use more than one data files • Even this are in the same drive Create Database
  • 44. 51th AUTOEXEC.GR EVENT • Don’t set Auto Close • Don’t set Auto Shrink • Don’t unset Auto Create/Update Statistics Database Properties