Sign inSign up

dbatools/sqlinstance2

By dbatools

Updated almost 2 years ago

Secondary SQL Linux server, ideal for testing AGs and Migrations

Image
3

100K+

dbatools/sqlinstance2 repository overview

Setup

Get images.

First image has a bunch of sample objects, including databases (Northwind, pubs) and some db certs. Second one is mostly empty but has an exposed endpoint and a matching certificate for auth with other image.

docker pull dbatools/sqlinstance
docker pull dbatools/sqlinstance2

# Create network for nodes to talk to each other
docker network create localnet
# Expose engine and endpoint then setup a shared path for migrations
# NOTE: The syntax below is for mac. For Windows, it's an extra step.
docker run -p 1433:1433 -p 5022:5022 --volume /tmp:/sharedpath --network localnet --hostname dockersql1 --name dockersql1 -d dbatools/sqlinstance
# Expose second engine and endpoint on different port
docker run -p 14333:1433 -p 5023:5023 --volume /tmp:/sharedpath  --network localnet --hostname dockersql2 --name dockersql2 -d dbatools/sqlinstance2

# let it finish starting
Start-Sleep 15

Create credential

The sa account is disabled on these images. Use sqladmin, with password: dbatools.IO $cred = Get-Credential sqladmin

Create new Availability Group

$params = @{
    Primary = "localhost"
    PrimarySqlCredential = $cred
    Secondary = "localhost:14333"
    SecondarySqlCredential = $cred
    Name = "test-ag"
    Database = "pubs"
    ClusterType = "None"
    SeedingMode = "Automatic"
    FailoverMode = "Manual"
    Confirm = $false
 }
 
 New-DbaAvailabilityGroup @params

Perform a migration

Exclude things that are not yet supported on Linux

Start-DbaMigration -Source localhost:1433 -Destination localhost:14333 -SourceSqlCredential $cred -DestinationSqlCredential $cred -BackupRestore -SharedPath /sharedpath -Exclude LinkedServers, Credentials, CentralManagementServer, BackupDevices

Tag summary

Content type

Image

Digest

sha256:93cfcc071

Size

501.9 MB

Last updated

almost 2 years ago

docker pull dbatools/sqlinstance2