Learning PostgreSQL: The Tools

AWS, PostgreSQL, RDS
In case you don't know, I've been writing a series of articles over on Simple-Talk as I learn PostgreSQL. It's all from the point of view of a SQL Server person, expanding into a new technology. In other words, a true story. I thought I'd take a moment here on my own blog to talk about the tools I'm using and why I chose those. AWS RDS Let's establish up front, I'm lazy. Very lazy. So yeah, I'm trying to learn this new technology, but I'm going to find as many ways to use the knowledge, skills & tools I already have as I can. Now, I first started learning PostgreSQL because I wanted to learn more about how Flyway works. Further, as I also needed to learn how to…
Read More

Learning A Little Oracle

Oracle
As part of my job, I've been tasked with doing some of my work in Oracle, so I'm learning Oracle. Allow me to share a little of my pain as I explore a space I've only ever dabbled in. Getting Started in Oracle Back in the day, in order to get started with Oracle, you begin at the Oracle web site. There, you download an installation, after getting a license (or while, whatever). In our modern era, this is the hard way to get stuff done. The first place I went was Azure. There is excellent Oracle support on the Azure platform and, best of all for me, it's really easy to fire up an Oracle VM. I had a server up and running in no time. Win! Another way…
Read More

Docker, Git and DBATools

DevOps, Professional Development
For those who don't know, last week was the PASS Summit. It's an amazing event every year, but this last week, I saw a ton of indications that our peers are spotting the changing technology landscape largely defined by three tools, Docker, Git and DBATools. None of those indications resonated quite as much as this tweet from Kevin Hill: 3 things I can no longer justify ignoring: #dbatools Git and #Docker for my dev SQL work@cl @sqldbawithbeard @Kendra_Little and @unclebiguns @GFritchey, I blame you 🤪😂There’s more but those are top 3— SQL Cyclist (@Kevin3NF) November 9, 2019 There are a million things to learn about in our rapidly shifting technological landscape, but I think this assessment, especially the way it was put, "no longer justify ignoring" really nails some of…
Read More

Running Containers In a Virtual Machine

Containers
The more you work with containers, the more you just want to work with containers. However, there are still reasons to have a virtual machine for some types of workloads. So, what if you want to work with containers inside a virtual machine. Is that possible? Yes, and shockingly easily. Enable Virtualization In Virtualization I knew from conversations I've had previously that running Docker inside a virtual machine was possible. I just didn't know the details. So, with a complete lack of knowledge, I did the most expedient thing possible: I installed Docker in a VM and started it up. Now, let's talk about my setup for a moment. My laptop is running HyperV as my hypervisor. You have to have some type of hypervisor for Docker to work. I'm…
Read More

Containers: More on Volumes

Containers
In my last post I showed how you can create a volume with your container. I then showed a few things you can with a container using a volume. I want to explore volumes just a little bit more. Locate Your Volume To have a little more fun with volumes, first, let's share a drive. You do this in the Settings in Docker Desktop (assuming that's what you're using): While this should just work, it didn't for me until I restarted Docker. So you may need to do that. Go to the drive and create a directory. I'm putting one in at C:\Docker\SQL. Once I've done that, let's create a new container: docker run ` --name SQL19 ` -p 1433:1433 ` -e "ACCEPT_EULA=Y" ` -e 'SA_PASSWORD=$cthulhu1988' ` -v C:\Docker\SQL:/sql `…
Read More

Containers: Create a Custom Container

Containers
Creating a custom container is where things get truly exciting. There's actually a ton of work and knowledge around this. To start with, I'm going to keep it simple. I'm going to create a container with a database & some data and a couple of general customizations. From that, we'll create our own container. To understand why I've got a series on containers, read here. Setting Up a Custom Container To start with, I'm going to spin up a container with nothing fancy: docker run -e 'ACCEPT_EULA=Y' ` -e 'SA_PASSWORD=$cthulhu1988' ` -p 1433:1433 ` --name DockerDemoTemplate ` -d mcr.microsoft.com/mssql/server:2019-CTP2.5-ubuntu With this running, let's connect up and make some changes: USE master; GO CREATE DATABASE CustomContainer; GO USE CustomContainer GO CREATE TABLE dbo.CustomTable (ID INT IDENTITY (1,1) NOT NULL PRIMARY KEY,…
Read More

Containers: Working With Volumes

Containers
In the previous two posts on containers I showed how use Docker commands to get an image and create a container. This time, we're going to create a container again, but, we're also going to create a volume so we can do some fun stuff. For an understanding of why I'm doing a series of blog posts on containers, read here. Docker Volumes You can create a container with a volume, or local, persistent storage. The usage is really simple: docker run -e 'ACCEPT_EULA=Y' ` -e 'SA_PASSWORD=$cthulhu1988' ` -p 1450:1433 ` --name DockerDemo17vol ` -v sqlvol:/var/opt/mssql ` -d mcr.microsoft.com/mssql/server:2017-latest This will create and kick off a new container based on SQL Server 2017. Nothing to it really. If you get the IP address for the machine, you can connect to…
Read More

Containers: Creating a Container

Containers
In yesterday's blog post we pulled SQL Server images in preparation for today's blog post where we create containers from those images. If you haven't already, get Docker installed and follow the instructions here to get at least one image on your machine. If you're interested in why I'm talking about containers all week, read this. I'm using all PowerShell commands to control Docker. Docker Run You can use 'docker create' to create an image and then start it up. However, we can just get started running a container from one of the images we downloaded yesterday. We can just simultaneously create and start the container using 'docker run': docker run -e 'ACCEPT_EULA=Y' ` -e 'SA_PASSWORD=$cthulhu1988' ` -p 1433:1433 ` --name dockerdemo ` -d mcr.microsoft.com/mssql/server:2017-latest Let's break this down a…
Read More

Containers: Getting an Image

Containers
I'm working with Docker running on Windows or Linux. There are other ways to do this, but Docker seems to be a pretty strong standard. I'll leave it to you to get Docker installed on your system. Go here to get the appropriate installation. I explain why I'm learning Docker and containers here if you're interested. Docker Pull The first command you have to learn is 'docker pull'. You then have to supply something for it to pull, an image that will be used to create your containers. I'm using Powershell for the commands I'm posting this week. Here's how you get an image with SQL Server 2017: docker pull mcr.microsoft.com/mssql/server:2017-latest Assuming you have Docker installed and running, you should get an image downloaded. Depending on your network bandwidth, this…
Read More

Learning Containers

DevOps
I find that I'm using containers more and more to get things done with SQL Server. They're so easy to set up for testing, spin 'em up, do stuff, turn 'em off, done. So, as I learn more and more about them, I figured it was time to start to share that learning here on the blog. First up, I'm NOT an expert on this topic. The two best people I know currently on this are Anthony Nocentino and Andrew Pruski. Those are the people you really should be learning the details from. I'm going to try to start to cover the introductory level of containers, Docker, and, at some point in the future, Kubernetes (maybe) and other orchestrators. However, I know that as my knowledge of how to work…
Read More