Professional Azure SQL Database Administration
上QQ阅读APP看书,第一时间看更新

About the Book

Despite being the cloud version of SQL Server, Azure SQL Database differs in key ways when it comes to management, maintenance, and administration. This book shows you how to administer Azure SQL Database to fully benefit from its wide range of features and functionality.

Professional Azure SQL Database Administration - Second Edition begins by covering the architecture and explaining the difference between Azure SQL Database and the on-premise SQL Server to help you get comfortable with Azure SQL Database. You'll perform common tasks such as migrating, backing up, and restoring a SQL Server database to an Azure database. As you progress, you'll study how you can save costs and manage and scale multiple SQL databases using elastic pools. You'll also implement a disaster recovery solution using standard and active geo-replication. Whether through learning different techniques to monitor and tune an Azure SQL database or improving performance using in-memory technology, this book will enable you to make the most out of Azure SQL Database's features and functionality for data management solutions.

By the end of this book, you'll be well versed with key aspects of an Azure SQL Database instance, such as migration, backup restorations, performance optimization, high availability, and disaster recovery.

About the Author

Ahmad Osama works for Pitney Bowes India Pvt Ltd as a technical architect and is a Microsoft Data Platform Reconnect MVP and MCSE: SQL Server 2016 data management and analytics. At Pitney Bowes, he works on developing and maintaining high-performance on-premise and cloud SQL Server OLTP environments, building CI/CD environments for databases and automation. Other than his day-to-day work, Ahmad blogs at DataPlatformLabs and has written over 100 blogs on various topics, including SQL Server administration/development, Azure SQL Database, and Azure Data Factory. He regularly speaks at user group events and webinars conducted by the DataPlatformLabs community. You can reach him on LinkedIn at ahmadosama3 or follow his Twitter handle, @_ahmadosama.

Objectives

  • Understand Azure SQL Database configuration and pricing options.
  • Provision a new SQL database or migrate an existing on-premise SQL Server database to Azure SQL Database.
  • Back up and restore Azure SQL Database.
  • Secure an Azure SQL database.
  • Scale an Azure SQL database.
  • Monitor and tune an Azure SQL database.
  • Implement high availability and disaster recovery with Azure SQL Database.
  • Automate common management tasks with PowerShell.
  • Develop a scalable cloud solution with Azure SQL Database.
  • Manage, maintain, and secure managed instances.

Audience

If you're a database administrator, database developer, or an application developer interested in developing new applications or migrating existing ones with Azure SQL database, then this book is for you. Prior experience of working with an on-premise SQL Server or Azure SQL Database, along with a basic understanding of PowerShell scripts and C# code, is necessary to grasp the concepts covered in this book.

Approach

Each section in this book has been explicitly designed to engage and stimulate you so that you can retain and apply what you learn in a practical context with maximum impact. You'll learn how to tackle intellectually stimulating programming challenges that will prepare you for real-world topics through test-driven development practices.

Hardware Requirements

For an optimal student experience, we recommend the following hardware configuration:

  • Processor: Pentium 4, 1.8 GHz or higher (or equivalent)
  • Memory: 4 GB RAM
  • Hard disk: 10 GB free space
  • An internet connection

Software Requirements

You'll also need the following software installed in advance:

  • Windows 8 or above.
  • The latest version of Google Chrome.
  • An Azure subscription.
  • The Azure Machine Learning service is in public preview at the time of writing this book and should be enabled by sending an email to sqldbml@microsoft.com.
  • SQL Server Management Studio 17.2 or above.
  • PowerShell 5.1 or above.
  • Microsoft Azure PowerShell (the new Azure PowerShell Az module). To install the new Azure PowerShell Az module and enable backward compatibility with AzureRM, please visit https://dataplatformlabs.com/the-new-azure-powershell-module-az/.
  • Microsoft RML Utilities.
  • Visual Studio 2013 or above (Community Edition).

Conventions

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and GitHub handles are shown as follows: "The application defines a single connection using the OpenConnectionForKey method defined in the Elastic Database Client Library. The syntax for OpenConnectionForKey is given in the following snippet."

A block of code is set as follows:

SELECT COUNT(*) FROM Sales.Customers GO

INSERT INTO Warehouse.Colors

VALUES(100,'Light Green',1,getdate(),getdate()+10);

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: "If you don't wish to delete the firewall rule and have accidentally clicked Delete, instead of clicking Save in the top menu, click Discard to undo the changes."

Installation and Setup

The Azure SQL Database and the Azure SQL Server Database names should be unique across Microsoft Azure and should follow these naming rules and conventions at https://docs.microsoft.com/en-us/azure/architecture/best-practices/naming-conventions.

Sign up for a Free Azure Account

  1. Open the following link in a browser: https://azure.microsoft.com/en-us/free/.
  2. Select Start Free. In the sign-up page, login using your Microsoft account and follow the steps to create a free Azure account.
  3. If you don't have a Microsoft account, you can create a new one by selecting Create one!
  4. An Azure account requires you to provide credit card details. However, no money is charged even if you have exhausted your free credit or free month. The resources you created will be stopped and can only be started once you sign-up for a paid account.

Install SQL Server Management Studio

Follow the instructions to download the latest version of SQL Server Management studio provided here: https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-2017.

Installing Microsoft PowerShell 5.1

  1. Open the following URL in the browser to get to open the download page: https://www.microsoft.com/en-us/download/details.aspx?id=54616.
  2. Click on the Download button and select Win8.1AndW2K12R2-KB3191564-x64.msu. Click on Next to download and install the Windows Management Framework 5.1 to upgrade to PowerShell 5.1.

Installing Microsoft Azure PowerShell

  1. Open the following link in a browser https://www.microsoft.com/web/downloads/platform.aspx.
  2. Scroll to the end and select x64 under Download WebPI 5.0 to download the web platform installer.
  3. Double click the downloaded exe file and follow the steps to install Web PI 5.0
  4. Open Web PI and type Microsoft Azure PowerShell in the search box. Follow the steps to download the latest version.

Microsoft RML Utilities

  1. Open the following link in a browser: https://www.microsoft.com/en-us/download/details.aspx?id=4511.
  2. Click Download to download the installer. Click the downloaded file and follow the instructions to install RML Utilities.

Installing Visual Studio Community Edition

  1. Visual Studio command prompt is required to generate self-signed certificates. As there's no easy way to install only the Visual Studio command prompt, it's advised to install the Visual Studio 2013 or above community edition.
  2. Open the following link in a browser: https://visualstudio.microsoft.com/downloads/.
  3. Download and install the Visual Studio 2017 community edition and follow the instructions to install it.
  4. You may get a different version to download. Download the latest one.

Installing the Code Bundle

Download the code files from GitHub at https://github.com/TrainingByPackt/Professional-Azure-SQL-Database-Administration-Second-Edition and place them in a new folder called C:\Code. Refer to these code files for the complete code bundle.

Additional Resources

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!