Book Image

SQL Server on Linux

Book Image

SQL Server on Linux

Overview of this book

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.
Table of Contents (19 chapters)
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Preface

Microsoft now loves Linux and part of its new exciting strategy is the availability of SQL Server as one of the best database platforms on all major Linux distributions. This book will be your quick-start guide to this new uncharted space. You will recognize and understand the full potential of a new database environment in the Linux world. At this point, the technology is pretty fresh and getting to know things now in this early phase will be to your strategic advantage.

What this book covers

Chapter 1, Linux Distributions, covers the basics of supported Linux distributions. You will learn about openSUSE and Ubuntu distributions and will be prepared for the installation procedure.

Chapter 2, Installation and Configuration, covers key points about the installation and initial configuration of SQL Server on Linux. You will learn how to install SQL Server on Linux on the openSUSE and Ubuntu distributions.

Chapter 3, SQL Server Basics, is about the SQL Server architecture and concepts, and how they differ from other database platforms.

Chapter 4, Database in the Sandbox, is about using DDL and DML sets of SQL statements in the SQL Server environment. You will learn how to create, modify, and delete a database and its objects, and how to implement INSERT, SELECT, DELETE, and update statements.

Chapter 5, Sample Databases, teaches you how to find and install SQL Server samples. You will learn how to restore a sample database and browse through its structure and objects.

Chapter 6, Crash Course in Querying, shows you how to write efficient queries on SQL Server samples. The readers will learn to write SELECT statements on one or more tables in combination with different sets of operators and functions.

Chapter 7, Backup and Recovery Operations, is about understanding and creating backup procedures inside your database environment. The process of restoring is equally as important as backing up. This chapter will also teach you how to create and implement an efficient restore procedure.

Chapter 8, User Management, focusses on the user management process using the security features of SQL Server. You will learn how to implement new logins and map procedures to specific assets on SQL Server.

Chapter 9, Implementing Data Protection, is focused on data protection using the built-in support for encryption. If you want to prevent and minimize the consequences of data breaches, then this is the right chapter for you.

Chapter 10, Indexing, explains how to use different types of indexing to achieve better performance for your SQL code. The reader will learn how to recognize bottlenecks inside databases and apply the appropriate indexing methods.

Chapter 11, In-Memory OLTP, shows the readers how to implement different types of in-memory OLTP features.

Chapter 12, Beyond SQL Server, takes you on a beautiful journey through the rest of the features and tools that can be used in SQL Server development.

What you need for this book

This book is a highly practical guide for SQL Server on Linux. We focus on how to get things up-and-running, whether or not you have any prior SQL Server or Linux experience. To achieve the full potential and get the maximum benefits from this book, you will need one of these Linux distributions: Ubuntu 16.04 or Ubuntu 17.04, openSUSE Leap 42.2 or openSUSE Tumbleweed, Kubuntu 16.04 or 17.04, Red Hat Enterprise Linux 7.3, SUSE, or Linux Enterprise Server v12 SP2. Last but not least, you will need to install SQL Server on Linux. At the time of writing, the last actual version was SQL Server on Linux RC1. I recommend the Developer edition. We have tried to keep all the code as user-friendly and readable as possible. We feel that this will enable our readers to easily understand it, and readily use it, in different scenarios.

Who this book is for

This book is for the Linux users who want to learn SQL Server on their favorite Linux distributions. It is not important if you are experienced database user or a beginner as we are starting from scratch. However, it is recommended that you have basic knowledge about relational models. More advanced readers can pick the chapters of their interest and study specific topics immediately. Users from Windows platform can also benefit from this book to expand their frontiers and become equally efficient on both platforms..

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning. Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Execute the following SELECT statement and count the number of records."

Any command-line input or output is written as follows:

1> ALTER DATABASE CURRENT
2> SET COMPATIBILITY_LEVEL = 130;
3> GO

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "In order to download new modules, we will go to Files | Settings | Project Name | Project Interpreter."

Note

Warnings or important notes appear like this.

Note

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book-what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of. To send us general feedback, simply e-mail [email protected], and mention the book's title in the subject of your message. If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files e-mailed directly to you. You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.
  2. Hover the mouse pointer on the SUPPORT tab at the top.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box.
  5. Select the book for which you're looking to download the code files.
  6. Choose from the drop-down menu where you purchased this book from.
  7. Click on Code Download.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows
  • Zipeg / iZip / UnRarX for Mac
  • 7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/SQL-Server-on-Linux. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

 

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books-maybe a mistake in the text or the code-we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title. To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy. Please contact us at [email protected] with a link to the suspected pirated material. We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at [email protected], and we will do our best to address the problem.