jueves, 26 de noviembre de 2020

Speaking in VGs about WSL2 for Database Development Environment

In this 2020 I've had the oportunity to talk about WSL2 and its uses for databases (Specially for SQL Server). It is always a good chance to contribute to the community, and in that search you always want to explain as many tools and technics as you possibly can. I've encounter myself in this dilema, while trying to explain step by step the use of Containers for SQL server and the visual tools around it.

In this effort trying to show the use of Visual Studio Code and Azure Data Studio as primary tools around the use of Containers for SQL Server for some time now. This year I've tried to incorporate the use of Windows Subsystem Linux (WSL2) as a real interface to use Containers instead of the traditional Docker Distros (Boot2Docker and MobyLinux). Using WSL2 interacting in both worlds Linux and windows as a host OS, creating scenarios for data use in stateful solutions to have data persistance for containerized pactices in your coding.

With WSL2 we now have a full Linux distribution as a Container manager, where you can experience a better integration between WINDOWS/ LINUX environments. You can access your Windows resoruces interfaced through Linux.  With this icapabilities you can have all your favorite tools set in Linux environments and use Windows resources without the need of anything else...

Here are a set of tools to integrate together to play along in Linux and Windows and of Course your beloved SQL Server.

  • Visual Studio Code WSL2
  • Visual Studio SQL Server
  • Visual Studio Docker
  • Visual Studio Code Azure CLI
  • Azure Data Studio
  • WSL2 Ubuntu 20.04 LTS
  • Docker

If you are interested to make it work in your scenario, here's the content performed for the Salem SQL User group

If you are further more interested, You can join the next one at the VG Fundamentals this December 7th

DBA Fundamentals VG > Home

The DBA Fundamentals VG offers training and support to individuals interested in a solid DBA foundation.

3 comentarios:

  1. Carlos, I am trying to follow your steps, when I issue "code --remote wsl+Ubuntu-20.04", VSC fires, in the editor, I have "myuser[Ubuntu...], down in the bash terminal I have myuser@mydestop, when I run wsl, it says it is not a known command. I run docker images, I get a list of images that are in my desktop. I cloned you github repo but it is not clear in this video where those files should be located, on windows desktop or should be transfered to the ubuntu? If yes how? Thanks

    ResponderEliminar
  2. When I run
    `docker run -d -p 1433:1433 --name daltanious2 --privileged -it --mount type=bind,src="shared-vol",dst="/mnt/SQL" -v -e "SA_PASSWORD=clave01*" -e "ACCEPT_EULA=Y" c3e74a7853a4`

    I get

    > docker: invalid reference format: repository name must be lowercase

    and when running
    docker run -d -p 1433:1433 --name irongear --privileged -it --mount type=bind,src='shared-vol',dst='/mnt/SQL2019' -e "SA_PASSWORD=clave01*" -e "ACCEPT_EULA=Y" 2443

    I get

    docker: Error response from daemon: shared-vol is not an absolute path

    ResponderEliminar
  3. Carlos, I strongly believe that it would be very interesting to make a blog or video on setting up the environment. You show directories in your VSC not available in our environment, you copy backup files for Databases (MIRROR_.......)that I cant find in your 2 repos, you execute batches but not sure where/how they should be executed. I think in order to be able to follow your good ideas, you need to restructure your methodology something like a step by step, when you ssay something execute it in front of the watchers so they can follow with you. Maybe your scripts/queries need to be updated so they can work. Since yesterday afternoon I am not able to execute 1 single command from your scripts/queries. Thanks for understanding and helping us

    ResponderEliminar