Verify resources are running on nodeA of SQL Cluster

  • How to check whether  all resources are running on Node A of SQL Cluster?

  • try this...the first line tells which node is active

    Declare

    @CMD varchar(4000),@Server_Name varchar(100)

    Set

    @Server_Name = 'servername'

    set

    @Cmd = @Server_Name + '.Master..xp_cmdshell ''net statistics server'''

    exec

    (@Cmd)

  • When we create clusters in our company they usually end with 'A' or 'B', depending on the Node..

    So you can do something like that and include that in the job, running every few hours:

    DECLARE @Server varchar(20)

    EXEC master.dbo.xp_regread

    'HKEY_LOCAL_MACHINE', 

    'SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName',  

    'ComputerName',

    @Server OUTPUT

    If @Server ='ServerA'

       Exec ..sendmail..'My Server is running on A Node'

    If @Server ='ServerB'

        Print @Server--do nothing: you might want to change that, depending which node is primary...

  • Is that not possible to view the same in the Cluster administrator --> under Active resources/groups??


    Get busy living ....or get busy dying....

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply