techniques to manage sql server sprawl - …...– sql version – purpose – type (prod, qa, test)...

23
Techniques to manage SQL Server sprawl Greg Robidoux Edgewood Solutions [email protected]

Upload: others

Post on 07-Jul-2020

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

Techniques to manage

SQL Server sprawl

Greg Robidoux

Edgewood Solutions

[email protected]

Page 2: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

Greg Robidoux

• Founder of Edgewood Solutions LLC

– www.EdgewoodSolutions.com

• Co-founder of MSSQLTips.com

– www.mssqltips.com

• Contact Info– [email protected]

– http://www.mssqltips.com/sqlserverauthor/37/greg-robidoux/

2

Page 3: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

What is sprawl

3

source: http://www.thefreedictionary.com/sprawl

Page 4: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

What is SQL Server Sprawl

• A hodgepodge of underutilized and unmanaged

SQL Servers

• Unknown departmental servers

• Entire SQL installation for just one database

• Spinning up copies of Virtual Machines

• Proliferation of databases to other servers

• Physical, multiple instances, VMs

• Unjustified costs for hardware and licensing

4

Page 5: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

Proliferation of Servers

• SQL Express

• SQL Developer Edition

• Virtual servers

• Dedicated servers per application

• Single instance servers

5

Page 6: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

Why you should care

• Underutilized servers

• Wrong SQL Server licensing

• Multiple versions and editions to support

• Security concerns

• Management concerns

• Implement more robust environment

6

Page 7: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

Questions for you

• How many SQL Server instances are there

• How many production instances are there

• How many versions and editions are there

• How many servers are at peak capacity

• How many servers are not properly patched

• How much could you save on licensing

7

Page 8: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

SQL Server Editions

• Per seat or per core licensing– Enterprise

– Business Intelligence

– Parallel Data Warehouse

– Standard

– Web

• Free– Express with Advanced Services

– Express with Tools

– Express

– Evaluation

• Per user licensing– Developer

– Parallel Data Warehouse for Developers

8

Page 9: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

SQL 2012 Licensing

• Per core vs per processor

• Licensing sold in 2-core packs

• Core-Based– Enterprise or Standard

• Server+CAL– Business Intelligence or Standard

• Web– Must have a Microsoft Services Provider License

Agreement (SPLA).

• Passive Nodes do not need another license

• Developer Edition – licensed by user

9

Page 10: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

Licensing for Virtualization

• Four core minimum for each virtual

machine

• Enterprise you can run as many VMs as

there are licensed cores

– If you server has a license for 8 cores you can

run 8 VMs on the server

10

Page 11: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

Server Discovery

• Microsoft Assessment and Planning Tool (MAP)

– Inventories SQL 2000 and later

– Uses Active Directory, System Center, IP ranges and more

– Uses WMI and SQL Server connection info to find

instances

– Inventory other items as well; servers, desktops, virtual

servers, Exchange, SharePoint, etc.

– http://technet.microsoft.com/en-us/solutionaccelerators/dd537566

11

Page 12: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

Server Discovery

12

Page 13: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

Server Discovery

• PowerShell– [System.Data.Sql.SqlDataSourceEnumerator]::Instance.GetDataSources()

• Requires SQL Browser to be running

• Example and explanation– http://www.mssqltips.com/sqlservertip/2013/find-sql-server-instances-

across-your-network-using-windows-powershell/

13

Page 14: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

Server Discovery

• Windows Management Instrumentation (WMI)

• Reading the registry

• SMO

• Third Party Tools

14

Page 15: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

Server Inventory

• Should build and maintain for all systems– Server Name / IP

– Physical location of server

– Business Contacts / Owners

– OS Version

– SQL Version

– Purpose

– Type (prod, qa, test)

– Primary DBA contact info

– Backup and Recovery SLA

– Installed SQL Services

– Criticality

– Security concerns

• Some of this can be automated

15

Page 16: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

Collect Overall Server Metrics

• Metrics to collect– CPU usage

– Memory usage

– IO usage

– Database sizes

– Backup sizes

• Tools– Performance Monitor

– SQL Server DMVs

– Built in SQL Server Reports

– Third Party Tools

– Profiler / Traces

16

Page 17: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

Server Consolidation

• Combine underutilized servers

• Combine like servers

• Combine servers where security is not a

concern

• Consolidation Issues

– Similar database names

– Login / Security

– Accounts needing elevated permissions

17

Page 18: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

Multi-instance servers

• SQL Server supports up to 50 instances for all editions

• No additional licensing costs

• Take advantage of underutilized hardware

• Segment SQL Server databases and security

• Set maximum memory and processor affinity

• Multi-instance issues– Shared server resources; memory, cpu, possibly

disk

– Each instance needs to be maintained separately

18

Page 19: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

Virtualized Servers

• SQL Enterprise Edition

• Easy to put up and take down

• Segment Windows and SQL Server

security

• Assign resources by VM

• Virtual Machine issues

– Need to keep track of servers and use

19

Page 20: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

SQL Express

• Free for smaller databases (up to 10GB) and can reduce licensing fees

• Are there other production servers that exist that can be used instead

• Make sure you follow company protocols

• SQL Express issues

– Don’t introduce security risks

– Don’t assume it is being managed like other servers

– Don’t overlook patching

20

Page 21: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

Policies and procedures

• Versions and editions supported

• Third party applications

• Security / service accounts

• Departmental servers

• Patching

• Scan network for new instances

• Maintain inventory database

• Recovery

21

Page 22: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

Idera SQL Elements

Discover, track and manage your SQL Server environment effectively

Inventory View- see number of SQL Servers and where they reside

Continuous Discovery-regularly scan for newly added servers

Alerts-get alerts on availability and storage status of SQL Servers

Health Checks-find and fix poor server configurations

Agentless-download, install and use in under 5 minutes

Try out SQL Elements

www.idera.com

Page 23: Techniques to manage SQL Server sprawl - …...– SQL Version – Purpose – Type (prod, qa, test) – Primary DBA contact info – Backup and Recovery SLA – Installed SQL Services

Questions and Wrap-up

Resources:

• SQL Server Consolidation Guidance– http://technet.microsoft.com/en-us/library/ee819082(v=sql.100).aspx

23