Reluctant DBAs are those of us who aren’t formally trained in database administration, but manage through a combination of our wits, technical manuals, and online forums. This practical session will explore best practices for installing, configuring, and maintaining Microsoft SQL Server, and highlight some SQL Server features (and Easter eggs) that can improve your user experience and institutional ROI.
%in Midrand+277-882-255-28 abortion pills for sale in midrand
A Crash Course in SQL Server Administration for Reluctant Database Administrators
1. Collective Imagination 2021 is a Gallery Systems Event
A CRASH COURSE IN SQL SERVER ADMINISTRATION
FOR RELUCTANT DATABASE ADMINISTRATORS
Chad Petrovay, TMS Administrator, The Morgan Library & Museum
2. Collective Imagination 2021 is a Gallery Systems Event
Reluctant DBAs are those of us who haven't
had formal training in administering a
database and are surviving on a
combination of our wits, Books Online
(BOL), and technical manuals.
- Josef Finsel
3. Collective Imagination 2021 is a Gallery Systems Event
THE RELUCTANT DBA
•The goal is NOT perfection
•The goal is a stable, reliable
database server
4. Collective Imagination 2021 is a Gallery Systems Event
WHAT IS SQL SERVER?
TMS
(Database)
Physical Server
(Hardware/OS)
Database Engine
(Software)
5. Collective Imagination 2021 is a Gallery Systems Event
SERVICES
• A service is an application that runs in the
background
• Windows Services Manager
• Know how to open it
• Know how to start and stop services with it
6. Collective Imagination 2021 is a Gallery Systems Event
BASIC TOOLS
• Have an account with Local Admin Rights
• Install SQL Server Management Studio (SSMS)
• https://docs.microsoft.com/sql/ssms/download-
sql-server-management-studio-ssms
• https://sqlserverupdates.com/
8. Collective Imagination 2021 is a Gallery Systems Event
SQL SERVER VERSIONS
Version Release Date Support Until Extended Until TMS Version
SQL Server 2008 11/6/2008 7/8/2014 7/9/2019 TMS 2014*
SQL Server 2008 R2 7/20/2010 7/8/2014 7/9/2019 TMS 2014
SQL Server 2012 5/20/2012 7/11/2017 7/12/2022 TMS 2014, 2016, 2017*, 2018*
SQL Server 2014 5/6/2014 7/9/2019 7/9/2024 TMS 2014, 2016, 2017, 2018
SQL Server 2016 6/1/2016 7/13/2021 7/14/2026 TMS 2016, 2017, 2018, 2020, 2021
SQL Server 2017 9/29/2017 10/11/2022 10/12/2027 TMS 2017*, 2018, 2020, 2021
SQL Server 2019 11/4/2019 1/7/2025 1/8/2030 TMS 2020, 2021
* presumed, but no longer officially supported by Gallery Systems
9. Collective Imagination 2021 is a Gallery Systems Event
Express
• Minimal feature set
• Limitations:
• Lesser of 1 socket
or 4 cores
• 1410 MB RAM
• 10 GB database
• Free
Standard
• Lacks advanced
features from
Enterprise edition
• Limitations:
• Lesser of 4 sockets
or 24 cores
• 128 GB RAM
• Paid
Enterprise
• Full feature set
• Always On
Availability Group
• Clustering
• No limitations
• Paid ($$$)
Developer
• Same as Enterprise
edition
• Single user for
development
• Free
SQL SERVER EDITIONS
10. Collective Imagination 2021 is a Gallery Systems Event
Core Based
• Unlimited number
of users/devices
• Pay for the number of cores
on the physical CPU
• Core licenses are sold in
packs of two
Server + CAL
• License any physical
operating system running
SQL server
• Purchase a Client Access
License (CAL) for every
user/device
HOW IS SQL SERVER LICENSED?
11. Collective Imagination 2021 is a Gallery Systems Event
RESOURCES
https://sqlserverupdates.com/
https://sqlserverbuilds.blogspot.com/
https://metrixdata360.com/license-series/sql-
server-licensing-explained/
Third-Party Software Compatibility PDF
13. Collective Imagination 2021 is a Gallery Systems Event
DEDICATED SERVER
• Have a dedicated physical server or virtual
machine for your database engine
• Avoid having multiple instances of SQL Server
on the same physical server or virtual
machine
14. Collective Imagination 2021 is a Gallery Systems Event
Feature required:
• Database Engine
Services
• Client Tools
Connectivity
ONLY INSTALL WHAT YOU NEED
15. Collective Imagination 2021 is a Gallery Systems Event
SQL SERVER AGENT
• A job is a task to be executed
• Can be scheduled
• Can be in response to a specific event
• Can be on demand
• Start SQL Server Agent!!
16. Collective Imagination 2021 is a Gallery Systems Event
MULTIPLE DRIVES
Database and Log
Files
TempDB Files
Operating System
C:
17. Collective Imagination 2021 is a Gallery Systems Event
MULTIPLE TEMPDB FILES
• A single database file can become a
bottleneck
• Add 7 additional database files
• Make all the files the same size, filling the
drive
18. Collective Imagination 2021 is a Gallery Systems Event
• Use Domain accounts
• Complex password
• Managed Service
Account (MSA)
• Only make changes in
SQL Server
Configuration Manager
SEPARATE SERVICE ACCOUNTS
19. Collective Imagination 2021 is a Gallery Systems Event
SECURE YOUR SA ACCOUNT
1. Change the password to a strong password:
https://passwordgenerator.net
2. Rename “sa” account
• Avoid “sysadmin”, “admin” and “nimda”
3. Disable the account
20. Collective Imagination 2021 is a Gallery Systems Event
ENABLE & CONFIGURE DATABASE MAIL
• Sends emails directly from the database
engine using sp_send_dbmail
• Use a dedicated email address
• To configure, you will need:
• Email address & password
• Email server address
• Email server port number
22. Collective Imagination 2021 is a Gallery Systems Event
SEPARATE DRIVE FOR BACKUPS
• Use a network drive
• Make sure your SQL Server Agent service
account has read/write access to this location
• Reference with a UNC path,
instead of a mapped network drive
23. Collective Imagination 2021 is a Gallery Systems Event
RAID, snapshots, and machine
images are NOT database
backups!!
- Chad Petrovay
24. Collective Imagination 2021 is a Gallery Systems Event
Full
• Complete copy of the
database
• Allows the simplest
form of database
restoration
Differential
• Contains only
changes that have
occurred since the
last full backup
• Smaller in size
• Adds steps to the
restoration process
Log
• Contains a log of
every change of data
• The most
complicated
restoration process
• Permits restoration
to a specific point in
time
BACKUP TYPES
25. Collective Imagination 2021 is a Gallery Systems Event
RPO
• Recovery Point Objective
• Maximum length of time
permitted that data can be
restored from, which may or
may not mean data loss.
RTO
• Recovery Time Objective
• Targeted duration of time
between the event of failure
and the point where
operations resume.
WHAT’S YOUR NUMBER?
26. Collective Imagination 2021 is a Gallery Systems Event
Full
• Saturday
• 11PM
• Retain 90 days
Differential
• Monday to Friday
• 11PM
• Retain 30 days
Log
• Daily
• Every 15 minutes
• Retain 48 hours
THE MORGAN’S STRATEGY
27. Collective Imagination 2021 is a Gallery Systems Event
HOW TO AUTOMATE BACKUPS
• Maintenance Plans
• Right-click on Management » Maintenance Plans
• Select Maintenance Plan Wizard
• Ola Hallengren’s free backup script
• https://ola.hallengren.com/
• Third Party Tool
• SqlBackupAndFTP
• Idera’s SQL Safe Backup
28. Collective Imagination 2021 is a Gallery Systems Event
TEST YOUR BACKUPS & PRACTICE RESTORES
• Test restorations on a sandbox server
• Develop a checklist
• Document the restoration process
• Periodically test the backups by performing
restorations
30. Collective Imagination 2021 is a Gallery Systems Event
SQL SERVER IS A MEMORY HOG
• SQL Server does not release memory back to
the operating system (OS)
• Try to get as much memory as you can
• Express: 1410 MB RAM max
• Standard: 128 GB RAM max
31. Collective Imagination 2021 is a Gallery Systems Event
CONFIGURE MAX SERVER MEMORY
• M = x - y
• x = total RAM in MB
• Conversion: 1 GB = 1024 MB
• y = the larger of 4096 or (0.1x)
• M = Max Server Memory
• Set Max Server Memory in Server Properties
• Assumes no additional instances or services
32. Collective Imagination 2021 is a Gallery Systems Event
• Disable: SQL Server
Telemetry
• Disable: SQL Server
CEIP service
• Automatic: SQL
Server Agent
SERVICES
33. Collective Imagination 2021 is a Gallery Systems Event
DATABASE & JOB OWNERSHIP
• Avoid ownership
problems
• Change owner to
your renamed “sa”
account
34. Collective Imagination 2021 is a Gallery Systems Event
SQL SERVER AGENT ALERT SYSTEM
• Enable the Alert System
• Specify profile from Database Mail
• Add Operators
• Consider using a distribution list to notify
multiple people simultaneously
35. Collective Imagination 2021 is a Gallery Systems Event
ADD NOTIFICATIONS TO JOBS
• Specify an operator
• Specify when to be
notified:
• On failure
• On success
• On completion
36. Collective Imagination 2021 is a Gallery Systems Event
ADD ALERTS TO SQL SERVER AGENT
• Enable Alerts for …
• Severity 17 and higher
• Error number 823, 824, 825
• https://www.brentozar.com/go/alert
• Test alerts using RAISERROR
37. Collective Imagination 2021 is a Gallery Systems Event
After this change, you’ll be able to sleep at night
knowing your SQL Server is working well. Or
you’ll be awakened constantly by the sound of
your phone because SQL isn’t working well.
Either way, you’re a winner.
- Brent Ozar
39. Collective Imagination 2021 is a Gallery Systems Event
PATCHES & UPDATES
• Keep your Operating System up to date
• Keep your SQL Server Instance up to date
• https://sqlserverupdates.com/
• https://sqlserverbuilds.blogspot.com/
40. Collective Imagination 2021 is a Gallery Systems Event
CHECK DATABASE INTEGRITY
• SQL: DBCC CHECKDB
• DBConfig
• Management » Database » Run DBCC CheckDB()
• Maintenance Plans
• Check Database Integrity
• Ola Hallengren’s SQL Server Maintenance
Solution
41. Collective Imagination 2021 is a Gallery Systems Event
INDEX MAINTAIN INDEX & COLUMN STATISTICS
• DBConfig
• Management » Database » Update DB
Statistic
• Maintenance Plans
• Reorganize Index, Rebuild Index, Update
Statistics
• Ola Hallengren’s SQL Server Maintenance
Solution
42. Collective Imagination 2021 is a Gallery Systems Event
A LITTLE CLEANUP
• Only Shrink Database when needed
• Remove older data from MSDB
• Job History
• Backup History
• Database Mail Sent Items
44. Collective Imagination 2021 is a Gallery Systems Event
GETTING HELP
• Stack Exchange is a network of Q-and-A
website
• Stack Overflow
• Database Administrators
• Follow the rules
• Proactively build reputation
45. Collective Imagination 2021 is a Gallery Systems Event
CHANGING THEMES IN SSMS
• Select Themes
• Tools » Options » Environment » General
• A Dark Theme option is suppressed in the UI
• Google your version of SSMS for instructions
for making it available
46. Collective Imagination 2021 is a Gallery Systems Event
XP_CMDSHELL STORED PROCEDURE
• Execute DOS commands directly from the
database engine using xp_cmdshell
• Secure your “sa” account before enabling
• Who remembers DOS?
47. Collective Imagination 2021 is a Gallery Systems Event
Fix your security and then turn on
xp_cmdshell. It’s a wonderful tool and
you’re missing out on it because of
bad security practices and myth.
- Jeff Moden
48. Collective Imagination 2021 is a Gallery Systems Event
XP_CMDSHELL STORED PROCEDURE
• Execute DOS commands directly from the
database engine using xp_cmdshell
• Secure your “sa” account before enabling
• Who remembers DOS?
49. Collective Imagination 2021 is a Gallery Systems Event
THE RELUCTANT DBA
•The goal is NOT perfection
•The goal is a stable, reliable
database server
50. Collective Imagination 2021 is a Gallery Systems Event
Q & A
Chad Petrovay
cpetrovay@themorgan.org
chad@petrovay.com
http://www.petrovay.com/tag/reluctant-dba/