SQL server variable @@SERVERNAME is being reset each time the service is recycled in Veritas Cluster Server (VCS).

book

Article ID: 100006595

calendar_today

Updated On:

Cause

The SQLServer agent was modified to do the sp_dropserver and sp_addserver automatically. This is causing the @@SERVERNAME value to become NULL on every online.

Resolution

Create registry key to work around the issue.

SQL 2008 Registry change:

1. Go to HKEY_LOCAL_MACHINE\SOFTWARE\VERITAS\VCS\EnterpriseAgents

2. Create a key named SQLServer2008

3. Create a key named __Global__

4. Add a DWORD named DisableServerLinking in the __Global__ key and set the value to 1.
 
5. After creating the registry key execute the following.
 
a. sp_helpserver (Note the name returned)
b.   sp_dropserver ‘’;
c.   sp_addserver ‘', 'local';
 
6. Offline and online the SQLServer2008 resource in VCS.  
 

SQL 2005 Registry change:

1. Go to HKEY_LOCAL_MACHINE\SOFTWARE\VERITAS\VCS\EnterpriseAgents.

2. Create a key named SQLServer2005

3. Create a key named __Global__

4. Add a DWORD named DisableServerLinking in the __Global__ key and set the value to 1.
 
5. After creating the registry key execute the following.
 
a. sp_helpserver (Note the name returned)
b.   sp_dropserver ‘’;
c.   sp_addserver ‘', 'local';
 
6. Offline and online the SQLServer2005 resource in VCS.  
 
Please note that after this change the SQLServer agent will not add the 'virtual server name\instance name' to the SQL server list automatically.  The sp_dropserver/sp_addserver commands will need to be executed for all SQL instances configured with VCS in the cluster where the registry change was made.

The following registry change can be made to disable server linking at the instance level instead of using the __Global__ key above.

SQL 2008 instance change:

1. Go to HKEY_LOCAL_MACHINE\SOFTWARE\VERITAS\VCS\EnterpriseAgents

2. Create a key named SQLServer2008

3. Create a key with the same name as the SQL resource name in VCS.

- Example: The key name would be SQLServer2008-SQLSVR.

4. Add a DWORD named DisableServerLinking in the  key and set the value to 1.

5. After creating the registry key execute the following. 

a. sp_helpserver (Note the name returned)
b.   sp_dropserver ‘’;
c.   sp_addserver ‘', 'local';
 
6. Offline and online the SQLServer2008 resource in VCS.  
 

SQL 2005 instance change:

1. Go to HKEY_LOCAL_MACHINE\SOFTWARE\VERITAS\VCS\EnterpriseAgents.

2. Create a key named SQLServer2005

3. Create a key with the same name as the SQL resource name in VCS.

- Example: the key name would be SQL-INST1-SQLServer2005.

4. Add a DWORD named DisableServerLinking in the  key and set the value to 1.

5. After creating the registry key execute the following.

a. sp_helpserver (Note the name returned)
b.   sp_dropserver ‘’;
c.   sp_addserver ‘', 'local';
 
6. Offline and online the SQLServer2005 resource in VCS.  

Applies To

Storage Foundation for Windows High Availability (SFW  HA) or Veritas Cluster Server (VCS)

  • for SQL 2005 version 5.1 SP1 and later
  • for SQL 2008 version 5.1 AP1 and later
  • for SQL 2008 version 6.0 and later

 

SQL  Server 2008 or SQL Server 2008 R2

SQL Server 2005

Windows Server 2008 or Server 2008 R2

Issue/Introduction

SQL server variable @@SERVERNAME is being reset each time the service is recycled in Veritas Cluster Server (VCS).