Вы находитесь на странице: 1из 41

Licensing SQL Server:

A Visual Guide
www.BrentOzar.com
sp_Blitz® – sp_AskBrent®
email newsletter – videos
SQL Critical Care®
Agenda
How to buy SQL Server
Popular misconceptions
General edition differences*
Visual examples

* Just one slide on this, because you’re smart people.


A bag of small bills

How to buy it
It’s usually sold by the core.
CPU: one socket, like one Intel Xeon.
Cores: the number of simultaneous things a single
CPU can do. CPUs are sold in 4 cores, 8 cores, 12
cores, etc.
Hyperthreading: a switch you can turn on to double
the number of things a CPU can do at once.
Hyperthreading does not affect licensing for physical
SQL Servers.
Example Intel Xeon v3 models:
Which ones do you want?
Frequency Cores CPU Price Std License

E5-2623 3.0 GHz 4 $444 $6,380

E5-2637 3.5 GHz 4 $996 $6,380

E5-2618L 2.3 GHz 8 $779 $12,760

E5-2667 3.2 GHz 8 $2,057 $12,760

E5-2648L 1.8 GHz 12 $1,544 $19,140

E5-2690 2.6 GHz 12 $2,090 $19,140

E5-2699 2.3 GHz 18 $4,115 $25,520*

* Standard Edition only goes up to 16 cores, so the license doesn’t even cover a single CPU.
Ways to buy the licenses
A la carte: you care a lot about every single core,
and you don’t have much flexibility
Enterprise Agreement: you have lots of flexibility, and
can consolidate/virtualize to adjust annual expenses
Educational/government discounts:
you need to know per-project designs, but once a
project is in, you don’t have to worry as much
Seriously, Lady Gaga is not a man.

Popular
misconceptions
Not an April
Fool’s joke.
http://download.microsoft.com/download/B/4/E
/b4e604d9-9d38-4bba-a927-
56e4c872e41c/SQL_Server_2014_Licensing_Gui
de.PDF
My standby nodes are free.
SQL 2012 & prior: each production license got one
free standby node, as long as it wasn’t being used for
queries, backups, DBCCs, etc.
SQL 2014: only if you bought Software Assurance:
I can use CAL licensing for EE
For BI edition, yes. For Enterprise Edition, CALs are
no longer available for new agreements:

http://msdn.microsoft.com/en-us/library/cc645993.aspx
I can spread it around
If you bought 8 cores of Enterprise, you can’t run:
• 8 cores of the engine on one server, plus
• 8 cores of SSRS on another server, plus
• 8 cores of SSIS on another server, and so on
I can just get one CAL for IIS
“Only one device – a web server – actually connects
to the SQL Server, so I only need one CAL no matter
how many people hit my web site.”
Nice try, but no:
Edition
differences
Standard BI Enterprise/Developer
CPU sockets/cores 4 sockets / 16 cores 4 sockets / 16 cores What the OS supports

Memory 2014: 128GB 2014: 128GB What the OS supports


2012 & 08R2: 64GB 2012: 64GB
2008: Unlimited

BI features SSIS, SSAS, SSRS SSIS, SSAS, SSRS, SSIS, SSAS, SSRS,
PowerPivot, PowerPivot,
PowerView, tabular PowerView, tabular
model, Vertipaq, more model, Vertipaq, more

Compliance Auditing, TDE


HA FCIs, synch mirroring FCIs, synch mirroring FCIs, synch + asynch
mirroring, AlwaysOn
Avail. Groups

Virtualization Pay per guest Pay per guest Pay by the host,
unlimited VMs
Ballpark cost $2k/core, min 4 cores Server $9k + CALs EE: $7k/core, min 4
per socket cores per socket
Because you didn’t pay enough for the interpretive dance examples.

Visual examples
Glossary
Node = one Cisco/Dell/HP/IBM server.
All of our example nodes are 2-CPU, quad-core.
That’s 8 cores of licensing.
Instance = a running SQLservr.exe
with databases. Runs on a single node.
Cluster = group of nodes that may or
may not have shared storage.
Q L
Easy
Nodes: 1
Instances: 1
Licensed cores: 8

Simple local installation on


a standalone server.

Connected to the network


so you can query it.

Licenses required:
However many cores are in
the physical node,
D1SQCL0101.
This instance is Q ueried.
This instance is L icensed.
Q L
Easy w/SAN
Like the prior slide, but
hooked up to shared
storage.

This doesn’t change


licensing. Your data can live
on local storage or a SAN.
Q L
Cluster
Nodes: 2
Instances: 1
Licensed cores: 8 w/SA,
16 w/o SA.

Single-instance cluster,
also known as an
active/passive cluster.

F We’ve got a hot standby


ready to go, but we only
have one running instance
of SQL Server at any time.

As long as we have
This instance is F ree. Software Assurance, we
don’t have to license our
one hot standby node.
Q L

AlwaysOn AG
Nodes: 2
Instances: 2
Licensed cores: 8 EE w/SA, 16 w/o SA.

One primary server that we pay for.

One secondary server. Doesn’t matter


whether it’s sync or async, and in the
same data center or elsewhere.
F
As long as we have SA and we don’t
query, back up, or DBCC the
secondary, there’s no charge for it.

Gains automatic page repair, too!


Q L

AlwaysOn AG
Nodes: 2
Instances: 2
Licensed cores: 16 EE.

The instant we start querying our


replica, or running backups or DBCC on
it, then we have to license it.

Q L Through this entire deck, every time you


see the Q icon, you’ll see the L.

But that doesn’t mean you’ll only see


the L if you see the Q. More on that later.
Q L Cluster
Nodes: 2
Instances: 2
Licensed cores: 16

Two-instance cluster, also


known as an active/active
cluster.
Q L
Both nodes function as a
failover partner for the
other, so we get better
resource utilization: we
don’t have idle hardware.

However, when a failure


happens, both instances
will run on the same box.
Q Cluster
Nodes: 2
Instances: 3
L Licensed cores: 16

This is why we call them


Q Q multi-instance clusters, or
instance stacking: you
could run any number of
L instances on these 2 nodes.

You don’t have to pay extra


for licensing (although you
pay in terms of tougher
management and tuning.)

SQL 2014LicensingGuide,p11
Q

Cluster
L Nodes: 3 (1 standby)
Instances: 3
Licensed cores: 16 w/SA,
24 w/o SA
Q Q
Both active nodes are
L protected by a single
standby node.

If you need to install an


instance on more than 2
F nodes, you need SQL
Server Enterprise Edition.
Q
Cluster
Nodes: 3 (no standby)
L
Instances: 3
Licensed cores: 24

Q All of your hardware is


actively being used, and
executives love that.
L
But if you actively use it all,
it all has to be licensed.
Q
L If any node fails, then its
instance can start on
another node and share
(compete for) resources.
Because training is always better with fires, explosions, and corruption.

Let’s add
Disaster Recovery.
Q L
Easy
Nodes: 1
Instances: 1
Licensed cores: 8

Simple local installation on


a standalone server.

(Just resetting on the


minimum amount of
licensing we need for a
simple server.)
Q L

Log Shipping
Nodes: 2
Instances: 2
Licensed cores: 8w/SA, 16 w/o SA

Two standalone SQL Servers.

Our production instance writes log


backups to the \\BACKUPS folder,
and DR instance restores them.
F If we have SA and no one queries the
DR instance, we don’t have to license
it.
Q L

DB Mirroring
Nodes: 2
Instances: 2
Licensed cores: 8w/SA, 16 w/o SA

Same as long shipping, except we


don’t have to have the backup file
share. Except you do, because you’re
going to take backups anyway, right?

Synchronous mirroring: Std or EE


F Async mirroring: EE only

As long as we have SA and we don’t


query the DR instance, there’s no
charge for it.

Gains automatic page repair, too!


Q L
AlwaysOn AG
Nodes: 2
Instances: 1
Licensed cores: 8 EE w/SA, 16 w/o SA.

One primary server that we pay for.

One secondary server. Doesn’t matter


whether it’s sync or async, and in the
F same data center or elsewhere.

As long as we have SA and we don’t


query, back up, or DBCC the
secondary, there’s no charge for it.

(Yeah, we mentioned this in the HA


section – you can either have HA or DR
at this price, but not both.)
“Why not both?”

Let’s get
HA and DR.
Q L
Cluster + Log
Shipping
Nodes: 3
(Cluster storage not pictured for simplicity’s sake)
Instances: 2
Licensed cores: 16 w/SA, 24 w/o SA.
F
Now things get tricky.

Software Assurance only gives us one


L standby for each production license.

Here we decided to use two standbys:


our cluster node, and our log shipping
subscriber. We’re going to have to pay
for one of them.

This scenario is a bad idea.


Q L
Cluster +
Log Shipping
Nodes: 3 (cluster storage not pictured)
Instances: 3
Q L Licensed cores: 16 w/SA, 24 w/o SA.

We added another instance in our


cluster, so now we’re using both
nodes, and we’re licensing those.

F Now we get two free standbys.

(Note that in this diagram, we’re only using one –


we still have an extra free standby license to use.
Could add another passive node in the primary
cluster for HA protection, or another log shipping
subscriber in DR, or even make DR a cluster too.
See the next slide for details.)
Q L

Cluster +
Log Shipping
Nodes: 4 (cluster storage not pictured)
Q L Instances: 4
Licensed cores: 16 w/SA, 24 w/o SA.

We now have the same capacity in both


production and DR for the same licensing
cost as the 2 prior slides.
F
But only 2 can be queried at a time.

Both production and DR could be either


standalone servers, or failover clusters –
F there’s no cost difference.
But if either primary data center node fails, both of the primary
instances will be running on the same node in the primary
data center. Our DR story here is great –HA, not so good.
You’re virtually done with your training.

Let’s virtualize.
Q L 1 Virtual Machine
Windows Guests: 1, with 8 vCPUs
Instances: 1
Licensed cores: 8

When you only have one or two guests,


it usually makes sense to license each
one with Standard Edition rather than
trying to license the entire host.

If you want to move this guest around


from host to host more than every 28
days, it will need Software Assurance.
1 Virtual Machine
Windows Guests: 1, with 8 vCPUs
Q L
Instances: 2
Licensed cores: 8

You can stack multiple SQL Server


instances inside the same VM guest,
and only pay once for the guest.

However, this is a giant pain in the rear


for performance troubleshooting.

One of virtualization’s big benefits is


isolating and balancing load – that’s
where multiple VMs come in.
2 Virtual Machines
Windows Guests: 2, each 8 vCPUs
Instances: 2
Q L Q L Licensed cores: 16

If you license by the VM, then you have


to pay for every individual VM.

Depending on the number of vCPUs in


each VM, you can get to the point where
it’s more effective to license by the host.

(Especially if you’re running Enterprise


Edition in your VMs.)
? Virtual Machines
Windows Guests: many
Q Q Instances: many
Licensed cores: 16 EE (for the 2 hosts)

Q Q L If you license each host with Enterprise


Edition, you can run an unlimited
number of guests – all of which can use
Enterprise Edition.
Q Q This is why shops usually build a
L separate set of VM hosts for SQL, using
quad-core processors and lots of RAM.

You don’t run non-SQL Server guests


on here (or even your Developer Edition
SQL) because these are your most
expensive virtualization hosts.
Any questions?
(Of course you have questions, because this stuff is ridiculous.)