Why does my SQL Server cluster execute "SELECT @@SERVERNAME" every minute?
When I run a Profiler trace on our SQL Server cluster, I开发者_StackOverflow've noticed that it executes "SELECT @@SERVERNAME" every minute. I always figured the Failover Cluster service did something with it, or just used it to confirm that the network name and IP combinations were set up correctly. This doesn't happen every minute on my non-clustered instances, only on those that are part of a failover cluster.
What makes this even more curious is that I overrode the name of a cluster instance using sp_dropserver/sp_addserver, and there were no ill effects at all - even though the clustered instance name doesn't match the expected network/instance combination, both the cluster manager and SQL Server seem totally fine with this.
This just doubly-begs the question - why constantly query it if you're not going to do anything with/about it? Can anybody shed some light on the plumbing here?
This is a heartbeat / uptime check, making sure the node is healthy. This is one of the factors it uses to determine when it's time to failover (because if it can't get a result, there's something wrong with the SQL Server service on that node).
精彩评论