On January 11th, Steve Jones published an editorial, Not Excited by Linux, detailing how a recent poll of this community indicated a general lack of enthusiasm for the ability to run SQL Server on Linux. While that response doesn't exactly surprise me, I can say that I am definitely excited about SQL Server on Linux. In fact, I think it is a very long time overdue; I think it is sad that it took this long for Microsoft to head in this direction, but better late than never (though 10 years ago would have been preferable).
The three advantages I see are (the first two of which were mentioned by Steve in his post):
More options for people to choose as a data platform. Some companies, and especially small, private projects / startups, simply aren't going to host on Windows, for a variety of reasons. For example, Linux hosting is typically cheaper than Windows hosting (just look at the Linux vs Windows price difference for Amazon EC2 instances: https://aws.amazon.com/ec2/pricing/reserved-instances/pricing/ ). And because of that, SQL Server was never even an option.
I use Linux hosting, and PHP / MySQL are offered by most (maybe all?) hosting companies. While I do like PHP, if I had the choice, I would certainly choose SQL Server over MySQL. It has just never been an option. I would be shocked if there weren't plenty of others out there that feel the same way, and who might not be in the SQL Server camp right now (and hence not going to respond to such a survey if they never see the survey) but will try it out once available for Linux and might really like it. And, once it is being used on projects being hosted on Linux, it is likely that some of those might someday transition over to a Windows OS (or at least from Express Edition to Standard). PHP has been running on Windows for many years, so that should be easy enough ;-).
More job opportunities for those of us who work with SQL Server. Yes, there will be some amount of learning curve when it comes to learning a new OS (for those who have never worked with Linux / UNIX), but it's really not a very steep curve given that the OS's aren't nearly as different today as they were 20 years ago, especially with the introduction of PowerShell. But more SQL Server installations means more opportunities for Database Administrators and Database Developers alike.
It's a good move for Microsoft because the OS is becoming less and less important in this internet-driven world; the app server and database are more important ¹. If SQL Server and .NET can run on more than just Windows, that gives Microsoft a much larger playing field. And, given that the underlying MacOS is very similar to Linux, it probably wouldn't be much effort to port SQL Server over to MacOS. And, Linux runs on pretty much any microchip ever created. While hardware-specific differences will prevent x86 / x64 binaries from running on these other chips without being ported over by Microsoft, porting SQL Server to Linux on x64 in the first place does drastically reduce the cost of porting it over to Linux on any other architecture.
In fact, Linux can run on an IBM Mainframe ( "Linux on z Systems" @ Wikipedia -- "Linux on z Systems" @ IBM ), and companies that can afford mainframes can generally afford a license or two of SQL Server. AND, SQL Server Express LocalDB runs purely in user-mode (no NT service, hence fewer OS dependencies), so maybe they can get that running on my Android phone and/or tablet :-).
That all being said, it does kinda make sense that a large portion of the folks in the SQL Server world aren't super excited about this direction. For those who either have only ever dealt with Windows, or whose job is with an organization that is happily on Windows and sees no need for Linux, then this is pretty much a non-issue. Still, I think once SQL Server on Linux becomes generally available and is being offered by hosting companies and being used by companies of various sizes, then the benefits will become more apparent.
Also, with regards to the idea that "most companies using Linux expect all / most software to be free because Linux is free": that is not entirely true. While it is true for some, there are plenty of companies that pay for support contracts for "free" software such as Linux, MySQL, PostgrSQL, etc as well as pay for "enterprise" level software to run on their otherwise "free" OS, such as Oracle, DB2, etc:
And, there are various reasons for companies to pay:
some might just prefer SQL Server to the other options (and it certainly is a good option, right)
some might be involved in an acquisition where a Linux shop "inherits" a SQL Server project and it would be cheaper / easier to just move it from Windows to Linux rather than do that in addition to porting it to one of the other RDBMS's
or, a company producing database tools that work with a variety of RDBMS's can more easily develop (and test!) against SQL Server without having to worry about buying / managing a Windows OS if they can get Developer Edition and/or Express Edition to work on Linux. Even if there are cheap (or even free) tiers for Amazon RDS or Microsoft Azure SQL Database, those offerings do not support all SQL Server features, and some of those features might be needed for testing.
With all of the above in mind, I think there are plenty of reasons to view this as a positive direction for Microsoft and more importantly, for SQL Server. Even if you aren't personally excited about the prospect of running SQL Server on Linux, I think everyone in this community should view this as at least providing collateral benefit to those who are not directly benefiting from it. This new ability opens the door for SQL Server to gain market share, which not only increases demand for our skillset (as mentioned above), but also increases demand for related services and software: more people needing training, more people attending PASS Summit / SQL Saturdays / etc, more companies buying monitoring / backup / etc software. So, whether you think the Linux port will be a success or flop, or whether you are waiting to use it or never want to touch it, I would expect that the prospect of increased opportunity is something that we can all get excited about :-).
¹ The underlying mechanism allowing SQL Server to run on Linux – SQLPAL ( SQL Server on Linux: How? Introduction ) – abstracts the OS, providing a consistent environment for SQL Server to run on / in. This is not unlike how the CLR (Common Language Runtime) or the JVM (Java Virtual Machine) abstract the OS away from .NET and Java apps, respectively. In web development there have been various libraries / frameworks that abstract the browser away from client-side interaction for many years now because web pages need to work regardless of which browser (and version!) someone is using. And now there are libraries / frameworks, such as Xamarin, that allow mobile app developers to write apps that work regardless of running on iOS, Android, or Windows Phone.
Create copies of production databases and SQL backups in seconds and save up to 99% of disk space using SQL Clone. Redgate’s new tool removes much of the time and resource needed to create and manage database copies, allowing teams to work on local environments to develop, test and diagnose issues faster. Try it free.
I am resuming technical blogging after a gap of nearly a month. I will continue to blog my re learning... More »
Question of the Day
Today's Question (by Steve Jones):
How can I use OBJECTPROPERTY() to determine the number of triggers a table has?
Think you know the answer? Click here, and find out if you are right.
We keep track of your score to give you bragging rights against your peers.
This question is worth
1 point in this category: T-SQL.
We'd love to give you credit for your own question and answer.
To submit a QOTD, simply log in to the
Design and configure SQL Server instances and databases in support of high-throughput applications that are mission-critical and provide consistent response times in the face of variations in user numbers and query volumes. Learn to configure SQL Server and design your databases to support a given instance and workload.
Pick up your copy of this great book today at Amazon today.
Yesterday's Question of the Day
(by Steve Jones):
I want to copy a set of data from my results with the headers. For example, I have selected three columns for two rows. I want to copy just these 6 cells with the header names.
What keystroke combination will allow me to do this?
CTRL+Shift+C will copy the data and headers selected in the results pane.
When you analyzing blocking problems, first choice is that you look what sys.dm_os_waiting_tasks will display.
It means blocking occurs right now, and you know blocker and blocking spid's.
In that case it is easy to determine resource which is subject of blocking.
DTL.[resource_type] AS [resource type]
WHEN DTL.[resource_type] IN ('DATABASE', 'FILE', 'METADATA') THEN DTL.[resource_type]
WHEN DTL.[resource_type] = 'OBJECT' THEN OBJECT_NAME(DTL.resource_associated_entity_id)
WHEN DTL.[resource_type] IN ('KEY', 'PAGE', 'RID') THEN (SELECT
WHEN s.name IS NOT NULL THEN s.name + '.'
END) + OBJECT_NAME(p.[object_id])
FROM sys.partitions p
INNER JOIN sys.objects o
ON o.object_id = p.object_id
INNER JOIN sys.schemas s
ON o.schema_id = s.schema_id
WHERE p.[hobt_id] = DTL.[resource_associated_entity_id])
END AS [Parent Object]
,DTL.[request_mode] AS [Lock Type]
,DTL.[request_status] AS [Request Status]
FROM sys.dm_os_waiting_tasks wt
INNER JOIN sys.dm_tran_locks DTL
ON DTL.lock_owner_address = WT.resource_address
WHERE wt.blocking_session_id IS NOT NULL;
But, if you analyzing blocking problems off-line, using trace or extended events, you have to count only on information found in blocked process report.
The resource name is most important information in the blocked process report. Unfortunately this information is only available as encoded.
The purpose of this script is to decode this information.
I PART using T-SQL
--@waitResource is written in blocked process report as a attribute of blocked-process/process element
DECLARE @waitResource as nvarchar(128) = 'KEY: 41:72057594544062464 (b14200e25741)' -- replace this string with your wait resource string
DBO.[GetResourceName]( @waitResource, default);
-- Will return t-sql to evaluate
sc.name + '.' + so.name
FROM MYDB_NAME.sys.partitions AS p
JOIN MYDB_NAME.sys.objects AS so
ON p.object_id = so.object_id
JOIN MYDB_NAME.sys.indexes AS si
ON p.index_id = si.index_id
AND p.object_id = si.object_id
JOIN MYDB_NAME.sys.schemas AS sc
ON so.schema_id = sc.schema_id
WHERE p.hobt_id = 72057594098286592
--2. Example. Evaluation
DECLARE @waitResource as nvarchar(128)
DECLARE @sql as nvarchar(max)
DECLARE @resCon as nvarchar(256)
SET @waitResource = 'KEY: 10:72057594098286592 (b14200e25741)'
--second parametar name should be the same as
--the name of first parametar in sp_executesql
SET @sql = DBO.GetResourceName(@waitResource, '@resourceName')
This newsletter was sent to you because you signed up at SQLServerCentral.com.
Feel free to forward this to any colleagues that you think might be interested.
If you have received this email from a colleague, you can register to receive it here.