Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Databasepropertyex db status

Status
Not open for further replies.

mutley1

MIS
Jul 24, 2003
909
Hi all,

I'm looking to automate a check on all servers (30+) for all databases to check that the status of all is 'online'. My first thoughts are to create an sp that:
1.creates a temp table
2.runs through each db using databasepropertyex ('mydb', 'status')
3.inserts results into temp table
4.quick bit of code to use xpsendmail if anything other than status of online
5.drop temp table

Anyone think of a simpler approach - remember, they key is i'm trying to automate the process for 30 servers.....

Thanks for any advice,

M.
 
Create a temp table that looks like the output from sp_helpdb.

Execute sp_helpdb and load the data into the temp table.

If any of the databases are listed with a status <> ONLINE in the status column (you'll need to parce the column) send an email out.

drop the temp table.

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top