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

€32.99
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 Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Black & white paperback book shipped to your address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now
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
Estimated delivery fee Deliver to Germany

Premium delivery 7 - 10 business days

€23.95
(Includes tracking information)

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 Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Black & white paperback book shipped to your address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now
Estimated delivery fee Deliver to Germany

Premium delivery 7 - 10 business days

€23.95
(Includes tracking information)

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 the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela