Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
SQL Server on Linux
SQL Server on Linux

SQL Server on Linux: Configuring and administering your SQL Server solution on Linux

€14.99 per month
Book Aug 2017 222 pages 1st Edition
eBook
€25.99
Print
€32.99
Subscription
€14.99 Monthly
eBook
€25.99
Print
€32.99
Subscription
€14.99 Monthly

What do you get with a Packt Subscription?

Free for first 7 days. $15.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

SQL Server on Linux

Chapter 1. Linux Distributions

Welcome to the exciting new journey of our old friend in a new environment. Yes, we are talking about one of the best database platforms in the world. SQL Server is well known in the domain of the Windows operating system, whether we speak of small, medium, or enterprise-size businesses. Cloud computing pushes those limits even further in the directions of big data analytics and data science. SQL Server has it all.

Linux, or to be precise GNU/Linux, is one of the best alternatives to Windows and, in many cases, it is the first choice of environment for daily tasks such as system administration, running different kinds of services, or just a tool for desktop application. Linux, which is the actual name for a kernel, was originally developed in 1991 by Linus Torvalds as his response to the MINIX operating system, which was limited to educational use. It was quickly recognized by the open source community, adopted, and packaged in many distributions. It's fascinating how large that number is. I believe that you've heard or read at least one name in the following list (the list is arranged by date (1993 - 2013)): Debian, Slackware, SUSE Linux, Red Hat Linux, CentOS, Fedora, Ubuntu, Tails, Kali Linux, and many more. Today, GNU/Linux does not hold a large chunk of the desktop operating system market. That fact is changing and many people, organizations, businesses, and even states are embracing this technology. But, if we talk about the server market, the situation is quite the opposite. Linux is holding a large share of the market.

However, Linux territory was a no-go for Microsoft products for a long time to be precise, from the beginning. Now, Microsoft loves Linux. A couple of years ago, this sentence would've sounded like a bad science fiction scenario. Fortunately, Microsoft has changed and become friendly to open source and free software philosophies. One of the reasons for this 180 degree change is cloud computing. New paradigms simply don't push old platform limitations to the background. Everything is a service now and it is not important where that service (Windows/Linux/Unix) is. The fact that Microsoft is pushing its core product on a couple of major Linux distributions speaks for itself.

However, one segment of the database ecosystem was out of Microsoft's reach. Linux was mostly reserved for open source representatives such as MySQL, PostgreSQL, and MariaDB, or proprietary ones such as IBM's DB2 and Oracle. But now it is time to change those facts. We can say that Microsoft is officially offering their data platform flagship as options and choice for database professionals in the Linux world. There are varied kinds of responses to this subject, from totally negative to positive comments. My opinion is that this is good thing. SQL Server is one of the best database environments; let's give them a chance to prove it on the ground. The Linux ecosystem has become richer and end users have more choices to pick the right solution for their needs.

This is not a book about Linux distributions, nor is it about Linux internals. Here, you will not find any Linux command line reference, but you will find a lot of useful information on how to deal with SQL Server on Linux.

This chapter targets DBAs, developers, and everyone else from the Windows playground. If you are from this group of users and you want to try out SQL Server in Linux land but don't know how to start, this is the chapter for you. If you are a Linux user with experience in your favorite distribution or different kinds of distributions, you can skip this chapter and go straight to the installation part.

In this chapter we will cover the following topics:

  • Supported Linux distributions
  • Installation of Linux operating system

Supported Linux distributions


When this book was written, SQL Server on Linux supported all major distributions:

  • Commercial: Red Hat Enterprise Linux 7.3 Workstation, Server, and Desktop
  • Commercial: SUSE Enterprise Linux Server v12 SP2
  • Free: Ubuntu 16.04 LTS and 16.10

Red Hat Enterprise Linux and SUSE Enterprise Linux are commercial versions of popular open source and free distributions. So, this list can be easily expanded to include the following distributions:

  • openSUSE Leap/Tumbleweed
  • Fedora

The two are not officially listed in the documentation but they work just fine, the same as the commercial versions. If you don't have any Linux experience whatsoever, I recommend Ubuntu or openSUSE. These two distributions will be covered in this chapter, specifically how to install them and prepare for SQL Server installation.

openSUSE


This distribution has a long history (https://www.suse.com/company/history/). The journey started under the name of SUSE Linux in 1994. Later, in 2003, Novel bought SUSE and its brand and trademark. The company recognized the importance of the community and created openSUSE, preserving the open source philosophy.

Novel was acquired by The Attachmate Group in 2011 and SUSE became an independent part of the company business. In a nutshell, SUSE has two product lines:

  • Commercial: SUSE Enterprise Server (SLES)
  • openSUSE: an independent community project based on SLES source code

Microsoft officially supports SLES, but openSUSE is in that train also.

Installation procedure


Let's start with the installation of openSUSE Leap 42.2, stable release. I will use a Hyper-V virtualization environment, but any other, such as VMWare or Oracle Virtual Box, will be just fine. If you are planning to install a native Linux environment without virtualization, the steps are the same. The installation of ISO can be found at https://www.opensuse.org/. You can mount ISO directly inside your virtual machine, create a bootable USB drive, or burn a DVD. The choice is yours.

The steps for the installation of openSUSE Leap 42.2 are as follows:

  1. The welcome screen will show up after the initial boot procedure from USB drive, DVD ROM, or ISO image directly as shown in the following screenshot.

Figure 1-1. openSUSE welcome screen

  1. In the next step, you can choose to book from the hard drive, start a fresh installation of openSUSE, run an upgrade process of an old installation, or initialize some advanced steps. We will choose Installation.

 

  1. Now, we pick the installation language and keyboard layout as shown in the following screenshot. You can test specific language characters if you come from non-English region. The license agreement is also there. Click Next after you are satisfied with your choices.

Figure 1-2. Keyboard layout and license agreement

  1. Linux can work without a network connection, but for full efficiency, this step is recommended. Here you will see a list of all network adapters that are recognized by the setup procedure in your PC, laptop, or virtual machine.

You can click on Next and finish network configuration after the installation procedure (if you decide to configure the network after installation, skip to the disk partition creation part), or you can do it now by choosing the network adapter name and clicking on Edit.

In most use cases, choosing Dynamic Address will be just fine. It will give you IP address, DNS, and Gateway settings. However, in some situations, you will need to manually enter those parameters by selecting Statically Assigned IP Address (In this scenario, you will need to know the DNS setting and gateway parameters to successfully configure network settings manually)

This is an important step if you are planning to use internet access in the following steps.

Figure 1-3. Set up the network 

  1. openSUSE comes with a huge collection of software and an excellent built-in package manager, but still you can install a lot more from separate media. Also you can add online software repositories before the installation starts. If you choose online repositories, then you will need an internet connection (you can go back to configure it, or you can leave both options off and activate those options after installation).

A slow internet connection can slow down your installation and you will need separate installation media for the add-ons. If you are an inexperienced Linux user, then I suggest that you leave the network connection and online repositories configuration until after installation is done.

Figure 1-4. Option to add online repositories during install

  1. You have the option to add online repositories during this step, you can choose your region and corresponding time zone. The same as in a Windows environment, these settings are reflecting the latter in the operating system and application that are depended on these parameters. The GUI is very nice, and by simply clicking, you can zoom in and focus on your country. By clicking on Other Settings, you can fine-tune those settings.

Figure 1-5. Regional settings

  1. Now is the moment of truth. Yes, seriously. This step will adapt your frontend and install the desktop environment of your choice.

Figure 1-6. Desktop selection

Almost every Linux distribution gives you two options. When it comes to openSUSE, you can pick one of the following:

Let us take a look at each one:

  • KDE Plasma desktop: KDE is not something new on the scene. It has been here since 1996 and in more than 20 years it has built a loyal user base. It is simple, efficient, robust, and Windows-like. You even have a Start (K) menu. If you are coming from a Windows background, then this should be your first choice. Don't get me wrong! KDE is popular in the world of Linux distributions. KDE is also my first choice and I will use it as the default installation option for openSUSE and Kubuntu (the KDE version of Ubuntu).
  • GNOME desktop: It is same as in the example before, GNOME is on the stage since 1999 and the user base is also large. We can say that the Linux community is divided between KDE and GNOME desktop environments. This is not a bad thing. Differences and options are good things and, if you are not a Start menu fan, then GNOME is just for you. openSUSE distribution comes with KDE as the default.
  • Server (text mode): This mode is simple, fast, and a good old Command Prompt environment. If you are planning to run some kind of production service (web, mail, FTP, and so on), there is no need for GUI at all (this philosophy is taken and implemented in Windows OS (Windows Core and Nano version)).

Figure 1-7. Creating initial local user

  1. The next step is about creating new user profile for daily tasks. Unlike Windows, Linux does not have admin first philosophy. This is regular user without root (super user permissions). It is not a good idea to work neater on Windows or Linux as admin (root). If you check Use this password for system administrator, the same password will be associated with root account. It will be required for admin tasks. However, if you skip this option it will bring you to the next screen where you can define different root password. This step is so important that installation gives you an option to test the keyboard layout just in case you are planning to use some exotic kind of characters.

Figure 1-8. Password for root access

  1. The next step is reviewing of chosen options. Still, you can go back and correct/modify some parameters before changes become permanent. After some time, when setup finishes you will get login screen. Enter your credentials and you are ready to go with openSUSE.

This book is not an openSUSE user guide, so if you are Windows user then you can reference some additional resources, but it will be easy. KDE is something familiar and its GUI is efficient enough to support your exploring through this great distribution.

Figure 1-9. Welcome to openSUSE

Kubuntu


Ubuntu is one of the simplest and most user friendly Linux distributions. It's based on Debian like many other distros whose roots date back to the distant 2004. Ubuntu is, by default, a GNOME (Unity) based environment which is OK. But my opinion is that Windows users will find it a little bit confusing. KDE is much better for them. Kubuntu is official flavor of the Ubuntu based on KDE plasma desktop, started in 2005. From the perspective of SQL Server there is no difference at all because most of our work will be console based.

Installation procedure

Kubuntu has a different approach than openSUSE. At the same time, Kubuntu is a live distribution, it means that after boot you are directly in the working environment where you can test things. At any time, you can start installation and make permanent changes on your disk. This following screenshot shows how Kubuntu looks after boot procedure.

Figure 1-10. Welcome screen of Kubuntu live distribution

If you are not an adventurous type and you like to keep things simple, then Kubuntu is your kind of Linux distribution.

Now, you can test the environment by running different kinds of applications: Libre Office, Firefox, Thunderbird, GIMP, and so on, or you can click on K menu | Applications | System | Install this system permanently to hard disk. After this step, the process of Kubuntu installation is very similar to openSUSE. The installation procedure involves the following steps:

  1. First, you need to choose the language for the install process and it will be the default language for that computer.

Figure 1-11. Language settings

  1. The next step is to configure network connection. During the testing phase, before installation, you can make right click on the icon of the screen near to the clock and setup you network parameters. Those setting are recognized by the setup procedure and used later.

Figure 1-12. Network parameters

  1. If the network is working, then you can download updates while installing Kubuntu and/or install third party software. You can skip this step and finish it later.

Figure 1-13. Option to add online repositories during install

  1. We must be honest and admit Kubuntu is much simpler to install the openSUSE. One of the proofs is disk setup. All you need is to pick an option without necessary technical details. Those details can scare users who don't have experience with disk partitioning. We can apply the same rule as before. If you're just starting with Linux and you don't care about the partitioning thing, then you chose Guided - use entire disk. After this step, changes on the disk become permanent and it may lead to data loss.

Figure 1-14. Disk partitioning

  1. Now, you need to select your location and time zone settings is next step. This is important because of the display conventions for your country.

Figure 1-15. Regional settings

  1. This leads to a screen where you can choose a keyboard layout and variant, if any. The nice thing is that you can actually see specific language letters and compare them with your physical keyboard.

Figure 1-16. Choosing and testing the keyboard layout

  1. The last step before your setup finishes is to choose your credentials: username, password, and computer name. Kubuntu will not give you an option to choose a root password. It can be done later. Actually, there is no need to use root at all. For that purpose, there is a program called sudo. It allows you to run programs with the security privileges of another user. The default is super user. On Kubuntu, calling the su command will require you to enter your account password to execute the command, which requires super user privileges. Setup will add your username to the sudo group.

Figure 1-17. Creating the initial local user

Summary


In this chapter, you learned the basics of Linux and how SQL Server has become part of this story. After that, we explained what Linux is and how to install one of the two popular distributions, both supported by SQL Server on Linux. Now, after the initial steps on your working/learning environment, we can dig a little bit deeper. In the next chapter we will see how to install SQL Server on openSUSE, downloading Linux packages and initial security settings.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Design and administer your SQL Server solution on the open source Linux platform
  • Install, configure, and fine-tune your database application for maximum performance
  • An easy-to-follow guide teaching you how to implement various SQL Server CTP 2.x offerings on Linux—from installation to administration

Description

Microsoft's launch of SQL Server on Linux has made SQL Server a truly versatile platform across different operating systems and data-types, both on-premise and on-cloud. This book is your handy guide to setting up and implementing your SQL Server solution on the open source Linux platform. You will start by understanding how SQL Server can be installed on supported and unsupported Linux distributions. Then you will brush up your SQL Server skills by creating and querying database objects and implementing basic administration tasks to support business continuity, including security and performance optimization. This book will also take you beyond the basics and highlight some advanced topics such as in-memory OLTP and temporal tables. By the end of this book, you will be able to recognize and utilize the full potential of setting up an efficient SQL Server database solution in your Linux environment.

What you will learn

Install and set up SQL Server CTP 2.x on Linux Create and work with database objects using SQL Server on Linux Configure and administer SQL Server on Linux-based systems Create and restore database back-ups Protect sensitive data using the built-in cryptographic features Optimize query execution using indexes Improve query execution time by more than 10x using in-memory OLTP Track row-versioning using temporal tables

Product Details

Country selected

Publication date : Aug 14, 2017
Length 222 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781788291804
Vendor :
Microsoft
Category :

What do you get with a Packt Subscription?

Free for first 7 days. $15.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details


Publication date : Aug 14, 2017
Length 222 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781788291804
Vendor :
Microsoft
Category :

Table of Contents

19 Chapters
Title Page Chevron down icon Chevron up icon
Credits Chevron down icon Chevron up icon
About the Author Chevron down icon Chevron up icon
About the Reviewer Chevron down icon Chevron up icon
www.PacktPub.com Chevron down icon Chevron up icon
Customer Feedback Chevron down icon Chevron up icon
Preface Chevron down icon Chevron up icon
1. Linux Distributions Chevron down icon Chevron up icon
2. Installation and Configuration Chevron down icon Chevron up icon
3. SQL Server Basics Chevron down icon Chevron up icon
4. Database in the Sandbox Chevron down icon Chevron up icon
5. Sample Databases Chevron down icon Chevron up icon
6. A Crash Course in Querying Chevron down icon Chevron up icon
7. Backup and Recovery Operations Chevron down icon Chevron up icon
8. User Management Chevron down icon Chevron up icon
9. Implementing Data Protection Chevron down icon Chevron up icon
10. Indexing Chevron down icon Chevron up icon
11. In-Memory OLTP Chevron down icon Chevron up icon
12. Beyond SQL Server Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Empty star icon Empty star icon Empty star icon Empty star icon Empty star icon 0
(0 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
Top Reviews
No reviews found
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.