07/20/2026
by Marlon Ribunal
0 comments

Restore SQL Server Database to an OrbStack Container

In the previous post, we’ve built a SQL Server 2025 sandbox in an OrbStack container in a Macbook. If you are like me who switched from a Windows laptop to MacBook, you are probably missing your SQL Server. Sometimes it’s just nice to have a sandbox that is separate from your all other instances for testing and learning. This is exactly what we’re trying to do here.

Download the Backup

For this exercise we want to download the full backup of Wide World Importers. Go ahead and download it from the github repo which you can find it here. And of course, take note of where you saved the .bak file.

Copy the Backup File into the Container

First, let’s create our backup directory in our cotainer. From your favorite terminal, run the following:

ShellScript
docker exec -it sql2025 mkdir -p /var/opt/mssql/backup

Then copy over the file to the directory we just created above

ShellScript
docker cp /Users/marlonribunal/Downloads/WideWorldImporters-Full.bak sql2025:/var/opt/mssql/backup/

You terminal should now say that the backup file was successfully copied.

Use VS Code to Restore the Database

Since Microsoft will never ever port SSMS to the macOS, I think VS Code with the mssql extension is a pretty much decent tool for doing work in a SQL Server.

Check the in-memory data, database, and log files contained in the backup, so we know what logical files to map to their physical paths in the container:

SQL
RESTORE FILELISTONLY
FROM DISK = N'/var/opt/mssql/backup/WideWorldImporters-Full.bak';
GO

You should see all the contained in the backup file of the WideWorldImporters database. Take note of those for the next step.

Then restore the database. Please take note that if you don’t map the path of the files to where you want to store them, the restore proccess will assume that you are restoring the files into the same directory the backup files were stored in the source. Chances are you will then get an error because those original directory don’t exist in the target container.

SQL
RESTORE DATABASE [WideWorldImporters]
FROM DISK = '/var/opt/mssql/backup/WideWorldImporters-Full.bak'
WITH 
MOVE 'WWI_Primary' TO '/var/opt/mssql/data/WideWorldImporters.mdf',
MOVE 'WWI_UserData' TO '/var/opt/mssql/data/WideWorldImporters_UserData.ndf',
MOVE 'WWI_Log' TO '/var/opt/mssql/data/WideWorldImporters_Log.ldf',
MOVE 'WWI_InMemory_Data_1' TO '/var/opt/mssql/data/WideWorldImporters_InMemory_Data_1',
REPLACE;
GO

That took about 8 seconds to complete in my container:

That’s it! Enjoy querying!

07/16/2026
by Marlon Ribunal
0 comments

Do This Before You Contact Your SQL Server Consultant

Say you need outside help. You’ve exhausted all the things that you could do and, still, nothing works. So, you decide that calling in for help is the next sensible thing to do. Let’s say this is the first time you’re asking for somebody’s help. You decide which consultant to work with. The hardest part, if you’re doing this for the first time, is how to start that conversation.

The first conversation is the most critical one. Obviously, you cannot just turn over your SQL Server instance and wait for the bill. Some prep changes what you get out of that first conversation. It means spending less time covering the basics and more time focusing on the problem that made you pick up the phone in the first place.

Here’s what’s worth having ready before you make the call.

(And, not incidentally, if you are a new SQL Server DBA hire, you can use the following to get a baseline understanding of the environment you’re now facing.)

Determine what’s wrong with your server

Here’s the thing. Your consultant is a highly technical person, but you don’t always have to speak in technical terms. Explain the pain points from the users’ perspective. Is the UI slow? Are users experiencing timeout issues? Is a button not responding in a timely manner? Look at the problem through the users’ eyes and understand their pain.

An important thing to take note of is what feels slow or broken. Is it specific like a report? A batch job that has been failing to meet the SLA? Is it the whole application? Ingestion pipeline failing to finish at all?

Another important thing to take note of is the timeline. When did this start happening? Is it after a vendor update? Is it after releasing a new ingestion tool? After a SQL patch? After a migration? After a new hire?

Also, I’d add who is feeling the pain and who is affected the most. Maybe it’s one or two people in the Accounting department. Maybe it’s the CFO trying to run a quarterly report. Or perhaps it’s your customers or partners who rely on access to your data outside your company.

That gives the consultant some context to work with.

You know your business better than any consultant walking through the door. That context is where a good diagnosis starts.

Understand your data landscape

You don’t have to know every nook and cranny of your SQL Server environment, whether it’s running on-prem or in the cloud. But you should have a baseline understanding of how things are put together.

Things like SQL Server versions and editions, if you know them, can provide useful information about your environment. Have an approximate idea of how many servers are affected, or maybe the percentage compared to the total number of servers. Is the issue only happening on your on-prem servers, or are your cloud instances affected as well?

Those are a few important things for the consultant to know as a starting point.

One thing worth checking first

If you check nothing else, check this: do your backups actually work? Or do you even have the right backup strategy in place?

If you don’t have RPO and RTO defined (or worse, don’t know what those mean), put that at the top of your discussion list with your consultant. This is one of the most important things you need to get right.

Not “is the backup job running?” That’s not the question. The real question is whether you have ever restored a backup and confirmed that it actually works.

A backup that has never been tested is just a hope, not a safety net.

Okay, somebody said that before. I’m just borrowing it here because it perfectly describes why testing your backups matters. 😉

If you’re not sure, that’s okay. That’s exactly the kind of thing you want to identify early. And honestly, it’s one of the first things I would want to understand as well.

Sort out access and ownership

Well, how can the consultant help if they don’t have the access level needed to do the work or accomplish what you brought them in to do?

Nothing slows down a first week like waiting on permissions. Before you bring anyone in, it helps to know who owns the SQL Server environment today (sa is the wrong answer). Who can grant the access they need? Does it require a chain of approvals from higher-ups? Or is it an open-for-all kind of thing? The consultant needs to know if it’s the latter.

If you’re on a tight schedule or everything is already on fire, you don’t want to delay troubleshooting and resolution just because of access issues.

If you’re technical, go deeper maybe

If you or someone on your team is hands-on, here’s the bigger picture a DBA would typically look at. None of this is required. It is just useful information to have if you can pull it together.

Hopefully, Query Store is enabled. And if you’re lucky, it has enough history captured that you can correlate the data with the actual issues you’re seeing.

Disk latency, specifically read/write latency, is another useful piece of information if you have it. Ideally, if you have results from CrystalDiskInfo or a similar disk benchmark, that can give the consultant an idea of what they’re dealing with when it comes to storage performance. Maybe storage is part of the problem.

Is TempDB configured according to known best practices? Is Instant File Initialization enabled? What about Lock Pages in Memory? How are MAXDOP and Cost Threshold for Parallelism configured?

What does the disk subsystem look like? Where are your data and log files stored? Are your system databases sitting on the OS drive? How much memory is allocated to SQL Server?

These are the kinds of details that can help a SQL Server consultant understand the environment before they start troubleshooting.

You may also want to run tools like Brent Ozar’s sp_Blitz or Glenn Berry’s SQL Server Diagnostic Queries. If those don’t mean anything to you, that’s okay. These are just examples of tools that can provide useful information to a SQL Server consultant.

Just be prepared

The best thing to remember is this: be prepared.

The better prepared you are, the less time is spent having someone learn your environment, and the sooner you can get to the actual problem.

Whether you work with an outside consultant or someone from your own team, walking in with your symptoms, your environment details, and the information you already have gives everyone a much better place to start.

07/13/2026
by Marlon Ribunal
0 comments

Deploy a SQL Server 2025 Container on macOS Using OrbStack

My old Dell XPS that I used for personal stuff started to degrade; well, it’s old, and it has already served past its useful life. So, a few months ago I bought a 14-inch Macbook Pro M5 Pro with 24GB of memory and the standard for M5 Pro 15-core CPU. It’s not my ideal config and I would have opted for the M5 Max. This machine is quite decent for what I need and I am not complaining.

Switching from Windows to Mac has been a challenge, to say the least. This is my first time using macOS as my primary operating system. Suffice it to say, it hasn’t been easy. There’s that.

And, SSMS is not supported in this platform, and Microsoft said that SSMS in Mac is “out of scope” and it will never ever be supported. Period. So, if I were to use this Macbook as my primary learning sandbox, I have no choice but to make it work. My macOS version as of this writing is Tahoe 26.5.1.

For my Mac SQL Server sandbox, I used OrbStack instead of Docker Desktop. I used Docker in my old sandbox on my Dell XPS. Why OrbStack? Simply because it’s the more efficient option on a Mac. First, it’s a native macOS app. The biggest factor is how these two allocate memory. OrbStack’s memory management is dynamic, meaning it doesn’t hold onto memory that it isn’t using. Although Docker has introduced improvements to memory management, such as Resource Saver and other optimizations, OrbStack is still better in that regard. Compared to Docker, OrbStack has low power usage, low memory usage, and a bunch of other advantages.

The usual Docker commands work as-is in OrbStack, so there’s no need to learn new commands or build new scripts if you already have them. Of course, caveats would include Docker Extensions and other features native to Docker.

Install OrbStack

The easiest way to install OrbStack on a Mac is via the package manager Home Brew. My preferred terminal is iTerm2.

Zsh
brew install --cask orbstack

And that’s pretty much it. Next is the container. Run OrbStack if it isn’t already running.

IMPORTANT: Enable Rosetta / Update Rosetta 2

Zsh
orb config set rosetta true

My SQL Server 2025 container keeps getting stuck at the initialization process. Enabling Rosetta fixed the issue.

Pull and Run the Container

As I said, you don’t have to use any new commands to pull the image and run the SQL Server 2025 container. Commands such as docker pull/run and docker compose should run fine out of the box in OrbStack.

Zsh
docker pull mcr.microsoft.com/mssql/server:2025-latest

Then simply run the container. Just a note, if you are using the default command interpreter Z Shell (szh) in iTerm2, get rid of the double quotes and run the following instead:

Zsh
docker run -e ACCEPT_EULA=Y -e MSSQL_SA_PASSWORD='password_here' -p 1433:1433 --name sql2025 --hostname sql2025 -d mcr.microsoft.com/mssql/server:2025-latest

You might get a warning that says “The requested image’s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested <container_id>.

This simply is saying you’re on the ARM64 architecture of the Apple Silicon and the Linux SQL Server container provided by Microsoft is on the AMD64 architecture (no native ARM64 image).

The container should be fine even with that warning. But if you’re bothered by it, just rebuild the container with explicit Linux/amd64. Just stop and delete the existing container and add the --platform flag in the Docker command.

Zsh
docker stop sql2025
Zsh
docker rm sql2025
Zsh
docker run --platform linux/amd64 -e ACCEPT_EULA=Y -e MSSQL_SA_PASSWORD='password_here' -p 1433:1433 --name sql2025 --hostname sql2025 -d mcr.microsoft.com/mssql/server:2025-latest



The warning should now be gone.

VS Code with mssql Extenstion

Install VC Code on your Mac via Home Brew if you haven’t done so.

Zsh
brew install --cask visual-studio-code




Then, Open your VS Code and install the SQL Server (mssql) extension. The extension version as of this writing is v1.43.0.

Create new connection:

Then, that’s it!

Press + + P, and select MS SQL: Open New Query and Connect.

In the editor, check the master_files just to see if the database is queryable 🙂

SQL
select * from sys.master_files ;

Troubleshooting Stuck SQL Server 2025 Container

Just a quick check to see if you can connect to the SQL Server from your Mac

Zsh
nc -vz localhost 1433

If port exposure looked fine, but still failing connection from VS Code, then something else might be causing the error. I was getting the following error from VS Code.

A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 35 – An internal exception was caught)

I checked my container stats, and one thing I noticed immediately is that the CPU is hitting the max of 100% usage.

Zsh
docker stats sql2025


Upon futher digging, I found that emulation path getting stuck during SQL Server initialization. Check if enabling Rosetta on fixes the issue.

We’ll restore a SQL Server 2025 database in the next post.