Press "Enter" to skip to content

Category: Administration

Dealing with a Full Transaction Log

Rebecca Lewis performs some troubleshooting:

It’s 2am. Your phone wakes you. Rub your eyes, check your email, and there it is:

Error: 9002, Severity: 17, State: 4
The transaction log for database 'trading' is full due to 'LOG_BACKUP'.

The database is still online. Looks ok. You can read from it. But every INSERT, UPDATE, and DELETE fails. Production night-trading is effectively down.

The good news: It’s fixable — but, that fix depends entirely on what’s preventing log truncation.

Click through for a choose-your-own-adventure story.

Leave a Comment

Thoughts on the Death of the DBA

Rebecca Lewis presses X to doubt:

Every few years, something comes along that’s definitively, no-questions-asked going to replace us.

Let’s review the historical record.

Rebecca points out a half-dozen instances in which people have decried the end of the DBA role, and yet it’s still there somehow… And honestly, you could probably find a half-dozen more examples without searching too hard, like how SQL Server 2000 was going to render DBAs obsolete because of its self-management capabilities. Which, admittedly, is very similar to the 1996 Oracle announcement.

Leave a Comment

IOPS Slider in Azure SQL Managed Instance Next-Gen

John Morehouse cranks that slider to the right:

If you’ve used Azure SQL Managed Instance General Purpose, you know the drill: to boost memory or I/O, you had to scale the whole instance, paying for extra CPU you might not need—and hoping the upgrade fixed the bottleneck.

It worked but wasn’t elegant and could be slow or awkward. Scaling sometimes took hours when time was of the essence.

The Next-Gen Azure SQL Managed Instance marks a major shift from the old model. It was way overdue.

The downside is that there’s still a per-CPU hard cap on IOPS and it’s low. Granted, it’s only about two orders of magnitude lower than what I’d expect from a decent on-premises solution, but that’s still enough to limit severely my ability to recommend SQL Managed Instance to anybody.

Leave a Comment

Tracking Database File Sizes via Powershell

Kyle Burwell wants to know how big the databases are:

Database files (mdf, nds, ldfs, etc.) can get out of hand quickly and easily, leading to issues down the road. This can be due to improper planning, large data loads, and bad code run in production, just to list a few. As unglamorous as disk space monitoring is, we need to do our part as DBAs. This post is a quick guide on how to track database file sizes with PowerShell.

Read on for a few scripts to perform the task.

Leave a Comment

Sending Messages from SQL Server 2025 to Slack

Aaron Bertrand fires off a message:

In an earlier tip, A history of accessing REST APIs and web pages from SQL Server, I talked about reaching out to external endpoints from SQL Server, including the new sys.sp_invoke_external_rest_endpoint procedure that hit the on-premises editions in SQL Server 2025. This seemed like an ideal use case to enhance our current solution for sending a message to Slack: using xp_cmdshell to call a PowerShell script that calls Invoke-RestMethod. In this tip, I’ll describe how we changed our implementation and why it is a marked improvement for us.

When I did this same thing, I ended up using CLR, as the customer I did it for used SQL Server on Azure VMs and not Azure SQL Database.

Comments closed

Postgres Index Corruption after an OS Upgrade

Laurenz Albe has me concerned:

Most major Linux distributions have upgraded to the GNU C library version 2.28 or later. Therefore, there is a growing awareness that an operating system upgrade can lead to index corruption. However, rebuilding all your indexes can slow down the upgrade process considerably. In this article, I want to discuss how you can avoid rebuilding more indexes than necessary.

Read the whole thing if you are a Postgres DBA.

Comments closed

What VACUUM Really Does in Postgres

Radim Marek explains:

There is common misconception that troubles most developers using PostgreSQL: tune VACUUM or run VACUUM, and your database will stay healthy. Dead tuples will get cleaned up. Transaction IDs recycled. Space reclaimed. Your database will live happily ever after.

But there are couple of dirty “secrets” people are not aware of. First of them being VACUUM is lying to you about your indexes.

Click through to learn more.

Comments closed

Extension Management in Postgres

Kellyn Gorman doesn’t just install a bunch of stuff:

PostgreSQL’s true power doesn’t just come from its rock-solid relational engine, but it’s the fact that Postgres can grow with you. Extensions allow you to bolt on new capabilities, enhance performance, integrate external tools, and transform the database into something far more powerful than its default installation, which is something I’m really learning to love.

From pg_stat_statements to pgvector, logical decoding plugins, job schedulers, and custom procedural languages, Postgres extensions behave like feature packs you can enable at the database level. That also means DBAs must know how to inspect, maintain, and manage them just as carefully as any schema or server configuration.

Read on for several tips for proper extension care and feeding.

Comments closed

Troubleshooting a Distributed Availability Group Failure

Jordan Boich digs in:

To give some background on this topology, they have a DAG comprised of two individual AGs. Their Global Primary AG (we’ll call this AG1) has three replicas, while their Forwarder AG (we’ll call this AG2) has two replicas. The replicas in AG1 are all in the same subnet and all Azure VMs. The replicas in AG2 are all in their own same subnet and all Azure VMs.

By the time we got logged in and connected, the Global Primary Replica was online and was able to receive connections. The secondary replicas in the Global Primary AG however, were unable to communicate with the Global Primary Replica. This is problem 1. The other secondary problem is that several databases on the Forwarder Primary Replica were in crash recovery. This is problem 2. Considering problem 2 was happening in the DR environment, that was put aside for the time being.

Read on for the troubleshooting process and solution.

Comments closed