How to simulate "DB Offline Errors" in SQL server

Joice Joy 20 Reputation points
2025-08-25T10:39:27.6+00:00

The SQLServer:SQL Errors object provides counters to monitor errors in Microsoft SQL Server.

I wanted to get the DB Offline Errors metric value through performance counters. when i set a particular database offline the offline event is showing as User Errors. How can i simulate the DB Offline Errors?.

The below document talks about the offline errors, i need to know in what scenario i can produce some values for the above mentioned error. Thanks in advance

https://learn.microsoft.com/en-us/sql/relational-databases/performance-monitor/sql-server-sql-errors-object?view=sql-server-ver17

SQL Server Database Engine
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Erland Sommarskog 124.9K Reputation points MVP Volunteer Moderator
    2025-08-25T21:05:27.68+00:00

    To quote that page: DB Offline Errors: Tracks severe errors that cause SQL Server to take the current database offline.

    I can't recall that I have ever encountered this situation, or, wait, maybe that was happened on that fateful early Saturday morning many years ago. The customer had a malfunctioninh I/O subsystem that cause corruption galore. At some point it was so bad, that SQL Server decided that it to had to run recovery on the database, and then there was a corruption error during the recovery as well, and this was when SQL Server gave up on that database. Maybe there was a DB Offline error.

    As you may realise, this is not entirely easy to simulate.

    I should add that the SQL Server version the above happened on was SQL 2000.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.