Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

DB Status Expand / Collapse
Author
Message
Posted Thursday, March 20, 2008 6:04 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Sunday, August 24, 2014 11:13 PM
Points: 330, Visits: 965
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'))
Post #472182
Posted Thursday, March 20, 2008 6:24 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, August 21, 2014 4:43 AM
Points: 870, Visits: 897
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
Post #472190
Posted Thursday, March 20, 2008 6:37 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 10:05 AM
Points: 42,829, Visits: 35,961
Select name, state_desc from sys.databases


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
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

Post #472196
Posted Thursday, March 20, 2008 6:48 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Sunday, August 24, 2014 11:13 PM
Points: 330, Visits: 965
Thanks a lot
Post #472200
Posted Thursday, March 20, 2008 6:49 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Sunday, August 24, 2014 11:13 PM
Points: 330, Visits: 965
Thanks a lot
Post #472202
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse