Beruflich Dokumente
Kultur Dokumente
Professional Services
Agenda
• Windows Server
• SQL Server Instance
• SQL Server Database
• Virtualization
Windows Server
OS Configuration Options
• Partition disk volumes hosting database files with
64 KB allocation unit size
• Exclude SQL Server files from AntiVirus scans
• Lock Pages in Memory
• Set Power Savings setting to High Performance
• Instant File Initialization
Hardware Power Management
Server BIOS Processor Specs & More
www.cpuid.com/softwares/cpu-z.html
Power Management
Windows Power Plans
Use cases:
• # of cores exceeds SQL Server limits
• Multiple instances on a server
How to:
• SSMS GUI
Server Properties: Processors
• T-SQL
ALTER SERVER CONFIGURATION
SET PROCESS AFFINITY CPU = 0 TO 7,16 TO 25
Memory Impacting Settings
min server memory
max server memory
ALWAYS change from default setting
Clustered instances
Same numbers as above divided by the number of nodes in the cluster
SQL Server Database
Database settings
• auto close : off
• auto create incremental statistics : depends
• auto create statistics : on
• auto shrink : off
• auto update statistics : on
• auto update statistics asynchronously : depends
Database settings
• compatibility level: match to instance compatibility when possible
• file autogrowth: use MB/GB, not Percent
pre-size files to minimize autogrow events
• max size: sum for all db files not to exceed drive size
• delayed durability
commit data changes before they are written to the transaction log
ALTER DATABASE dbname
SET DELAYED_DURABILITY = DISABLED | ALLOWED | FORCED;
Database Scoped Configuration
• Manage optional configuration values to control performance and
behavior at database level
• Available in SQL Server 2016 and later (and Azure SQL DB)
• Benefits:
• Define configuration options at the database level
• Isolate database level behaviors within an instance
• Grant database level permissions to manage configurations
• Set configuration options separately for primary and secondary
replicas in an availability group
Database Scoped Configuration
• MAXDOP
• LEGACY_CARDINALITY_ESTIMATION (TF 9841)
• PARAMETER_SNIFFING (TF 4136)
• QUERY_OPTIMIZER_HOTFIXES
• CLEAR PROCEDURE_CACHE
• IDENTITY_CACHE (SQL Server 2017)
• ELEVATE_RESUMABLE (SQL Server 2019)
• DISABLE_INTERLEAVED_EXECUTION_TVF (SQL Server 2017)
• DISABLE_BATCH_MODE_ADAPTIVE_JOINS (SQL Server 2017
Database Scoped Configuration
Examples:
GRANT ALTER ANY DATABASE SCOPED CONFIGURATION TO [Joe];
ALTER DATABASE SCOPED CONFIGURATION
SET BATCH_MODE_ON_ROWSTORE = ON;
ALTER DATABASE SCOPED CONFIGURATION
SET QUERY_OPTIMIZER_HOTFIXES = PRIMARY;
ALTER DATABASE SCOPED CONFIGURATION FOR SECONDARY
SET MAXDOP = 8;
ALTER DATABASE SCOPED CONFIGURATION
SET ELEVATE_RESUMABLE = WHEN SUPPORTED;
Database Maintenace & Performance
• Backup and Restore Operations
• Minimize Recovery Time
• Index Rebuild and Reorganization
• Update Statistics
Virtualization
Virtualization
• Right-sizing
• Power Management
• CPU Configurations
• Memory Options
• Storage Considerations
Virtualization Considerations (1)
• Don't over allocate CPUs
• Do not enable CPU Hot Add
• Memory
• Hyper-V: disable dynamic memory
• VMware: do not disable the ballon driver - monitor
7. TempDB Capacity Planning & Concurrency Considerations for Index Create and
Rebuild http://bit.ly/2CEgyaO
8. TempDB Database: SQL Docs
http://bit.ly/2FCvyrO
10. Recommended Updates & Configuration Options for SQL Server 2012 &
SQL Server 2014 with high-performance workloads https://bit.ly/2tJ9swX
**many trace flags mentioned in this article are default behavior for SQL Server 2016 and later
Resources
11. Proactive SQL Server Health Checks, Part 3: Instance and Database Settings
https://bit.ly/1KQE6E3
14. Decoupling of Cores per Socket from Virtual NUMA Topology in vSphere 6.5
https://bit.ly/2ELMgo8