Skip to content

Alert - DB status #1229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
aachaemenes opened this issue Feb 11, 2025 · 2 comments
Open

Alert - DB status #1229

aachaemenes opened this issue Feb 11, 2025 · 2 comments

Comments

@aachaemenes
Copy link

Alert that shows when db status is not online.

@DavidWiseman
Copy link
Collaborator

An alert for unusual database states would be useful - offline, recovery pending, suspect, emergency.

@DavidWiseman
Copy link
Collaborator

DavidWiseman commented May 9, 2025

There might be an alert type of this in future, but as a workaround you can always create a SQL Agent job that fails based on the database state. You can do this against the DBA Dash repository database. Something like this.

IF EXISTS(
	SELECT * 
	FROM dbo.Databases D
	JOIN dbo.Instances I ON D.InstanceID = I.InstanceID
	WHERE state IN(3,4,5,6)
	AND D.IsActive=1
	AND I.IsActive=1
	)
BEGIN
	RAISERROR('Database state alert',11,1)
END

DBA Dash can alert on agent job failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants