SlideShare a Scribd company logo
1 of 39
SQL Server Tips From The Field
Three Things IT Leaders Need to Know…
Web: www.sqlwatchmen.com
Email: Jim.Murphy@sqlwatchmen.com
Twitter: @SQLMurph
Jim Murphy
CEO
SQLWatchmen, LLC.
Who is SQLWatchmen?
 DBA Services – performance tuning,
disaster recovery planning, maintenance
 SQL Programming - views, SPs,
triggers
 Integration Services - SSIS for trying
systems together
 Reporting - SSRS for custom analytics to
fill business needs
 Cloud Migration
2
 Austin based tech company
 Can serve as Remote / Fractional DBAs
 SQL Server Specialists (We work alongside
general tech consulting firms)
 Compliance (HIPAA, SOX, SOC2)
How can we assist you?
3
4
NEW IN 2017
BACKUPS
HA / DR
PERFORMANCE
CONCLUSION
DEMO
Database Performance and Speed Matter
55
6
1. Identifying the problem & why you should care
Problem:
 The database is the foundation of the entire
application or corporate stack. If the database
is slow…
2. There are many reasons for databases to get slower over time
(i.e. bottlenecks)
7
Cause is usually:
 CPU
 Memory
 Disk IO
 Network
3. Slow-downs happen when queries are inefficient
8
But Why Jim:
 More users
 More data
volume
 More complex
queries
4. Which solution is faster & cheaper?
9
Solution:
A. Upgrade hardware and migrate.
B. Figure out which queries are the biggest resource hogs
and make adjustments.
That doesn’t sound
cheap!
So offending queries
use far fewer resources.
5. Performance Tuning gets to the root cause of slowdowns
10
 Benefit = Lower Cost
 Benefit = Tuning is more effective at improving
speed & performance
6. Understanding how queries are processed
11
 SQL Server processes query; makes
Execution Plan
 Execution Plan cached;
remembered next time
 Ad hoc (one-time, on-demand)
queries can fill up the cache with lots
of these (inefficient)
 Stored Procedures reuse pre-cached
Execution Plans (more efficient)
12
Measuring results with Perfmon:
SQL Server Statistics -> Batch Executions/sec
Backups and Disaster
Recovery Plans are
not all created equal
13
14
1. Identifying the problem & why you should care
What’s the difference between a backup and a disaster recovery
plan?
15
2. There are lots of different technologies you might consider
using:
 VM Snapshots
 SAN Replication
 Volume Shadow Copy
 VEEAM
 SQL Dump Files – Microsoft recommended
16
3. Transaction Log explained
 Diary of data changes
 Diary won’t ‘clear’ (Truncate) and be reused until it is backed up (if
database in FULL mode)
 T-Log (.LDF file) will grow and grow until drive fills up
 DANGER! Full drive = corrupt database (and also bring it offline)!
17
4. Transaction Log explained (continued)
 FULL backup hurts performance
 Saves off all data pages with valid data on it
 Locks tables and indexes to access up to date data
 T-Log backup DOES NOT hurt performance
 T-Log is circular in usage. Segments (VLF)
 T-Log backup backs up each VLF & “truncates” T-Log
 Doesn’t lock tables
18
5. There are also 2 different recovery modes to consider:
SIMPLE
 Only non-production
 Uses Transaction Log for current
transactions only.
 T-Log only grows if a long transaction
with lots of data changes runs.
 No point-in-time recovery (can only
recover to most recent FULL or
Differential backup).
FULL
 Use for all Production databases.
 Keeps T-Log as diary for all data
changes until T-Log is backed up (and
also ‘replicated’ if an HA/DR technology
is configured).
 T-Log will grow until drive is filled if not
backed up.
 Can perform point-in-time recovery
(restore to an exact millisecond before a
disaster so no data is lost).
19
6. An example of Point in Time Recovery
Image Source: https://sqlbak.com/blog/sql-server-backup-and-restore/
20
PRO TIP
If T-Log backup is getting too big,
and you can’t backup or shrink
- Switch your Recovery Mode to Simple*
[ ]
21
Demo
High Availability / Disaster Recovery
(HA/DR)
is a set of procedures and methods
used for proactive disaster protection
22
23
1. Identifying the problem & why you should care
Reasons why you might want to consider HA/DR for your
company:
 What does High Availability mean?
 What is Disaster Recovery in this context?
 What is AlwaysOn?
 What are Availability Groups?
24
2. Solutions involve removing the single point of failure
 Clustering - redundant hardware
 RAID - redundant individual disks
 “Replication” - redundant databases
 Transactional Replication Issues
 Log Shipping Issues
 Mirroring Issues
25
3. Problems that arise with “Replication” methods
Transactional
Replication
MirroringLog Shipping
 No automatic failover.
 Secondary DB is not
really Online*.
 Single DB solution.
 Secondary offline
while restoring T-
Logs.
 Secondary database is
not Online.
 Single Mirror/ Secondary
only.
 SNAC/Failover Partner
in connection string.
What will AlwaysOn Solve?
 No automatic failover.
 Major headache.
 Higher
administration.
 Republish articles,
etc.
 Complicated
troubleshooting
26
4. AlwaysOn Solves World Hunger!
…and peace on earth and goodwill toward men.
 Automatic Failover
 Multiple Replicas (secondaries) – and readable!
 “Replication” - redundant databases
 Offload Backups, Reporting, etc.
 Availability Groups - assists with using multiple DBs
 Lower administrative costs
 Plus more!
27
5. There are a few requirements to consider
 Enterprise Edition
 AD for WSFC
 Nodes must be in the same domain
28
7. HA, DR, or Both?
 Synchronous
 Asynchronous
Sync Async
Legend
29
8. Listener
(Virtual Network Name)
Node 1 Node 2
DENALI02 DENALI03
VNN
Node 1 Node 2
30
What’s New in SQL Server 2017?
32
 Columnstore indexes for big data
 Query Store – better diagnostics for a DBA
 In-Memory Databases
 30x in-memory OLTP speed
 100x in-memory Columnstore speed
 Stretch databases (Auto-archiving)
 Always Encrypted (at rest, in motion, cloud)
 Temporal DB – track historical changes
 Row-level security.
 …and a lot more.
In case you missed these 2016 features…
What’s New in 2017…
33
 Always On Availibility Group – supporting the ability to cross database
transactions among all databases, as well as, clusterless support in
Availibility Groups.
 Machine Learning Services – SQL Server R Services have been
renamed in this release and now supports Python in addition to R.
 In-memory and memory-optimized object enhancements.
 SQL Server Reporting Services 2017 – the REST API and the “all in
one” on-premise, self-service Power BI.
 Scale Out for SSIS.
 Resumable online index rebuild – Pause & resume index builds to fit
your tight maintenance window. Each night, it can chip away a little at a
time.
 For a full list of details visit: https://docs.microsoft.com/en-us/sql/sql-
server/what-s-new-in-sql-server-2017
CONCLUSION
SQL Server is beautiful…
but it can be a beast[ ]
34
You don’t need new hardware -
Tune for Performance[ ]
35
Keep your backups secure.
Disaster recovery methods should
be tested!
[ ]
36
Treated properly, MS SQL Server
can contribute a solid foundation to
the efforts of any business ][
37
Next Steps
● For another slide deck that delves deeper on SQL backups -
visit http://www.sqlwatchmen.com/contact-us
● To check out if a Database Diagnostic Exam is right for you
-
visit http://www.sqlwatchmen.com/services/database-
diagnostic-analysis
38
Let us help you
Protect Your Data
][
39
QUESTIONS
www.sqlwatchmen.com
Jim.Murphy@sqlwatchmen.com
@SQLMurph

More Related Content

What's hot

MySQL Enterprise Backup & Oracle Secure Backup
MySQL Enterprise Backup &  Oracle Secure BackupMySQL Enterprise Backup &  Oracle Secure Backup
MySQL Enterprise Backup & Oracle Secure Backup
Sanjay Manwani
 
Datastage parallell jobs vs datastage server jobs
Datastage parallell jobs vs datastage server jobsDatastage parallell jobs vs datastage server jobs
Datastage parallell jobs vs datastage server jobs
shanker_uma
 
Oracle Database Overview
Oracle Database OverviewOracle Database Overview
Oracle Database Overview
honglee71
 
Active / Active configurations with Oracle Active Data Guard
Active / Active configurations with Oracle Active Data GuardActive / Active configurations with Oracle Active Data Guard
Active / Active configurations with Oracle Active Data Guard
Aris Prassinos
 

What's hot (20)

Data Guard Architecture & Setup
Data Guard Architecture & SetupData Guard Architecture & Setup
Data Guard Architecture & Setup
 
Ioug tip book11_gunukula
Ioug tip book11_gunukulaIoug tip book11_gunukula
Ioug tip book11_gunukula
 
netezza-pdf
netezza-pdfnetezza-pdf
netezza-pdf
 
Why Upgrade to Oracle Database 12c?
Why Upgrade to Oracle Database 12c?Why Upgrade to Oracle Database 12c?
Why Upgrade to Oracle Database 12c?
 
Datastage
DatastageDatastage
Datastage
 
MySQL Enterprise Backup & Oracle Secure Backup
MySQL Enterprise Backup &  Oracle Secure BackupMySQL Enterprise Backup &  Oracle Secure Backup
MySQL Enterprise Backup & Oracle Secure Backup
 
RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)
 
Keep your environment always on with sql server 2016 sql bits 2017
Keep your environment always on with sql server 2016 sql bits 2017Keep your environment always on with sql server 2016 sql bits 2017
Keep your environment always on with sql server 2016 sql bits 2017
 
58750024 datastage-student-guide
58750024 datastage-student-guide58750024 datastage-student-guide
58750024 datastage-student-guide
 
Heat Map and Automatic Data Optimization with Oracle Database 12c
Heat Map and Automatic Data Optimization with Oracle Database 12cHeat Map and Automatic Data Optimization with Oracle Database 12c
Heat Map and Automatic Data Optimization with Oracle Database 12c
 
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)
 
SQL Server 2017 - Mejoras Impulsadas por la Comunidad
SQL Server 2017 - Mejoras Impulsadas por la ComunidadSQL Server 2017 - Mejoras Impulsadas por la Comunidad
SQL Server 2017 - Mejoras Impulsadas por la Comunidad
 
Oracle RAC on Extended Distance Clusters - Customer Examples
Oracle RAC on Extended Distance Clusters - Customer ExamplesOracle RAC on Extended Distance Clusters - Customer Examples
Oracle RAC on Extended Distance Clusters - Customer Examples
 
Oracle Database 12c Multitenant for Consolidation
Oracle Database 12c Multitenant for ConsolidationOracle Database 12c Multitenant for Consolidation
Oracle Database 12c Multitenant for Consolidation
 
Datastage parallell jobs vs datastage server jobs
Datastage parallell jobs vs datastage server jobsDatastage parallell jobs vs datastage server jobs
Datastage parallell jobs vs datastage server jobs
 
DBA 101 : Calling all New Database Administrators (PPT)
DBA 101 : Calling all New Database Administrators (PPT)DBA 101 : Calling all New Database Administrators (PPT)
DBA 101 : Calling all New Database Administrators (PPT)
 
Oracle Database Overview
Oracle Database OverviewOracle Database Overview
Oracle Database Overview
 
MySQL High Availability and Disaster Recovery with Continuent, a VMware company
MySQL High Availability and Disaster Recovery with Continuent, a VMware companyMySQL High Availability and Disaster Recovery with Continuent, a VMware company
MySQL High Availability and Disaster Recovery with Continuent, a VMware company
 
Active / Active configurations with Oracle Active Data Guard
Active / Active configurations with Oracle Active Data GuardActive / Active configurations with Oracle Active Data Guard
Active / Active configurations with Oracle Active Data Guard
 
Migration to Oracle 12c Made Easy Using Replication Technology
Migration to Oracle 12c Made Easy Using Replication TechnologyMigration to Oracle 12c Made Easy Using Replication Technology
Migration to Oracle 12c Made Easy Using Replication Technology
 

Similar to Sql Server tips from the field

Microsoft Sql Server 2016 Is Now Live
Microsoft Sql Server 2016 Is Now LiveMicrosoft Sql Server 2016 Is Now Live
Microsoft Sql Server 2016 Is Now Live
Amber Moore
 
Compare the capabilities of the Microsoft Access, Microsoft SQL Serv.pdf
Compare the capabilities of the Microsoft Access, Microsoft SQL Serv.pdfCompare the capabilities of the Microsoft Access, Microsoft SQL Serv.pdf
Compare the capabilities of the Microsoft Access, Microsoft SQL Serv.pdf
arihantplastictanksh
 
Financial, Retail And Shopping Domains
Financial, Retail And Shopping DomainsFinancial, Retail And Shopping Domains
Financial, Retail And Shopping Domains
Sonia Sanchez
 
Troubleshooting SQL Server
Troubleshooting SQL ServerTroubleshooting SQL Server
Troubleshooting SQL Server
Stephen Rose
 
Db As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
Db As Behaving Badly... Worst Practices For Database Administrators Rod ColledgeDb As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
Db As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
sqlserver.co.il
 
Managing SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAManaging SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBA
Concentrated Technology
 
Tech days 2011 - database design patterns for keeping your database applicati...
Tech days 2011 - database design patterns for keeping your database applicati...Tech days 2011 - database design patterns for keeping your database applicati...
Tech days 2011 - database design patterns for keeping your database applicati...
Charley Hanania
 

Similar to Sql Server tips from the field (20)

Sql server tips from the field
Sql server tips from the fieldSql server tips from the field
Sql server tips from the field
 
Large Scale SQL Considerations for SharePoint Deployments
Large Scale SQL Considerations for SharePoint DeploymentsLarge Scale SQL Considerations for SharePoint Deployments
Large Scale SQL Considerations for SharePoint Deployments
 
Management and Automation of MongoDB Clusters - Slides
Management and Automation of MongoDB Clusters - SlidesManagement and Automation of MongoDB Clusters - Slides
Management and Automation of MongoDB Clusters - Slides
 
Microsoft Sql Server 2016 Is Now Live
Microsoft Sql Server 2016 Is Now LiveMicrosoft Sql Server 2016 Is Now Live
Microsoft Sql Server 2016 Is Now Live
 
SQL Server & la virtualisation : « 45 minutes inside » !
SQL Server & la virtualisation :  « 45 minutes inside » !SQL Server & la virtualisation :  « 45 minutes inside » !
SQL Server & la virtualisation : « 45 minutes inside » !
 
SQL Server & la virtualisation : « 45 minutes inside » !
SQL Server & la virtualisation :  « 45 minutes inside » !SQL Server & la virtualisation :  « 45 minutes inside » !
SQL Server & la virtualisation : « 45 minutes inside » !
 
Compare the capabilities of the Microsoft Access, Microsoft SQL Serv.pdf
Compare the capabilities of the Microsoft Access, Microsoft SQL Serv.pdfCompare the capabilities of the Microsoft Access, Microsoft SQL Serv.pdf
Compare the capabilities of the Microsoft Access, Microsoft SQL Serv.pdf
 
Sql interview question part 10
Sql interview question part 10Sql interview question part 10
Sql interview question part 10
 
Ebook10
Ebook10Ebook10
Ebook10
 
Financial, Retail And Shopping Domains
Financial, Retail And Shopping DomainsFinancial, Retail And Shopping Domains
Financial, Retail And Shopping Domains
 
Understanding AWS Database Options (DAT201) | AWS re:Invent 2013
Understanding AWS Database Options (DAT201) | AWS re:Invent 2013Understanding AWS Database Options (DAT201) | AWS re:Invent 2013
Understanding AWS Database Options (DAT201) | AWS re:Invent 2013
 
What is SQL Server 2019 Standard Edition
What is SQL Server 2019 Standard EditionWhat is SQL Server 2019 Standard Edition
What is SQL Server 2019 Standard Edition
 
IBM FlashSystem in OLAP Database Environments
IBM FlashSystem in OLAP Database EnvironmentsIBM FlashSystem in OLAP Database Environments
IBM FlashSystem in OLAP Database Environments
 
Troubleshooting SQL Server
Troubleshooting SQL ServerTroubleshooting SQL Server
Troubleshooting SQL Server
 
Building High Performance MySQL Query Systems and Analytic Applications
Building High Performance MySQL Query Systems and Analytic ApplicationsBuilding High Performance MySQL Query Systems and Analytic Applications
Building High Performance MySQL Query Systems and Analytic Applications
 
Building High Performance MySql Query Systems And Analytic Applications
Building High Performance MySql Query Systems And Analytic ApplicationsBuilding High Performance MySql Query Systems And Analytic Applications
Building High Performance MySql Query Systems And Analytic Applications
 
Db As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
Db As Behaving Badly... Worst Practices For Database Administrators Rod ColledgeDb As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
Db As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
 
Managing SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAManaging SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBA
 
Remote DBA Experts 11g Features
Remote DBA Experts 11g FeaturesRemote DBA Experts 11g Features
Remote DBA Experts 11g Features
 
Tech days 2011 - database design patterns for keeping your database applicati...
Tech days 2011 - database design patterns for keeping your database applicati...Tech days 2011 - database design patterns for keeping your database applicati...
Tech days 2011 - database design patterns for keeping your database applicati...
 

More from InnoTech

More from InnoTech (20)

"So you want to raise funding and build a team?"
"So you want to raise funding and build a team?""So you want to raise funding and build a team?"
"So you want to raise funding and build a team?"
 
Artificial Intelligence is Maturing
Artificial Intelligence is MaturingArtificial Intelligence is Maturing
Artificial Intelligence is Maturing
 
What is AI without Data?
What is AI without Data?What is AI without Data?
What is AI without Data?
 
Courageous Leadership - When it Matters Most
Courageous Leadership - When it Matters MostCourageous Leadership - When it Matters Most
Courageous Leadership - When it Matters Most
 
The Gathering Storm
The Gathering StormThe Gathering Storm
The Gathering Storm
 
Quantum Computing and its security implications
Quantum Computing and its security implicationsQuantum Computing and its security implications
Quantum Computing and its security implications
 
Converged Infrastructure
Converged InfrastructureConverged Infrastructure
Converged Infrastructure
 
Making the most out of collaboration with Office 365
Making the most out of collaboration with Office 365Making the most out of collaboration with Office 365
Making the most out of collaboration with Office 365
 
Blockchain use cases and case studies
Blockchain use cases and case studiesBlockchain use cases and case studies
Blockchain use cases and case studies
 
Blockchain: Exploring the Fundamentals and Promising Potential
Blockchain: Exploring the Fundamentals and Promising Potential Blockchain: Exploring the Fundamentals and Promising Potential
Blockchain: Exploring the Fundamentals and Promising Potential
 
Business leaders are engaging labor differently - Is your IT ready?
Business leaders are engaging labor differently - Is your IT ready?Business leaders are engaging labor differently - Is your IT ready?
Business leaders are engaging labor differently - Is your IT ready?
 
AI 3.0: Is it Finally Time for Artificial Intelligence and Sensor Networks to...
AI 3.0: Is it Finally Time for Artificial Intelligence and Sensor Networks to...AI 3.0: Is it Finally Time for Artificial Intelligence and Sensor Networks to...
AI 3.0: Is it Finally Time for Artificial Intelligence and Sensor Networks to...
 
Using Business Intelligence to Bring Your Data to Life
Using Business Intelligence to Bring Your Data to LifeUsing Business Intelligence to Bring Your Data to Life
Using Business Intelligence to Bring Your Data to Life
 
User requirements is a fallacy
User requirements is a fallacyUser requirements is a fallacy
User requirements is a fallacy
 
What I Wish I Knew Before I Signed that Contract - San Antonio
What I Wish I Knew Before I Signed that Contract - San Antonio What I Wish I Knew Before I Signed that Contract - San Antonio
What I Wish I Knew Before I Signed that Contract - San Antonio
 
Disaster Recovery Plan - Quorum
Disaster Recovery Plan - QuorumDisaster Recovery Plan - Quorum
Disaster Recovery Plan - Quorum
 
Share point saturday access services 2015 final 2
Share point saturday access services 2015 final 2Share point saturday access services 2015 final 2
Share point saturday access services 2015 final 2
 
Sp tech festdallas - office 365 groups - planner session
Sp tech festdallas - office 365 groups - planner sessionSp tech festdallas - office 365 groups - planner session
Sp tech festdallas - office 365 groups - planner session
 
Power apps presentation
Power apps presentationPower apps presentation
Power apps presentation
 
Using rest to create responsive html 5 share point intranets
Using rest to create responsive html 5 share point intranetsUsing rest to create responsive html 5 share point intranets
Using rest to create responsive html 5 share point intranets
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Sql Server tips from the field

  • 1. SQL Server Tips From The Field Three Things IT Leaders Need to Know… Web: www.sqlwatchmen.com Email: Jim.Murphy@sqlwatchmen.com Twitter: @SQLMurph Jim Murphy CEO SQLWatchmen, LLC.
  • 2. Who is SQLWatchmen?  DBA Services – performance tuning, disaster recovery planning, maintenance  SQL Programming - views, SPs, triggers  Integration Services - SSIS for trying systems together  Reporting - SSRS for custom analytics to fill business needs  Cloud Migration 2  Austin based tech company  Can serve as Remote / Fractional DBAs  SQL Server Specialists (We work alongside general tech consulting firms)  Compliance (HIPAA, SOX, SOC2) How can we assist you?
  • 3. 3
  • 4. 4 NEW IN 2017 BACKUPS HA / DR PERFORMANCE CONCLUSION DEMO
  • 5. Database Performance and Speed Matter 55
  • 6. 6 1. Identifying the problem & why you should care Problem:  The database is the foundation of the entire application or corporate stack. If the database is slow…
  • 7. 2. There are many reasons for databases to get slower over time (i.e. bottlenecks) 7 Cause is usually:  CPU  Memory  Disk IO  Network
  • 8. 3. Slow-downs happen when queries are inefficient 8 But Why Jim:  More users  More data volume  More complex queries
  • 9. 4. Which solution is faster & cheaper? 9 Solution: A. Upgrade hardware and migrate. B. Figure out which queries are the biggest resource hogs and make adjustments. That doesn’t sound cheap! So offending queries use far fewer resources.
  • 10. 5. Performance Tuning gets to the root cause of slowdowns 10  Benefit = Lower Cost  Benefit = Tuning is more effective at improving speed & performance
  • 11. 6. Understanding how queries are processed 11  SQL Server processes query; makes Execution Plan  Execution Plan cached; remembered next time  Ad hoc (one-time, on-demand) queries can fill up the cache with lots of these (inefficient)  Stored Procedures reuse pre-cached Execution Plans (more efficient)
  • 12. 12 Measuring results with Perfmon: SQL Server Statistics -> Batch Executions/sec
  • 13. Backups and Disaster Recovery Plans are not all created equal 13
  • 14. 14 1. Identifying the problem & why you should care What’s the difference between a backup and a disaster recovery plan?
  • 15. 15 2. There are lots of different technologies you might consider using:  VM Snapshots  SAN Replication  Volume Shadow Copy  VEEAM  SQL Dump Files – Microsoft recommended
  • 16. 16 3. Transaction Log explained  Diary of data changes  Diary won’t ‘clear’ (Truncate) and be reused until it is backed up (if database in FULL mode)  T-Log (.LDF file) will grow and grow until drive fills up  DANGER! Full drive = corrupt database (and also bring it offline)!
  • 17. 17 4. Transaction Log explained (continued)  FULL backup hurts performance  Saves off all data pages with valid data on it  Locks tables and indexes to access up to date data  T-Log backup DOES NOT hurt performance  T-Log is circular in usage. Segments (VLF)  T-Log backup backs up each VLF & “truncates” T-Log  Doesn’t lock tables
  • 18. 18 5. There are also 2 different recovery modes to consider: SIMPLE  Only non-production  Uses Transaction Log for current transactions only.  T-Log only grows if a long transaction with lots of data changes runs.  No point-in-time recovery (can only recover to most recent FULL or Differential backup). FULL  Use for all Production databases.  Keeps T-Log as diary for all data changes until T-Log is backed up (and also ‘replicated’ if an HA/DR technology is configured).  T-Log will grow until drive is filled if not backed up.  Can perform point-in-time recovery (restore to an exact millisecond before a disaster so no data is lost).
  • 19. 19 6. An example of Point in Time Recovery Image Source: https://sqlbak.com/blog/sql-server-backup-and-restore/
  • 20. 20 PRO TIP If T-Log backup is getting too big, and you can’t backup or shrink - Switch your Recovery Mode to Simple* [ ]
  • 22. High Availability / Disaster Recovery (HA/DR) is a set of procedures and methods used for proactive disaster protection 22
  • 23. 23 1. Identifying the problem & why you should care Reasons why you might want to consider HA/DR for your company:  What does High Availability mean?  What is Disaster Recovery in this context?  What is AlwaysOn?  What are Availability Groups?
  • 24. 24 2. Solutions involve removing the single point of failure  Clustering - redundant hardware  RAID - redundant individual disks  “Replication” - redundant databases  Transactional Replication Issues  Log Shipping Issues  Mirroring Issues
  • 25. 25 3. Problems that arise with “Replication” methods Transactional Replication MirroringLog Shipping  No automatic failover.  Secondary DB is not really Online*.  Single DB solution.  Secondary offline while restoring T- Logs.  Secondary database is not Online.  Single Mirror/ Secondary only.  SNAC/Failover Partner in connection string. What will AlwaysOn Solve?  No automatic failover.  Major headache.  Higher administration.  Republish articles, etc.  Complicated troubleshooting
  • 26. 26 4. AlwaysOn Solves World Hunger! …and peace on earth and goodwill toward men.  Automatic Failover  Multiple Replicas (secondaries) – and readable!  “Replication” - redundant databases  Offload Backups, Reporting, etc.  Availability Groups - assists with using multiple DBs  Lower administrative costs  Plus more!
  • 27. 27 5. There are a few requirements to consider  Enterprise Edition  AD for WSFC  Nodes must be in the same domain
  • 28. 28 7. HA, DR, or Both?  Synchronous  Asynchronous Sync Async Legend
  • 29. 29 8. Listener (Virtual Network Name) Node 1 Node 2 DENALI02 DENALI03 VNN Node 1 Node 2
  • 30. 30
  • 31. What’s New in SQL Server 2017?
  • 32. 32  Columnstore indexes for big data  Query Store – better diagnostics for a DBA  In-Memory Databases  30x in-memory OLTP speed  100x in-memory Columnstore speed  Stretch databases (Auto-archiving)  Always Encrypted (at rest, in motion, cloud)  Temporal DB – track historical changes  Row-level security.  …and a lot more. In case you missed these 2016 features…
  • 33. What’s New in 2017… 33  Always On Availibility Group – supporting the ability to cross database transactions among all databases, as well as, clusterless support in Availibility Groups.  Machine Learning Services – SQL Server R Services have been renamed in this release and now supports Python in addition to R.  In-memory and memory-optimized object enhancements.  SQL Server Reporting Services 2017 – the REST API and the “all in one” on-premise, self-service Power BI.  Scale Out for SSIS.  Resumable online index rebuild – Pause & resume index builds to fit your tight maintenance window. Each night, it can chip away a little at a time.  For a full list of details visit: https://docs.microsoft.com/en-us/sql/sql- server/what-s-new-in-sql-server-2017 CONCLUSION
  • 34. SQL Server is beautiful… but it can be a beast[ ] 34
  • 35. You don’t need new hardware - Tune for Performance[ ] 35
  • 36. Keep your backups secure. Disaster recovery methods should be tested! [ ] 36
  • 37. Treated properly, MS SQL Server can contribute a solid foundation to the efforts of any business ][ 37
  • 38. Next Steps ● For another slide deck that delves deeper on SQL backups - visit http://www.sqlwatchmen.com/contact-us ● To check out if a Database Diagnostic Exam is right for you - visit http://www.sqlwatchmen.com/services/database- diagnostic-analysis 38
  • 39. Let us help you Protect Your Data ][ 39 QUESTIONS www.sqlwatchmen.com Jim.Murphy@sqlwatchmen.com @SQLMurph

Editor's Notes

  1. Customers are frustrated; hurts your reputation Employees are frustrated; hourglass of time wasted