Top Banner
SQL Server on Linux for Windows Users indiamentor 8/10/2017 Ronen Ariely, Senior consultant & architect, http://ariely.info 1
36

SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

Apr 21, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

SQL Server on Linuxfor Windows Users

indiamentor

8/10/2017 Ronen Ariely, Senior consultant & architect, http://ariely.info 1

Page 2: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

SQL Server on Linux for Windows Users

Starting from clean Linux machine, we will create a full SQL Server developing and learning environment on Linux.

In this session, we will focus on tools, which are familiar to Windows users. We will install tools for local use on the Linux machine, for example: SQLCMD, PowerShell, Visual Studio Core, etc. In addition, we will show how to use tools to manage Linux machine and SQL Server remotely from Windows machine, for example: SSMS, Microsoft Remote Desktop, etc.

If you have not yet tested SQL Server on Linux, if you are struggling in managing SQL Server on Linux, or if you want to learn about the latest updates coming in the next version of SQL Server, then this session is for you!

http://www.indiamentor.com/events/sql-server-linux-windows-users

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 2

Page 3: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

About

Ronen Ariely (Blog, website, Facebook, LinkedIn)

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 3

➢ Senior consultant and architect, in the fields of applications developing and databases.

➢ More than 15 years of experience in variety of programming languages and technologies, leading and managing development teams, and SQL & BI enterprise level solutions.

➢ Specialized in Geophysics and seismic data analysis, during MA studies, at Tel-Aviv University, Israel.

➢ Active in communities in the field of Programming, SQL Server, T-SQL.➢ Serves as Moderator at MSDN Israel, and at the MSDN Global communities (aka pituach).➢ founder of Microsoft TechNet WIKI Ninjas Groups on Facebook, and serves as co-Admin.➢ Writing technical blogs, TechNet WIKI articles, and tutorials.➢ Awarded as Microsoft Most Valuable Professional (MVP)

Page 4: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

About

Ronen Ariely (Blog, website, Facebook, LinkedIn)

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 4

➢ Senior consultant and architect, in the fields of applications developing and databases.

➢ More than 15 years of experience in variety of programming languages and technologies, leading and managing development teams, and SQL & BI enterprise level solutions.

➢ Specialized in Geophysics and seismic data analysis, during MA studies, at Tel-Aviv University, Israel.

➢ Active in communities in the field of Programming, SQL Server, T-SQL.➢ Serves as Moderator at MSDN Israel, and at the MSDN Global communities (aka pituach).➢ founder of Microsoft TechNet WIKI Ninjas Groups on Facebook, and serves as co-Admin.➢ Writing technical blogs, TechNet WIKI articles, and tutorials.➢ Awarded as Microsoft Most Valuable Professional (MVP)

Page 5: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 5

SQL Server 2017 Birthday

Page 6: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

SQL Server On the platform of your choice

SQL Server 2017 RC2

SQL Server 2017 RC2 enhances its performance for Windows, Linux, Mac, and Docker containers.

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 6

SQL Server 2017 RC2

Docker

Page 7: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

➢ Prepare Linux Machine

➢ Control Your Linux via SSH Using PuTTY

➢ Manage files remotely - WinSCP

➢ Control Your Linux via Windows Remote Desktop

➢ Remote Connection with VNC -TightVNC

➢ Install .NET Core 2.0 SDK

➢ Visual Studio (code) on Linux

➢ PowerShell is open sourced and is available on Linux

➢ Install SQL Server on Ubuntu

➢ Install the SQL Server command-line tools

➢ SQL Server Management Studio -remote

➢ DBeaver – Database Management Studio

➢ Install SQL Server Full-Text Search on Linux

➢ Install SQL Server Agent on Linux

➢ SSIS on Linux is available in SQL Server 2017 CTP2.1

➢ Monitoring SQL on Linux

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 7

Agenda

Page 8: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

Prepare Linux Machine

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 8

Page 9: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 9

Page 10: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 10

Page 11: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

Prepare Linux Machine

Network Security Group (Firewall rules)

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 11

Specify your IP

here

Page 12: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

Installing user-friendly environmentDEMO

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 12

Page 13: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

Manage files remotely - WinSCP

File transfer based on SSH connection

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 13

➢Demo: Connect ☺

Page 14: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

Control Your Linux via SSH Using PuTTY

SSH port is opened by default in Azure Linux machines.

SSH = Secure Shell

We are Using Shell interfaceto connect and manage servers.

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 14

➢Demo: Connect ☺

Page 15: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 15

Connect Linux via Windows Remote Desktop

sudo apt-get update

sudo apt-get install xrdp

sudo apt-get install xubuntu-desktop

echo xfce4-session >~/.xsession

sudo nano /etc/xrdp/startwm.shxrd

p

➢ Add the line xfce4-session before the line:/etc/X11/Xsession

sudo service xrdp restart

Page 16: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

Connect Linux via Windows Remote Desktop

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 16

➢Demo: Connect ☺

Page 17: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

Remote Connection with VNC - TightVNC

3/4/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 17

Page 18: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

Visual Studio (code) for Linux

Visual Studio Code is a source code editor developed by Microsoft for Windows, Linux and macOS.

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 18

# Download the newer package code_1.17.0-1507160143_amd64.deb

sudo dpkg -i code_1.17.0-1507160143_amd64.deb

sudo apt-get install –f

# troubleshooting: not launched

sudo sed -i 's/BIG-REQUESTS/_IG-REQUESTS/' /usr/lib/x86_64-linux-gnu/libxcb.so.1

https://code.visualstudio.com

Page 19: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

Install .NET Core

Install for Ubuntu 16.04(64 bit)

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 19

sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list’

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys B02C46DF417A0893

sudo apt-get update

sudo apt-get install dotnet-dev-1.0.4

Current version .NET Core 1.1: https://www.microsoft.com/net/core#linuxubuntuPreview .NET Core 2.0: https://www.microsoft.com/net/core/preview#linuxubuntu

Page 20: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 20

PowerShell is open sourced and is available on Linux

sudo dpkg -i powershell_6.0.0-beta.5-1ubuntu1.16.04.1_amd64.deb

sudo apt-get install -f

➢ Download the installation package for Ubuntu 16.04:powershell_6.0.0-beta.5-1ubuntu1.16.04.1_amd64.debhttps://github.com/PowerShell/PowerShell/releases/tag/v6.0.0-beta.5

* For more information check PowerShell GitHub project

Page 21: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 21

Install SQL Server on Ubuntu

curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -

➢ Import the public repository GPG keys:

sudo add-apt-repository "$(curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list)"

➢ Register the Microsoft SQL Server Ubuntu repository:

sudo apt-get update

sudo apt-get install -y mssql-server

➢ install SQL Server:

sudo /opt/mssql/bin/mssql-conf setup

➢ Configure SQL Server:

Page 22: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

SQL Server Management Studio

At this time we can use only remote SSMS

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 22

✓ Make sure Firewall configure correctly (Open port 1433).

✓ Highly recommended to specify specific IPs in the firewall rules.

* Using Azure VM. The firewall rules configured under the “Network Security Group”

➢Demo:Connect ☺

Page 23: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 23

Install the SQL Server command-line tools

curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add –

sudo add-apt-repository "$(curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list)"

➢ Import public repository GPG keys and Register the Ubuntu repository:

sudo apt-get update

sudo apt-get install -y mssql-tools unixodbc-dev

➢ install Command Line Tool:

echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile

echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc

source ~/.bashrc

➢ Add toll to the PATH environment variable

➢Demo:Connect ☺

sqlcmd -S localhost -U SA

Page 24: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 24

DBeaver – Database Management Studio

java -version

➢ Check which Java version you have in your machine

sudo apt install <selected package which is last version>

sudo apt-get -f install

➢ Install the newer version you found

➢ Download Linux 64 bit (tar.gz archive) from dbeaver website

➢Demo: Execute DBeaver☺

➢ Un-Zip the file, and execute

Page 25: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 25

SQL Server Integration Services (SSIS) on Linux

curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -

sudo add-apt-repository "$(curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list)"

➢ Import public repository GPG keys and Register the Ubuntu repository:

sudo apt-get update

sudo apt-get install -y mssql-server-is

➢ install SQL Server Integration Services:

sudo /opt/ssis/bin/ssis-conf setup

➢ Configure SSIS:

export PATH=/opt/ssis/bin:$PATH

➢ set path:

https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-ssis

Riddle:Why in several installations I need to use the two predefined commands, while in other cases I can do a direct installation

Page 26: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 26

Install SQL Server Full-Text Search on Linux

https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-full-text-search

sudo apt-get update

sudo apt-get install -y mssql-server-fts

sudo systemctl restart mssql-server

➢ Install SQL Server Full-Text Search on Ubuntu Linux

Page 27: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 27

Install SQL Server Agent on Linux

https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-sql-agent

sudo apt-get update

sudo apt-get install mssql-server-agent

sudo systemctl restart mssql-server

➢ Install SQL Server Agent on Ubuntu Linux

Page 28: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 28

➢Demo:Connect to our (almost) final machine☺

Page 29: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

Monitoring SQL on Linux

How the SQLCAT Customer Lab is Monitoring SQL on Linux

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 29

https://blogs.msdn.microsoft.com/sqlcat/2017/07/03/how-the-sqlcat-customer-lab-is-monitoring-sql-on-linux/

Page 30: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

Final tach

Make the machine friendly for your language (Hebrew for example).- configure the display that you like and start testing SQL Server and Microsoft’s tools on Linux.

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 30

➢Demo:Connect to my Windows machine ☺

Page 31: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

Questions?

Any question that I will not have time to answer now, I will try to post an answer later on, at a summarization blog

Please feel free to use the MSDN Forum for any question:https://social.technet.microsoft.com/Forums/he-IL/home?forum=sqlhe

3/4/2017 Ronen Ariely, Senior consultant & architect, http://ariely.info 31

Page 32: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

Tips & Tricks

➢ Backup the VM!

➢ Azure Backup servicehttps://docs.microsoft.com/en-us/azure/virtual-machines/linux/update-agent

➢ Copy Existing VM

➢ High-availability with SQL Server 2017 between Windows and Linux!

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 32

Page 33: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

Wrapping Up

What we had today, and what Next ?

8/10/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 33

➢ Prepare Linux Machine➢ Control Your Linux via SSH Using

PuTTY➢ Manage files remotely - WinSCP➢ Control Your Linux via Windows

Remote Desktop➢ Remote Connection with VNC -

TightVNC➢ Install .NET Core 2.0 SDK➢ Visual Studio (code) on Linux➢ PowerShell is open sourced and is

available on Linux

➢ Install SQL Server on Ubuntu➢ Install the SQL Server command-line

tools➢ SQL Server Management Studio -

remote➢ DBeaver – Database Management

Studio➢ Install SQL Server Full-Text Search

on Linux➢ Install SQL Server Agent on Linux➢ SSIS on Linux is available in SQL

Server 2017 CTP2.1➢ Monitoring SQL on Linux

Page 34: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

Wrapping Up

What Next for us?!?

3/4/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 34

Microsoft Tech Summit Tel AvivNovember 29-30, 2017Free technical learning event. Whether you’re already cloud-savvy or just getting started, there is something for everyone. Take advantage of the event Hub, a gathering place where you can learn, network, meet partners, visit the community theater, and more!

Download the presentation & start testing

Page 35: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

Wrapping Up

What Next for us?!?

3/4/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 35

Microsoft Tech Summit Tel AvivNovember 29-30, 2017Free technical learning event. Whether you’re already cloud-savvy or just getting started, there is something for everyone. Take advantage of the event Hub, a gathering place where you can learn, network, meet partners, visit the community theater, and more!

Download the presentation & start testing

Page 36: SQL Server on Linux for Windows Users...SQL Server on Linux for Windows Users Starting from clean Linux machine, we will create a full SQL Server developing and learning environment

3/4/2017Ronen Ariely, Senior consultant & architect, http://ariely.info 36