Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Checking availability

Author  Topic 

zzaaqq1112003
Starting Member

4 Posts

Posted - 2003-02-05 : 17:57:08
Hi,
What is the best way of checking that you can insert data to a database every x minutes, send an up/down notification to a remote agent.
Thanks,


Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-02-05 : 18:03:46
Scheduled tasks

Damian
Go to Top of Page

zzaaqq1112003
Starting Member

4 Posts

Posted - 2003-02-05 : 18:52:44
Thanks.

Would I be checking the availability at the instance level or database level ? I am thinking the db level makes more sense because each database in an instance can be taken offline/detached etc without effecting others.

Has anyone got a tool for the availability checking or recommend some tools ?

Thanks.


Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2003-02-05 : 18:53:13
Ummm DMO maybe?
Just a gues...

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page

jasper_smith
SQL Server MVP &amp; SQLTeam MVY

846 Posts

Posted - 2003-02-06 : 15:39:50
Here's an example using VBScript.

Const cSQLServer = "(local)" 'supply your servername
Const SQLDMOSvc_Running = 1
Const cDb = "pubs" 'supply your database name
'or you can loop through the
'Databases collection

Dim oSQL
Dim Msg
Dim status

On Error Resume Next

Set oSQL = WScript.CreateObject("SQLDMO.SQLServer")
oSQL.Name = cSQLServer
oSQL.LoginSecure = True
oSQL.LoginTimeout = 10

If (oSQL.Status <> SQLDMOSvc_Running or Err.Number<>0) Then
Msg = "SQL Service for Server " & cSQLServer & " is not running"
'Send an email or whatever
Set oSQL = Nothing
WScript.Quit(1)

Else
oSQL.Connect

If Err.Number<>0 Then
Msg = "Could not connect to Server " & cSQLServer
'Send an email or whatever
Set oSQL = Nothing
WScript.Quit(1)
End If

End If

status = oSQL.Databases(cDb).Status

If (status<>0) or (Err.Number<>0) Then

Msg = "Database " & cDb & " for Server " &_
cSQLServer & " has a non-normal status"
'Send an email or whatever
oSQL.DisConnect
Set oSQL = Nothing
WScript.Quit(1)

Else

oSQL.DisConnect
Set oSQL = Nothing
WScript.Quit(0)

End If



HTH
Jasper Smith
Go to Top of Page
   

- Advertisement -