Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


DB Status


DB Status

Author
Message
dakshinamurthy-655138
dakshinamurthy-655138
SSC-Addicted
SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)

Group: General Forum Members
Points: 446 Visits: 1056
Hi,

If i would like to know, whether a particular DB is online or has gone to a suspect mode, can i use the following query, so that once the status is suspect we can send a mail to the Administrator to look into it.

Please suggest if there is any other way to find the status of the DB, if the DB has entered into a Suspect mode can i send mail.

SELECT Convert(Varchar(20),DATABASEPROPERTYEX('dbsub', 'Status'))
SQLZ
SQLZ
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1108 Visits: 940
dakshinamurthy (3/20/2008)
Hi,

If i would like to know, whether a particular DB is online or has gone to a suspect mode, can i use the following query, so that once the status is suspect we can send a mail to the Administrator to look into it.

Please suggest if there is any other way to find the status of the DB, if the DB has entered into a Suspect mode can i send mail.

SELECT Convert(Varchar(20),DATABASEPROPERTYEX('dbsub', 'Status'))


That would work. Something like:


IF DATABASEPROPERTYEX('dbsub', 'Status') <> 'ONLINE'
EXEC sp_send_dbmail ...



Karl
source control for SQL Server
GilaMonster
GilaMonster
SSC Guru
SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)

Group: General Forum Members
Points: 75527 Visits: 45026
Select name, state_desc from sys.databases

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


dakshinamurthy-655138
dakshinamurthy-655138
SSC-Addicted
SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)

Group: General Forum Members
Points: 446 Visits: 1056
Thanks a lot
dakshinamurthy-655138
dakshinamurthy-655138
SSC-Addicted
SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)

Group: General Forum Members
Points: 446 Visits: 1056
Thanks a lot
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search