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

Script to determine if two instances are on the same node Expand / Collapse
Author
Message
Posted Wednesday, November 13, 2013 2:33 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, April 17, 2014 4:56 AM
Points: 1,002, Visits: 884
Comments posted to this topic are about the item Script to determine if two instances are on the same node

/* ----------------------------- */
Tochter aus Elysium, Wir betreten feuertrunken, Himmlische, dein Heiligtum!

Post #1513747
Posted Wednesday, November 13, 2013 9:41 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 10:15 AM
Points: 6,279, Visits: 13,520
just query this from each instance and compare the values, no need for reams and reams of code

SELECT SERVERPROPERTY('Computernamephysicalnetbios')



-----------------------------------------------------------------------------------------------------------

"Ya can't make an omelette without breaking just a few eggs"
Post #1513957
Posted Wednesday, November 13, 2013 9:56 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, April 17, 2014 4:56 AM
Points: 1,002, Visits: 884
Because you can also check that SSAS and SQL are not on the same node, or two instances of SSAS, etc...

/* ----------------------------- */
Tochter aus Elysium, Wir betreten feuertrunken, Himmlische, dein Heiligtum!

Post #1513970
Posted Wednesday, November 13, 2013 12:25 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 10:15 AM
Points: 6,279, Visits: 13,520
Running multiple instances on sql on the same node is not uncommon or bad, in fact its a good way to get the most from your hardware as long as you don't over subscribe

-----------------------------------------------------------------------------------------------------------

"Ya can't make an omelette without breaking just a few eggs"
Post #1514032
Posted Wednesday, November 13, 2013 12:35 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Yesterday @ 11:21 AM
Points: 436, Visits: 2,274
I don't think you need to run your process every 30 minutes; you could just create an "autoexec" stored procedure in your master db (see sp_procoption), which runs any time the SQL instance is (re)started (this does get fired when a cluster fails over from one node to the other).

Mine contain the code snippet below; it doesn't do exactly the same thing you do-- but may do enough, with the benefit of simplicity.

IF SERVERPROPERTY('IsClustered') = 1 
SELECT nodename,CASE WHEN NodeName = SERVERPROPERTY('ComputerNamePhysicalNetBIOS') THEN 1 ELSE 0 END AS ActiveNode
FROM sys.dm_os_cluster_nodes
ORDER BY NodeName





Cursors are useful if you don't know SQL
Post #1514035
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse