SlideShare a Scribd company logo
1 of 29
How To Be The DBA
When You Don’t Have A DBA
Eric Cobb
http://www.sqlnuggets.com
3/17/2021
About Me
Microsoft Certified Trainer (MCT)
MCSE: Data Management and Analytics
MCSE: Data Platform
1999-2013: “Webmaster“, Programmer, Developer
2014+: SQL Server Database Administrator
GitHub: https://github.com/ericcobb
Blog: http://www.sqlnuggets.com
Twitter: @sqlnugg, @cfgears
What Are We Going To Learn?
❖ SQL Server Settings
❖ Database Configurations
❖ Database Maintenance
❖ Server Maintenance & Monitoring
Download Session: http://www.sqlnuggets.com
SQL Server Settings
SQL Server Settings
Configuration Options:
Consider enabling the following options:
❖ Backup Compression Default (MSDN)
❖ Backup Checksum Default (MSDN)
❖ Checks data pages for corruption
❖ Not a full corruption check
❖ Optimize For Ad Hoc Workloads (MSDN)
❖ Helps to relieve memory pressure by not allowing the plan cache to
become filled with compiled plans that are not reused
SQL Server Settings
Configuration Options:
Max Server Memory
❖ How much memory does SQL Server need?
❖ Set by default to over 2 Petabytes
❖ But Windows likes memory too
❖ So does SSIS, SSRS, SSAS, Full Text Search, and some In-Memory OLTP
operations
❖ SQL Server Crashes When Hitting 80 Percent RAM Usage
SQL Server Settings
Configuration Options:
Max Server Memory
❖ What should you set it to?
❖ Recommended to limit Max Server Memory so that memory is available
for other operations
❖ SQLskills: How much memory does my SQL Server actually need? (provides
calculation)
❖ Glenn Berry: Suggested Max Memory Settings for SQL Server 2005/2008
(provides good starting estimates)
SQL Server Settings
Configuration Options:
Maximum Degree of Parallelism (MAXDOP)
❖ What is Parallelism?
❖ For expensive queries, multiple threads
are used to gather the data quicker
❖ By default SQL Server can create as many
parallel threads as there are processors
SQL Server Settings
Configuration Options:
MAXDOP
❖ MAXDOP limits the number of processors that are used in parallel
plans (MSDN)
❖ What should my MAXDOP be?
❖ Default value for MAXDOP is 0 (Unlimited)
❖ Less than 8 logical processors: Keep MAXDOP at or below # of logical
processors (MSDN Guidelines for MAXDOP)
❖ MSSQLTips: What MAXDOP setting should be used for SQL Server
SQL Server Settings
Configuration Options:
Cost Threshold for Parallelism (MSDN)
❖ Determines whether or not a query will go parallel
❖ The number of seconds that the query optimizer has determined a
statement will take
❖ Default is 5 seconds (set by Nick’s machine)
❖ Recommended to set higher so smaller queries won’t consume
multiple threads
❖ Grant Fritchey: Why You Should Change the Cost Threshold for Parallelism
SQL Server Settings
Configuration Options:
Cost Threshold for Parallelism
❖ What should my Cost Threshold for Parallelism be?
❖ It depends, every environment will be different
❖ Start at 25-50, and tune from there
❖ Goal is to allow larger queries to work in parallel, and minimize the
number of smaller queries that do
❖ SQLskills: Tuning ‘cost threshold for parallelism’ from the Plan Cache (Query to
search the plan cache for existing parallel plans and see the cost associations)
SQL Server Settings
Configuration Options:
EXEC sp_configure 'Show Advanced Options', 1
RECONFIGURE
EXEC sp_configure 'backup checksum default';
EXEC sp_configure 'backup compression default';
EXEC sp_configure 'cost threshold for parallelism';
EXEC sp_configure 'max degree of parallelism';
EXEC sp_configure 'max server memory';
EXEC sp_configure 'optimize for ad hoc workloads';
Database Configurations
Database Configurations
Compatibility Level
❖ Sets database features to be compatible with the specified version of
SQL Server (MSDN)
Product Compatibility Level
SQL Server 2019 150
SQL Server 2017 140
SQL Server 2016 130
SQL Server 2014 120
SQL Server 2012 110
SQL Server 2008 100
SQL Server 2005 90
SQL Server 2000 80
Cardinality Estimator
Change
Database Configurations
Compatibility Level
❖ How do I find my database’s Compatibility Level?
❖ Query the built in sys.databases view
❖ SSMS > Right click database > Properties > Options
Database Configurations
Files & Sizes
❖ Do not use the default auto-growth settings
❖ Auto-growth should be enabled
❖ Default settings of 1MB and 10% are too low
❖ Set auto-growth defaults to something more appropriate to your
workload; consider pre-sizing files to prevent auto-growths
❖ Paul Randal: Choosing Default Sizes for Your Data and Log Files
❖ Auto-shrink should not be enabled for a database
❖ Thomas LaRock: When To Use Auto Shrink (Never, that’s when.)
Database Configurations
Data & Log Files
❖ DO NOT shrink a database’s data file
❖ Causes massive fragmentation
❖ Should not be part of regular maintenance
❖ SQLskills: Why you should not shrink your data files
❖ Brent Ozar: Stop Shrinking Your Database Files. Seriously. Now.
Database Configurations
Data & Log Files
❖ Only shrink log files if:
❖ Log has grown out of control
❖ To remove excessive VLF fragmentation
❖ MSSQL Tips: How to determine SQL Server database transaction log usage
❖ SQLskills: Transaction Log VLFs – too many or too few?
❖ How can I find database file growth settings?
❖ SQL Scripts: Find Data And Log File Information
Database Maintenance
Database Maintenance
Backups
❖ The frequency of your backup determines the potential data loss if
you have to recover from backup
❖ Set a Recovery Point Objective (RPO) and let it dictate your backup
schedule
❖ RPO = the amount of data you are willing to lose
❖ Don't forget to backup the System databases!
❖ What if you have to reinstall everything? (Agent Jobs? Logins?
Permissions?)
Database Maintenance
Backups
❖ Types of backups:
❖ Full - contains all the data in a specific database
❖ Differential - contains only the data that has changed since the last full
backup
❖ Log - based on the latest full backup, includes all transactions since
previous log backup
❖ Full Copy_Only - A special-use backup that is independent of the regular
sequence of backups; used for Ad-hoc backups
❖ MSDN Backup Overview
Database Maintenance
Recovery – Are Your Backups Valid?
❖ Restore your backups regularly!
❖ “If you don't test your backups, you don't have backups, you just
have files” – Thomas LaRock
❖ Be ready for a crisis
❖ Know how long it takes to get your hands on the backup
❖ Know how long it takes to restore the database and log files
❖ Have your restore scripts tested and ready to go
❖ Don’t rely on a wizard in a crisis
❖ Don’t wait until disaster to start Googling
Database Maintenance
Database Integrity Checks
❖ DBCC CHECKDB (MSDN)
❖ Run regularly for corruption check
❖ Possibly run as part of your backup process
❖ Resource intensive! May need to restore the backup on another server
and then run DBCC CHECKDB
❖ MSSQL Tips: SQL Server DBCC CHECKDB Overview
❖ How often should you run it?
❖ How much data can you afford to lose?
Database Maintenance
Index Maintenance
❖ Indexes become fragmented
❖ Fragmented Clustered Index = Fragmented Table
❖ Fragmented Nonclustered Index = Slower Queries
❖ Regular index maintenance is required to keep query performance at
optimum levels
❖ SQL Scripts: How To Find Index Fragmentation
Database Maintenance
Index Maintenance
❖ Duplicate indexes and unused indexes can hurt!
❖ Wasted storage, wasted memory, and bloated backups
❖ Can interfere with INSERT, UPDATE, & DELETE operations
❖ Regular index reviews are recommended to ensure only valuable
indexes are supported and maintained
❖ Brent Ozar’s sp_BlitzIndex
❖ SQL Scripts: How To Find Index Usage
❖ GitHub: SQL Server Metrics Pack
Database Maintenance
Backups, Corruption, Indexes….
❖ That’s a lot of stuff to keep check on!
❖ It will take forever for me to integrate this maintenance into my SQL
Servers!
❖ Is there something that can handle this stuff for me?
Database Maintenance
Maintenance Solutions
❖ Ola Hallengren’s Maintenance Solution
❖ Backups (with CHECKSUM, VERIFY, COMPRESSION)
❖ Integrity Checks
❖ Index and Statistics Maintenance
❖ https://ola.hallengren.com
❖ Installation defaults to Master database
❖ May want to create a “DBA” database instead
Database Monitoring
& Maintenance
Thanks!
Eric Cobb
http://www.sqlnuggets.com
3/17/2021

More Related Content

What's hot

Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019Antonios Chatzipavlis
 
Azure cosmos db, Azure no-SQL database,
Azure cosmos db, Azure no-SQL database, Azure cosmos db, Azure no-SQL database,
Azure cosmos db, Azure no-SQL database, BRIJESH KUMAR
 
Azure sql database limitations
Azure sql database limitationsAzure sql database limitations
Azure sql database limitationsBRIJESH KUMAR
 
Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012sqlserver.co.il
 
Scalable relational database with SQL Azure
Scalable relational database with SQL AzureScalable relational database with SQL Azure
Scalable relational database with SQL AzureShy Engelberg
 
Upgrade your SQL Server like a Ninja
Upgrade your SQL Server like a NinjaUpgrade your SQL Server like a Ninja
Upgrade your SQL Server like a NinjaAmit Banerjee
 
Stretch Database
Stretch DatabaseStretch Database
Stretch DatabaseSolidQ
 
Choosing the right Cloud Database
Choosing the right Cloud DatabaseChoosing the right Cloud Database
Choosing the right Cloud DatabaseJanakiram MSV
 
5 Postgres DBA Tips
5 Postgres DBA Tips5 Postgres DBA Tips
5 Postgres DBA TipsEDB
 
Scaling Your Database in the Cloud
Scaling Your Database in the CloudScaling Your Database in the Cloud
Scaling Your Database in the CloudRightScale
 
MySQL infra readiness-for-peak-sale-events - Kabilesh PR (Co-Founder of Mydbops)
MySQL infra readiness-for-peak-sale-events - Kabilesh PR (Co-Founder of Mydbops)MySQL infra readiness-for-peak-sale-events - Kabilesh PR (Co-Founder of Mydbops)
MySQL infra readiness-for-peak-sale-events - Kabilesh PR (Co-Founder of Mydbops)Mydbops
 
Application Development with Apache Cassandra as a Service
Application Development with Apache Cassandra as a ServiceApplication Development with Apache Cassandra as a Service
Application Development with Apache Cassandra as a ServiceWSO2
 
Sql vs NO-SQL database differences explained
Sql vs NO-SQL database differences explainedSql vs NO-SQL database differences explained
Sql vs NO-SQL database differences explainedSatya Pal
 
The Roadmap for SQL Server 2019
The Roadmap for SQL Server 2019The Roadmap for SQL Server 2019
The Roadmap for SQL Server 2019Amit Banerjee
 
DBaaS with EDB Postgres on AWS
DBaaS with EDB Postgres on AWSDBaaS with EDB Postgres on AWS
DBaaS with EDB Postgres on AWSEDB
 
Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013sqlserver.co.il
 
SQL Server 2017 Enhancements You Need To Know
SQL Server 2017 Enhancements You Need To KnowSQL Server 2017 Enhancements You Need To Know
SQL Server 2017 Enhancements You Need To KnowQuest
 
Using extended events for troubleshooting sql server
Using extended events for troubleshooting sql serverUsing extended events for troubleshooting sql server
Using extended events for troubleshooting sql serverAntonios Chatzipavlis
 

What's hot (19)

Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019
 
Azure cosmos db, Azure no-SQL database,
Azure cosmos db, Azure no-SQL database, Azure cosmos db, Azure no-SQL database,
Azure cosmos db, Azure no-SQL database,
 
Azure sql database limitations
Azure sql database limitationsAzure sql database limitations
Azure sql database limitations
 
Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012
 
Scalable relational database with SQL Azure
Scalable relational database with SQL AzureScalable relational database with SQL Azure
Scalable relational database with SQL Azure
 
Upgrade your SQL Server like a Ninja
Upgrade your SQL Server like a NinjaUpgrade your SQL Server like a Ninja
Upgrade your SQL Server like a Ninja
 
Stretch Database
Stretch DatabaseStretch Database
Stretch Database
 
Choosing the right Cloud Database
Choosing the right Cloud DatabaseChoosing the right Cloud Database
Choosing the right Cloud Database
 
5 Postgres DBA Tips
5 Postgres DBA Tips5 Postgres DBA Tips
5 Postgres DBA Tips
 
Scaling Your Database in the Cloud
Scaling Your Database in the CloudScaling Your Database in the Cloud
Scaling Your Database in the Cloud
 
MySQL infra readiness-for-peak-sale-events - Kabilesh PR (Co-Founder of Mydbops)
MySQL infra readiness-for-peak-sale-events - Kabilesh PR (Co-Founder of Mydbops)MySQL infra readiness-for-peak-sale-events - Kabilesh PR (Co-Founder of Mydbops)
MySQL infra readiness-for-peak-sale-events - Kabilesh PR (Co-Founder of Mydbops)
 
Application Development with Apache Cassandra as a Service
Application Development with Apache Cassandra as a ServiceApplication Development with Apache Cassandra as a Service
Application Development with Apache Cassandra as a Service
 
Sql vs NO-SQL database differences explained
Sql vs NO-SQL database differences explainedSql vs NO-SQL database differences explained
Sql vs NO-SQL database differences explained
 
The Roadmap for SQL Server 2019
The Roadmap for SQL Server 2019The Roadmap for SQL Server 2019
The Roadmap for SQL Server 2019
 
DBaaS with EDB Postgres on AWS
DBaaS with EDB Postgres on AWSDBaaS with EDB Postgres on AWS
DBaaS with EDB Postgres on AWS
 
Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013
 
SQL Server 2017 Enhancements You Need To Know
SQL Server 2017 Enhancements You Need To KnowSQL Server 2017 Enhancements You Need To Know
SQL Server 2017 Enhancements You Need To Know
 
Using extended events for troubleshooting sql server
Using extended events for troubleshooting sql serverUsing extended events for troubleshooting sql server
Using extended events for troubleshooting sql server
 
SQL Azure Overview
SQL Azure OverviewSQL Azure Overview
SQL Azure Overview
 

Similar to Geek Sync | How to Be the DBA When You Don't Have a DBA - Eric Cobb | IDERA

Unity Connect - Getting SQL Spinning with SharePoint - Best Practices for the...
Unity Connect - Getting SQL Spinning with SharePoint - Best Practices for the...Unity Connect - Getting SQL Spinning with SharePoint - Best Practices for the...
Unity Connect - Getting SQL Spinning with SharePoint - Best Practices for the...Knut Relbe-Moe [MVP, MCT]
 
Optimize SQL server performance for SharePoint
Optimize SQL server performance for SharePointOptimize SQL server performance for SharePoint
Optimize SQL server performance for SharePointserge luca
 
SPSMadrid Get sql spinning with SharePoint. Best practice for the back end
SPSMadrid Get sql spinning with SharePoint. Best practice for the back endSPSMadrid Get sql spinning with SharePoint. Best practice for the back end
SPSMadrid Get sql spinning with SharePoint. Best practice for the back endKnut Relbe-Moe [MVP, MCT]
 
Sql Server Tuning for SharePoint : what every consultant must know (Office 36...
Sql Server Tuning for SharePoint : what every consultant must know (Office 36...Sql Server Tuning for SharePoint : what every consultant must know (Office 36...
Sql Server Tuning for SharePoint : what every consultant must know (Office 36...serge luca
 
Configuring sql server - SQL Saturday, Athens Oct 2014
Configuring sql server - SQL Saturday, Athens Oct 2014Configuring sql server - SQL Saturday, Athens Oct 2014
Configuring sql server - SQL Saturday, Athens Oct 2014Antonios Chatzipavlis
 
What SQL DBAs need to know about SharePoint
What SQL DBAs need to know about SharePointWhat SQL DBAs need to know about SharePoint
What SQL DBAs need to know about SharePointJ.D. Wade
 
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
 
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...J.D. Wade
 
SPS Kansas City: What SharePoint Admin need to know about SQL
SPS Kansas City: What SharePoint Admin need to know about SQLSPS Kansas City: What SharePoint Admin need to know about SQL
SPS Kansas City: What SharePoint Admin need to know about SQLJ.D. Wade
 
SOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBSOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBUniFabric
 
Tuning Sql Server for SharePoint--- Community Day Belgium 2013
Tuning Sql Server for SharePoint--- Community Day Belgium 2013Tuning Sql Server for SharePoint--- Community Day Belgium 2013
Tuning Sql Server for SharePoint--- Community Day Belgium 2013Isabelle Van Campenhoudt
 
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
 
New awesome features in MySQL 5.7
New awesome features in MySQL 5.7New awesome features in MySQL 5.7
New awesome features in MySQL 5.7Zhaoyang Wang
 
Denver SQL Saturday The Next Frontier
Denver SQL Saturday The Next FrontierDenver SQL Saturday The Next Frontier
Denver SQL Saturday The Next FrontierKellyn Pot'Vin-Gorman
 
Introduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAsIntroduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAsSteve Knutson
 
SharePoint 2010 database maintenance
SharePoint 2010 database maintenanceSharePoint 2010 database maintenance
SharePoint 2010 database maintenanceMatt Ranlett
 
Get your SharePoint spinning with SQL Server
Get your SharePoint spinning with SQL ServerGet your SharePoint spinning with SQL Server
Get your SharePoint spinning with SQL ServerKnut Relbe-Moe [MVP, MCT]
 
Cloud computing 3702
Cloud computing 3702Cloud computing 3702
Cloud computing 3702Jess Coburn
 
DBA, LEVEL III TTLM Monitoring and Administering Database.docx
DBA, LEVEL III TTLM Monitoring and Administering Database.docxDBA, LEVEL III TTLM Monitoring and Administering Database.docx
DBA, LEVEL III TTLM Monitoring and Administering Database.docxseifusisay06
 

Similar to Geek Sync | How to Be the DBA When You Don't Have a DBA - Eric Cobb | IDERA (20)

Unity Connect - Getting SQL Spinning with SharePoint - Best Practices for the...
Unity Connect - Getting SQL Spinning with SharePoint - Best Practices for the...Unity Connect - Getting SQL Spinning with SharePoint - Best Practices for the...
Unity Connect - Getting SQL Spinning with SharePoint - Best Practices for the...
 
Optimize SQL server performance for SharePoint
Optimize SQL server performance for SharePointOptimize SQL server performance for SharePoint
Optimize SQL server performance for SharePoint
 
SPSMadrid Get sql spinning with SharePoint. Best practice for the back end
SPSMadrid Get sql spinning with SharePoint. Best practice for the back endSPSMadrid Get sql spinning with SharePoint. Best practice for the back end
SPSMadrid Get sql spinning with SharePoint. Best practice for the back end
 
Sql Server Tuning for SharePoint : what every consultant must know (Office 36...
Sql Server Tuning for SharePoint : what every consultant must know (Office 36...Sql Server Tuning for SharePoint : what every consultant must know (Office 36...
Sql Server Tuning for SharePoint : what every consultant must know (Office 36...
 
Configuring sql server - SQL Saturday, Athens Oct 2014
Configuring sql server - SQL Saturday, Athens Oct 2014Configuring sql server - SQL Saturday, Athens Oct 2014
Configuring sql server - SQL Saturday, Athens Oct 2014
 
What SQL DBAs need to know about SharePoint
What SQL DBAs need to know about SharePointWhat SQL DBAs need to know about SharePoint
What SQL DBAs need to know about SharePoint
 
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)
 
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...
 
SPS Kansas City: What SharePoint Admin need to know about SQL
SPS Kansas City: What SharePoint Admin need to know about SQLSPS Kansas City: What SharePoint Admin need to know about SQL
SPS Kansas City: What SharePoint Admin need to know about SQL
 
SOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBSOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DB
 
Tuning Sql Server for SharePoint--- Community Day Belgium 2013
Tuning Sql Server for SharePoint--- Community Day Belgium 2013Tuning Sql Server for SharePoint--- Community Day Belgium 2013
Tuning Sql Server for SharePoint--- Community Day Belgium 2013
 
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
 
New awesome features in MySQL 5.7
New awesome features in MySQL 5.7New awesome features in MySQL 5.7
New awesome features in MySQL 5.7
 
Denver SQL Saturday The Next Frontier
Denver SQL Saturday The Next FrontierDenver SQL Saturday The Next Frontier
Denver SQL Saturday The Next Frontier
 
Copy Data Management for the DBA
Copy Data Management for the DBACopy Data Management for the DBA
Copy Data Management for the DBA
 
Introduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAsIntroduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAs
 
SharePoint 2010 database maintenance
SharePoint 2010 database maintenanceSharePoint 2010 database maintenance
SharePoint 2010 database maintenance
 
Get your SharePoint spinning with SQL Server
Get your SharePoint spinning with SQL ServerGet your SharePoint spinning with SQL Server
Get your SharePoint spinning with SQL Server
 
Cloud computing 3702
Cloud computing 3702Cloud computing 3702
Cloud computing 3702
 
DBA, LEVEL III TTLM Monitoring and Administering Database.docx
DBA, LEVEL III TTLM Monitoring and Administering Database.docxDBA, LEVEL III TTLM Monitoring and Administering Database.docx
DBA, LEVEL III TTLM Monitoring and Administering Database.docx
 

More from IDERA Software

The role of the database administrator (DBA) in 2020: Changes, challenges, an...
The role of the database administrator (DBA) in 2020: Changes, challenges, an...The role of the database administrator (DBA) in 2020: Changes, challenges, an...
The role of the database administrator (DBA) in 2020: Changes, challenges, an...IDERA Software
 
Problems and solutions for migrating databases to the cloud
Problems and solutions for migrating databases to the cloudProblems and solutions for migrating databases to the cloud
Problems and solutions for migrating databases to the cloudIDERA Software
 
Public cloud uses and limitations
Public cloud uses and limitationsPublic cloud uses and limitations
Public cloud uses and limitationsIDERA Software
 
Optimize the performance, cost, and value of databases.pptx
Optimize the performance, cost, and value of databases.pptxOptimize the performance, cost, and value of databases.pptx
Optimize the performance, cost, and value of databases.pptxIDERA Software
 
Monitor cloud database with SQL Diagnostic Manager for SQL Server
Monitor cloud database with SQL Diagnostic Manager for SQL ServerMonitor cloud database with SQL Diagnostic Manager for SQL Server
Monitor cloud database with SQL Diagnostic Manager for SQL ServerIDERA Software
 
Database administrators (dbas) face increasing pressure to monitor databases
Database administrators (dbas) face increasing pressure to monitor databasesDatabase administrators (dbas) face increasing pressure to monitor databases
Database administrators (dbas) face increasing pressure to monitor databasesIDERA Software
 
Six tips for cutting sql server licensing costs
Six tips for cutting sql server licensing costsSix tips for cutting sql server licensing costs
Six tips for cutting sql server licensing costsIDERA Software
 
Idera live 2021: The Power of Abstraction by Steve Hoberman
Idera live 2021:  The Power of Abstraction by Steve HobermanIdera live 2021:  The Power of Abstraction by Steve Hoberman
Idera live 2021: The Power of Abstraction by Steve HobermanIDERA Software
 
Idera live 2021: Why Data Lakes are Critical for AI, ML, and IoT By Brian Flug
Idera live 2021:  Why Data Lakes are Critical for AI, ML, and IoT  By Brian FlugIdera live 2021:  Why Data Lakes are Critical for AI, ML, and IoT  By Brian Flug
Idera live 2021: Why Data Lakes are Critical for AI, ML, and IoT By Brian FlugIDERA Software
 
Idera live 2021: Will Data Vault add Value to Your Data Warehouse? 3 Signs th...
Idera live 2021: Will Data Vault add Value to Your Data Warehouse? 3 Signs th...Idera live 2021: Will Data Vault add Value to Your Data Warehouse? 3 Signs th...
Idera live 2021: Will Data Vault add Value to Your Data Warehouse? 3 Signs th...IDERA Software
 
Idera live 2021: Managing Digital Transformation on a Budget by Bert Scalzo
Idera live 2021:  Managing Digital Transformation on a Budget by Bert ScalzoIdera live 2021:  Managing Digital Transformation on a Budget by Bert Scalzo
Idera live 2021: Managing Digital Transformation on a Budget by Bert ScalzoIDERA Software
 
Idera live 2021: Keynote Presentation The Future of Data is The Data Cloud b...
Idera live 2021:  Keynote Presentation The Future of Data is The Data Cloud b...Idera live 2021:  Keynote Presentation The Future of Data is The Data Cloud b...
Idera live 2021: Keynote Presentation The Future of Data is The Data Cloud b...IDERA Software
 
Idera live 2021: Managing Databases in the Cloud - the First Step, a Succes...
Idera live 2021:   Managing Databases in the Cloud - the First Step, a Succes...Idera live 2021:   Managing Databases in the Cloud - the First Step, a Succes...
Idera live 2021: Managing Databases in the Cloud - the First Step, a Succes...IDERA Software
 
Idera live 2021: Database Auditing - on-Premises and in the Cloud by Craig M...
Idera live 2021:  Database Auditing - on-Premises and in the Cloud by Craig M...Idera live 2021:  Database Auditing - on-Premises and in the Cloud by Craig M...
Idera live 2021: Database Auditing - on-Premises and in the Cloud by Craig M...IDERA Software
 
Idera live 2021: Performance Tuning Azure SQL Database by Monica Rathbun
Idera live 2021:  Performance Tuning Azure SQL Database by Monica RathbunIdera live 2021:  Performance Tuning Azure SQL Database by Monica Rathbun
Idera live 2021: Performance Tuning Azure SQL Database by Monica RathbunIDERA Software
 
How Users of a Performance Monitoring Tool Can Benefit from an Inventory Mana...
How Users of a Performance Monitoring Tool Can Benefit from an Inventory Mana...How Users of a Performance Monitoring Tool Can Benefit from an Inventory Mana...
How Users of a Performance Monitoring Tool Can Benefit from an Inventory Mana...IDERA Software
 
Benefits of Third Party Tools for MySQL | IDERA
Benefits of Third Party Tools for MySQL | IDERABenefits of Third Party Tools for MySQL | IDERA
Benefits of Third Party Tools for MySQL | IDERAIDERA Software
 
Achieve More with Less Resources | IDERA
Achieve More with Less Resources | IDERAAchieve More with Less Resources | IDERA
Achieve More with Less Resources | IDERAIDERA Software
 
Benefits of SQL Server 2017 and 2019 | IDERA
Benefits of SQL Server 2017 and 2019 | IDERABenefits of SQL Server 2017 and 2019 | IDERA
Benefits of SQL Server 2017 and 2019 | IDERAIDERA Software
 
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent Ozar
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent OzarGeek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent Ozar
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent OzarIDERA Software
 

More from IDERA Software (20)

The role of the database administrator (DBA) in 2020: Changes, challenges, an...
The role of the database administrator (DBA) in 2020: Changes, challenges, an...The role of the database administrator (DBA) in 2020: Changes, challenges, an...
The role of the database administrator (DBA) in 2020: Changes, challenges, an...
 
Problems and solutions for migrating databases to the cloud
Problems and solutions for migrating databases to the cloudProblems and solutions for migrating databases to the cloud
Problems and solutions for migrating databases to the cloud
 
Public cloud uses and limitations
Public cloud uses and limitationsPublic cloud uses and limitations
Public cloud uses and limitations
 
Optimize the performance, cost, and value of databases.pptx
Optimize the performance, cost, and value of databases.pptxOptimize the performance, cost, and value of databases.pptx
Optimize the performance, cost, and value of databases.pptx
 
Monitor cloud database with SQL Diagnostic Manager for SQL Server
Monitor cloud database with SQL Diagnostic Manager for SQL ServerMonitor cloud database with SQL Diagnostic Manager for SQL Server
Monitor cloud database with SQL Diagnostic Manager for SQL Server
 
Database administrators (dbas) face increasing pressure to monitor databases
Database administrators (dbas) face increasing pressure to monitor databasesDatabase administrators (dbas) face increasing pressure to monitor databases
Database administrators (dbas) face increasing pressure to monitor databases
 
Six tips for cutting sql server licensing costs
Six tips for cutting sql server licensing costsSix tips for cutting sql server licensing costs
Six tips for cutting sql server licensing costs
 
Idera live 2021: The Power of Abstraction by Steve Hoberman
Idera live 2021:  The Power of Abstraction by Steve HobermanIdera live 2021:  The Power of Abstraction by Steve Hoberman
Idera live 2021: The Power of Abstraction by Steve Hoberman
 
Idera live 2021: Why Data Lakes are Critical for AI, ML, and IoT By Brian Flug
Idera live 2021:  Why Data Lakes are Critical for AI, ML, and IoT  By Brian FlugIdera live 2021:  Why Data Lakes are Critical for AI, ML, and IoT  By Brian Flug
Idera live 2021: Why Data Lakes are Critical for AI, ML, and IoT By Brian Flug
 
Idera live 2021: Will Data Vault add Value to Your Data Warehouse? 3 Signs th...
Idera live 2021: Will Data Vault add Value to Your Data Warehouse? 3 Signs th...Idera live 2021: Will Data Vault add Value to Your Data Warehouse? 3 Signs th...
Idera live 2021: Will Data Vault add Value to Your Data Warehouse? 3 Signs th...
 
Idera live 2021: Managing Digital Transformation on a Budget by Bert Scalzo
Idera live 2021:  Managing Digital Transformation on a Budget by Bert ScalzoIdera live 2021:  Managing Digital Transformation on a Budget by Bert Scalzo
Idera live 2021: Managing Digital Transformation on a Budget by Bert Scalzo
 
Idera live 2021: Keynote Presentation The Future of Data is The Data Cloud b...
Idera live 2021:  Keynote Presentation The Future of Data is The Data Cloud b...Idera live 2021:  Keynote Presentation The Future of Data is The Data Cloud b...
Idera live 2021: Keynote Presentation The Future of Data is The Data Cloud b...
 
Idera live 2021: Managing Databases in the Cloud - the First Step, a Succes...
Idera live 2021:   Managing Databases in the Cloud - the First Step, a Succes...Idera live 2021:   Managing Databases in the Cloud - the First Step, a Succes...
Idera live 2021: Managing Databases in the Cloud - the First Step, a Succes...
 
Idera live 2021: Database Auditing - on-Premises and in the Cloud by Craig M...
Idera live 2021:  Database Auditing - on-Premises and in the Cloud by Craig M...Idera live 2021:  Database Auditing - on-Premises and in the Cloud by Craig M...
Idera live 2021: Database Auditing - on-Premises and in the Cloud by Craig M...
 
Idera live 2021: Performance Tuning Azure SQL Database by Monica Rathbun
Idera live 2021:  Performance Tuning Azure SQL Database by Monica RathbunIdera live 2021:  Performance Tuning Azure SQL Database by Monica Rathbun
Idera live 2021: Performance Tuning Azure SQL Database by Monica Rathbun
 
How Users of a Performance Monitoring Tool Can Benefit from an Inventory Mana...
How Users of a Performance Monitoring Tool Can Benefit from an Inventory Mana...How Users of a Performance Monitoring Tool Can Benefit from an Inventory Mana...
How Users of a Performance Monitoring Tool Can Benefit from an Inventory Mana...
 
Benefits of Third Party Tools for MySQL | IDERA
Benefits of Third Party Tools for MySQL | IDERABenefits of Third Party Tools for MySQL | IDERA
Benefits of Third Party Tools for MySQL | IDERA
 
Achieve More with Less Resources | IDERA
Achieve More with Less Resources | IDERAAchieve More with Less Resources | IDERA
Achieve More with Less Resources | IDERA
 
Benefits of SQL Server 2017 and 2019 | IDERA
Benefits of SQL Server 2017 and 2019 | IDERABenefits of SQL Server 2017 and 2019 | IDERA
Benefits of SQL Server 2017 and 2019 | IDERA
 
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent Ozar
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent OzarGeek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent Ozar
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent Ozar
 

Recently uploaded

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Recently uploaded (20)

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

Geek Sync | How to Be the DBA When You Don't Have a DBA - Eric Cobb | IDERA

  • 1. How To Be The DBA When You Don’t Have A DBA Eric Cobb http://www.sqlnuggets.com 3/17/2021
  • 2. About Me Microsoft Certified Trainer (MCT) MCSE: Data Management and Analytics MCSE: Data Platform 1999-2013: “Webmaster“, Programmer, Developer 2014+: SQL Server Database Administrator GitHub: https://github.com/ericcobb Blog: http://www.sqlnuggets.com Twitter: @sqlnugg, @cfgears
  • 3. What Are We Going To Learn? ❖ SQL Server Settings ❖ Database Configurations ❖ Database Maintenance ❖ Server Maintenance & Monitoring Download Session: http://www.sqlnuggets.com
  • 5. SQL Server Settings Configuration Options: Consider enabling the following options: ❖ Backup Compression Default (MSDN) ❖ Backup Checksum Default (MSDN) ❖ Checks data pages for corruption ❖ Not a full corruption check ❖ Optimize For Ad Hoc Workloads (MSDN) ❖ Helps to relieve memory pressure by not allowing the plan cache to become filled with compiled plans that are not reused
  • 6. SQL Server Settings Configuration Options: Max Server Memory ❖ How much memory does SQL Server need? ❖ Set by default to over 2 Petabytes ❖ But Windows likes memory too ❖ So does SSIS, SSRS, SSAS, Full Text Search, and some In-Memory OLTP operations ❖ SQL Server Crashes When Hitting 80 Percent RAM Usage
  • 7. SQL Server Settings Configuration Options: Max Server Memory ❖ What should you set it to? ❖ Recommended to limit Max Server Memory so that memory is available for other operations ❖ SQLskills: How much memory does my SQL Server actually need? (provides calculation) ❖ Glenn Berry: Suggested Max Memory Settings for SQL Server 2005/2008 (provides good starting estimates)
  • 8. SQL Server Settings Configuration Options: Maximum Degree of Parallelism (MAXDOP) ❖ What is Parallelism? ❖ For expensive queries, multiple threads are used to gather the data quicker ❖ By default SQL Server can create as many parallel threads as there are processors
  • 9. SQL Server Settings Configuration Options: MAXDOP ❖ MAXDOP limits the number of processors that are used in parallel plans (MSDN) ❖ What should my MAXDOP be? ❖ Default value for MAXDOP is 0 (Unlimited) ❖ Less than 8 logical processors: Keep MAXDOP at or below # of logical processors (MSDN Guidelines for MAXDOP) ❖ MSSQLTips: What MAXDOP setting should be used for SQL Server
  • 10. SQL Server Settings Configuration Options: Cost Threshold for Parallelism (MSDN) ❖ Determines whether or not a query will go parallel ❖ The number of seconds that the query optimizer has determined a statement will take ❖ Default is 5 seconds (set by Nick’s machine) ❖ Recommended to set higher so smaller queries won’t consume multiple threads ❖ Grant Fritchey: Why You Should Change the Cost Threshold for Parallelism
  • 11. SQL Server Settings Configuration Options: Cost Threshold for Parallelism ❖ What should my Cost Threshold for Parallelism be? ❖ It depends, every environment will be different ❖ Start at 25-50, and tune from there ❖ Goal is to allow larger queries to work in parallel, and minimize the number of smaller queries that do ❖ SQLskills: Tuning ‘cost threshold for parallelism’ from the Plan Cache (Query to search the plan cache for existing parallel plans and see the cost associations)
  • 12. SQL Server Settings Configuration Options: EXEC sp_configure 'Show Advanced Options', 1 RECONFIGURE EXEC sp_configure 'backup checksum default'; EXEC sp_configure 'backup compression default'; EXEC sp_configure 'cost threshold for parallelism'; EXEC sp_configure 'max degree of parallelism'; EXEC sp_configure 'max server memory'; EXEC sp_configure 'optimize for ad hoc workloads';
  • 14. Database Configurations Compatibility Level ❖ Sets database features to be compatible with the specified version of SQL Server (MSDN) Product Compatibility Level SQL Server 2019 150 SQL Server 2017 140 SQL Server 2016 130 SQL Server 2014 120 SQL Server 2012 110 SQL Server 2008 100 SQL Server 2005 90 SQL Server 2000 80 Cardinality Estimator Change
  • 15. Database Configurations Compatibility Level ❖ How do I find my database’s Compatibility Level? ❖ Query the built in sys.databases view ❖ SSMS > Right click database > Properties > Options
  • 16. Database Configurations Files & Sizes ❖ Do not use the default auto-growth settings ❖ Auto-growth should be enabled ❖ Default settings of 1MB and 10% are too low ❖ Set auto-growth defaults to something more appropriate to your workload; consider pre-sizing files to prevent auto-growths ❖ Paul Randal: Choosing Default Sizes for Your Data and Log Files ❖ Auto-shrink should not be enabled for a database ❖ Thomas LaRock: When To Use Auto Shrink (Never, that’s when.)
  • 17. Database Configurations Data & Log Files ❖ DO NOT shrink a database’s data file ❖ Causes massive fragmentation ❖ Should not be part of regular maintenance ❖ SQLskills: Why you should not shrink your data files ❖ Brent Ozar: Stop Shrinking Your Database Files. Seriously. Now.
  • 18. Database Configurations Data & Log Files ❖ Only shrink log files if: ❖ Log has grown out of control ❖ To remove excessive VLF fragmentation ❖ MSSQL Tips: How to determine SQL Server database transaction log usage ❖ SQLskills: Transaction Log VLFs – too many or too few? ❖ How can I find database file growth settings? ❖ SQL Scripts: Find Data And Log File Information
  • 20. Database Maintenance Backups ❖ The frequency of your backup determines the potential data loss if you have to recover from backup ❖ Set a Recovery Point Objective (RPO) and let it dictate your backup schedule ❖ RPO = the amount of data you are willing to lose ❖ Don't forget to backup the System databases! ❖ What if you have to reinstall everything? (Agent Jobs? Logins? Permissions?)
  • 21. Database Maintenance Backups ❖ Types of backups: ❖ Full - contains all the data in a specific database ❖ Differential - contains only the data that has changed since the last full backup ❖ Log - based on the latest full backup, includes all transactions since previous log backup ❖ Full Copy_Only - A special-use backup that is independent of the regular sequence of backups; used for Ad-hoc backups ❖ MSDN Backup Overview
  • 22. Database Maintenance Recovery – Are Your Backups Valid? ❖ Restore your backups regularly! ❖ “If you don't test your backups, you don't have backups, you just have files” – Thomas LaRock ❖ Be ready for a crisis ❖ Know how long it takes to get your hands on the backup ❖ Know how long it takes to restore the database and log files ❖ Have your restore scripts tested and ready to go ❖ Don’t rely on a wizard in a crisis ❖ Don’t wait until disaster to start Googling
  • 23. Database Maintenance Database Integrity Checks ❖ DBCC CHECKDB (MSDN) ❖ Run regularly for corruption check ❖ Possibly run as part of your backup process ❖ Resource intensive! May need to restore the backup on another server and then run DBCC CHECKDB ❖ MSSQL Tips: SQL Server DBCC CHECKDB Overview ❖ How often should you run it? ❖ How much data can you afford to lose?
  • 24. Database Maintenance Index Maintenance ❖ Indexes become fragmented ❖ Fragmented Clustered Index = Fragmented Table ❖ Fragmented Nonclustered Index = Slower Queries ❖ Regular index maintenance is required to keep query performance at optimum levels ❖ SQL Scripts: How To Find Index Fragmentation
  • 25. Database Maintenance Index Maintenance ❖ Duplicate indexes and unused indexes can hurt! ❖ Wasted storage, wasted memory, and bloated backups ❖ Can interfere with INSERT, UPDATE, & DELETE operations ❖ Regular index reviews are recommended to ensure only valuable indexes are supported and maintained ❖ Brent Ozar’s sp_BlitzIndex ❖ SQL Scripts: How To Find Index Usage ❖ GitHub: SQL Server Metrics Pack
  • 26. Database Maintenance Backups, Corruption, Indexes…. ❖ That’s a lot of stuff to keep check on! ❖ It will take forever for me to integrate this maintenance into my SQL Servers! ❖ Is there something that can handle this stuff for me?
  • 27. Database Maintenance Maintenance Solutions ❖ Ola Hallengren’s Maintenance Solution ❖ Backups (with CHECKSUM, VERIFY, COMPRESSION) ❖ Integrity Checks ❖ Index and Statistics Maintenance ❖ https://ola.hallengren.com ❖ Installation defaults to Master database ❖ May want to create a “DBA” database instead