SQLAlwaysOn 2012-Query server name shows NODE name not Cluster name

Hi guys,
I just finished setting up my SQLAlwaysOnLab for our Development team. I'm having an issue understanding the AlwaysOn HA feature.... When I run  the "SELECT @@SERVERNAME AS 'Server
Name'" The result show the local server name and not the ClusterName or the  Availabilty Group Listener name. We need it to show the actual Cluster name or AG Listner game. Our 2008 r2 2005 clustering we have a shared storage cluster
and we setup the config services and application, so when i run a query in that environment it shows "NTS-PROD"(not the clustername). Which is what we want.. Thanks for any input at all! My dev config below:
CLustername=ADM034SQLC050
3 nodes in the cluster bellow: ADM034SQL051, ADM034SQL052, ADM034SQL053

Hello,
Edwin is correct, this is the expected and correct behavior as it's returning the current server that it is executing on.
What you could do is create a function that could be executed to return the value you want inside of the databases involved in the AGs. That would give you what you want, but the built in functions are working correctly.
Edit:
I wanted to expand on what I wrote and qualify it a little more so that it adds some extra information and understanding.
With a clustered instance, the servername will come back with the clustered instance name. This is because when using clustering, the resource for this is setup both at the SQL Server level (by choosing setup as a clustered instance) and at a windows level
(resources in the cluster). In a cluster, each instance has a VCO (virtual computer object) created for it in AD and that is actually what is used, so servername comes back with the VCO as we would expect.
This differs with AGs. AG instances are locally installed instances and they can be connected to without using a listener (in fact a listener isn't even needed for AGs). Listeners exist ONLY at the windows level as a resource, there is no VCO associated
with a listener or any other AG resource. Each instance can be connected to just like you would any other stand alone instance. In this situation SERVERNAME returns the name of the server that it is currently on as there is nothing special about these servers.
The clustering is only done at the windows layer and SQL Server installation are simply stand alone.
Sean Gallardy | Blog |
Twitter

Similar Messages

  • Query server name where a BLS tran is executed ?

    Hi all,
    is there a possibility to query the server name where a BLS transaction is executed from within the transaction?
    Use: The transaction should be able to decide if called on a test server or in production. I am looking for a logic that lets the tran know without someone having to change transaction or local properties when deploying the tran to production.
    Regards
    Michael

    Udayan,
    imagine the following situation: a BLS collects data, creates a file and FTPs the file to a server. The test on the test xMII system was ok. Now you want to deploy the BLS to the xMII production server. However, the FTP target is different in Test and Production. How would you manage it?
    I am looking for a solution where I do not have to change BLS properties before deploying. The tran should know if it runs in test or production environment. So my first idea was: check the server then you can decide if Test or Production.
    Are there other ideas? My main goal is that I want a transaction which can run in both test and production environment without source change, and run differently depending on the environment.
    Regards
    Michael

  • Migrate Active Directory 2008 to 2012 but need to keep the same ip address and server name

    Hi,
    Current setup is 2 DCs in one site running 2008 R2 AD.
    We are planning to migrate from 2008 R2 to 2012 R2 but need to keep the same ip address and server name. I have came up two plans to do this and hope someone can tell me which one would be the best approach. What is the pros
    and cons in Plan A and B or may be plan C if there is a better one?
    First, I was planning to do plan A but just had a second thought of Plan B.  My concern in Plan A is about changing the server name when the new 2012 R2 already running as DC.  Plan B would be changing all the old server
    name and ip before they become member sever and DC. 
    Any information and suggestion would be very appreciated.
    Plan A
    Run adprep /forestprep on 2008 R2 DC
    Build a new 2012 R2 server and promote it as 3rd DCs in current Domain
    Transfer FSMO from 2008 R2 to 2012 R2
    Run Repadmin /syncall to force replication
    Rename the demoted 2008 R2 DC to something else
    Change the demoted 2008 R2 ip address to something else
    Restart the demoted 2008 R2 server to take effect
    Now, run Netdom computername command to change the new 2012 R2 server name to the old 2008 R2 DC server name
    Change the new 2012 R2 DC's ip to old 2008 R2 DC's ip
    Run ipconfig /flushdns
    Run ipconfig /registerdns
    DCDIAG to see any error
    Plan B
    Build 2 new 2012 R2 standalone servers
    In 2008 R2 ServerA transfer FSMO to 2008 R2 ServerB
    Demote 2008 R2 ServerA to become member server
    Rename 2008 R2 ServerA to something else and change the ip address to something else and shut it down
    Now, rename one of the new 2012 R2 standalone server to the old demoted 2008 R2 ServerA name
    Change the new 2012 R2 standalone server ip to the old demoted 2008 R2 ServerA's ip address
    Add the new 2012 R2 standalone server (now with the old 2008 R2 ServerA name and ip) to become member server
    Run adprep /forestprep on the 2008 R2 ServerB
    Promote the new 2012 R2 (now with the old 2008 R2 ServerA name and ip) as DC
    Transfer 2008 R2 ServerB FSMO to the new 2012 R2 DC (now with the old 2008 R2 ServerA name and ip)
    Demote 2008 R2 ServerB as member server
    Rename 2008 R2 ServerB to something else and change the ip address to something else and shut it down
    Now, rename the 2nd new 2012 R2 standalone server to the old demoted 2008 R2 ServerB name
    Change the new 2012 R2 standalone server ip to the old demoted 2008 R2 SeverB 's ip address
    Add the 2nd new 2012 R2 standalone server to become member server
    Promote it as DC
    Run DCDIAG to check error
    Thanks.

    Hi,
    Renaming a Domain Controller is a risky operation which may lead to issues, therefore, I would suggest you go with the Plan B, rename the server before it becomes DC.
    Here is a blog below which could be helpful to you:
    Remove an Old DC and Introduce a New DC with the Same Name and IP Address
    http://blogs.msmvps.com/acefekay/2010/10/09/remove-an-old-dc-and-introduce-a-new-dc-with-the-same-name-and-ip-address/
    Best Regards,
    Amy
    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]

  • Error in Parallel query server

    Please help!
    SELECT SUM(DECODE(r.sexe,�M�,1,0)) H, SUM(DECODE(r.sexe,�F�,1,0))F, FLOOR(MONTHS_BETWEEN(TO_DATE(:p_date),r.date_naissance)/12) age
    FROM resource r
    GROUP BY FLOOR(MONTHS_BETWEEN(TO_DATE(:p_date), r.date_naissance)/12)
    This �select� worked on Oracle 7 but gives the following error messages on Oracle 8i:
    ORA-1281: Error signaled in parallel query server P_004.
    ORA-00979: Not a group by expression.
    Thanks.

    user10699277 wrote:
    I got the following error while import data.You are doing import with datapump or imp ?
    If so, look at the import log where ORA-01452 is mentioned, you should find the name of the table there for which ORA-01452 is raised.
    Hi All,
    ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys foundYou are trying to create unique index on the column where duplicate values exists.
    By the definition of unique index, that would be impossibe.
    So, either remove 'unique' from the create index syntax , or make sure there are no duplicate values in the coulumn on which you are creating unique index.
    Could you resolve it?No, that should be your responsibility.

  • SCOM 2012 reports do not show object or server name

    When running any performance reports (I have tested OS, SQL, and generic reports) the object is not listed in the report and the only why to tell which object the counter is from is to drill open the Instance. However, this does not work on scheduled and
    delivered reports.
    Has anyone noticed this or am I crazy? If so, how did you get around it? I was thinking if I can get the RDL for the report I can create my own with the object name.
    Thanks,
    John

    CU4 for SP1 is out http://support.microsoft.com/kb/2879276
    I haven't seen any reports from anyone who has actually installed it to see whether it introduces any problems or whether the fixes work in a real-world environment.
    the notes include:
    "Issue 5
    By default, when a generic performance report is exported, the object information (such as server name, disk label, and so on) is collapsed, and the information is missing."
    So it looks like the fix is in.

  • Is there a way to change an existing SCCM 2012 site server intranet FQDN name to lowercase?

    Does anyone know if there is a way to change the intranet (not internet) FQDN name of an existing SCCM 2012 site server to all lowercase letters?  You used to be able to do this in SCCM 2007.

    I had a problem with WSUS updates not working via SCCM 2012 R2 during an operating system deployment. When examining the c:\Windows\WindowsUpdate.log I found the following errors:
    WARNING: SendRequest failed with hr = 80072ee2. Proxy List used: <****:8080;****:8080> Bypass List used : <(null)> Auth Schemes used : <>
    + Last proxy send request failed with hr = 0x80072EE2, HTTP status code = 0
    WARNING: GetConfig failure, error = 0x80072EE2, soap client error = 5, soap error code = 0, HTTP status code = 200
    After a LONG time researching this error I found it was related to the fact we were using a WPAD proxy implementation and apparently this doesnt cope well with uppercase characters for the WSUS server URL. I changed our GPO to be using lowercase lettering
    but when examining the WindowsUpdate log again it still showed as being in uppercase. In the end I found that despite what your GPO setting says, this can get over written by the SCCM site server's own published WSUS location. You can check this by entering
    the following command:
    wmic /namespace:"\\root\CCM\SoftwareUpdates\WUAHandler" PATH CCM_UpdateSource
    Unfortunatelty in SCCM 2012 there is no GUI way to amend the intranet FQDN used for the WSUS location so I then turned to directly editing the database (which anyone will tell you is not recommended, but by this point i was DESPERATE!).
    In the end it solved all my troubles so if anyone finds themselves in this situation, you can fix it by going to the SCCM database and within the table 'WSUSServerLocations', change the WSUSServerName to be in lowercase letters.

  • KB fix for print document name in event logs on Server 2012 and Server 2012R2

    It appears as though the requested corrections to the documentation where never honored
    Note After you apply the hotfix or update, you can show the printed document name in the event by enabling a specific Group Policy.
    The policy name:
    Computer Configuration \ Administrative Templates \ Printers
    Allow job name in event logs 
    The Windows 8 / Server 2012 fix is:
    Event ID 307 does not show the printed document name in Windows
    http://support.microsoft.com/kb/2938013/en-us
    2012R2 is in the April Roll up.
    Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2 Update: April 2014
    http://support.microsoft.com/kb/2919355/en-us
    Alan Morris Windows Printing Team

    In my simple test, I see that the Group-Policy does exist on 2012R2 but not for 2012.
    I isolated the registry changes so I can update a 2012 only system... that text is below.
    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows NT\Printers]
    "ShowJobTitleInEventLogs"=dword:00000001
    [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers]
    "ShowJobTitleInEventLogs"=dword:00000001
    I hope this helps others out since it took sometime to narrow this down. Thank you.

  • SQL server query without indicating server name

    I am writing a query  in SSIS and  utilize servername everytime  but it drags every time
    I am authorized to  work in Development area and can indicate deve  server
    But   Senior  officer ask me  not to use Server name  and when  package goes to  production   query  can execute without  indicate  server name any idea 
    thank you very much.
    Vijay
    Vijay Patel

    I think you're using linked server in your queries based on your description.
    While working in SSIS you dont need linked server. You'll just add connection manager to connect to your dev server and database and then use it for your tasks. Inside your query you will just reference objects using schemaname.objectname convention.
    You will make servername and database name configurable by adding them as configurations (parameters in SSIS 2012 if you use project deployment). Then you will be able to pass values for configurations from outside based on variety of options like through
    XML file, from SQLServer table, Environment variables etc
    see
    http://www.mssqltips.com/sqlservertip/1405/sql-server-integration-services-ssis-package-configuration/
    http://nexxtjump.com/2013/01/14/ssis-2012-configuration-guide-part-1-introduction/
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Renamed a 2012 license server but it still looks for its old name

    I renamed a Server 2012 machine that I had installed remote desktop licenses on. The server shows the licenses are available under the new name, but when you log in remotely, it's still looking to the old name as the license server. There isn't any remote
    desktop configuration function on 2012, so where do I tell it to look to the new name for licensing? When I do licensing diagnosis, it still shows that it's looking for the old name.

    Hi,
    If the server is part of collection in a RDS deployment then you would set the licensing server name in Server Manager -- RDS -- Overview -- Tasks -- Edit Deployment Properties -- RD Licensing tab.  If the server is standalone (not part of RDS deployment)
    then you may set the licensing server name in the local group policy (gpedit.msc).  The setting is under this path:
    Computer Configuration\ Administrative Templates\ Windows Components\ Remote Desktop Services\ Remote Desktop Session Host\ Licensing
    -TP

  • Is there a way to have your PS script Query the name of your local Mail Server?

    Hey Guys, 
      Really hoping someone can help me out here. I am currently working on a script that Automates the entire user creation process (AD account, Exchange Mailbox, UCM Soft phone). I want this script to be universal for all systems I have to work with.
    By this I mean that I can run the script on various systems (Different Domains) without ever having to modify the code. 
      I have run into a bit of a problem while trying to automate the PSSession component of my script. I would like to be able to run he script and it inserts the relevant Mail server name based on some sort of Lookup or query. I am currently circumventing
    the issue by having a text box pop up asking for the mail server name. It works, but its not really what I want for the end product. Its frustrating seeing as I have overcome similar issues for things like UPNs, AD Server, etc....
       I have though about having it pull from the DNS MX records, but there are a number of different records for different Mail servers.
      Any help would be awesome!

    Notice that this has drifted a whole long way from the original question.  I pointed out that it is easy with Exchange but if the servers are in different companies or are not part of an enterprise deployment then you need to look at the local AD and
    seek to the top. Any one mailbox wwil get you an exchange server to remote into and use the exchange shell to discover the network.
    ¯\_(ツ)_/¯
    Looking back over the thread, that may be my fault.  I mistook the comment about checking MX to mean he's just looking for a mail relay. 
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • Server name not showing up in Chooser

    mac OS 10.1.3 server. The server name is not showing up in the Chooser,. I can get to it by typing in the IP address, but this is a pain for my teachers.
    It showed up for a long time, but now it will not show up.
    Any ideas?

    Apple talk is on the server and the clients. I also have another server that is connected to the same switch and it can be seen in the chooser. So I do not think it is a config problem with the switches or hubs. I have not changed anything (that I know of). I have researched this and can not find anything on it.

  • Error showing in listener while giving tnsping application server name

    iam trying to connect application server with database server.......while giving tnsping from database server as tnsping application_server_name
    its showing error as
    $ tnsping 10.92.5.8
    TNS Ping Utility for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production on 09-FEB-2007 06:18:05
    Copyright (c) 1997, 2005, Oracle. All rights reserved.
    Used parameter files:
    Used HOSTNAME adapter to resolve the alias
    Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=10.92.5.8))(ADDRESS=(PROTOCOL=TCP)(HOST=10.92.5.8)(PORT=1521)))
    TNS-12541: TNS:no listener
    but i have set the listener in databse server.
    thsi is my listener.ora
    LISTENER =
    (ADDRESS_LIST=
    (ADDRESS=(PROTOCOL=tcp)(HOST=application server name)(PORT=1521))
    (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
    SID_LIST_LISTENER=
    (SID_LIST=
    (SID_DESC=
    (GLOBAL_DBNAME=RBTT)
    (SID_NAME=RBTT)
    (ORACLE_HOME=home path of database server)
    if iam connecting sqlplus there in application server and giving username and password
    its showing error as .......
    Enter user-name: xmluser
    Enter password:
    ERROR:
    Enter user-name: xmluser
    Enter password:
    ERROR:
    ORA-12545: Connect failed because target host or object does not exist
    thanks in advance
    R.Ratheesh

    hi,
    I have changed the listener hostname....before changing the host name also tnsoping database server name works fine....
    i am posting the tnsnames.ora of databse server
    RBTT =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS=(PROTOCOL=TCP) (HOST=application server_name) (PORT = 1521))
    (CONNECT_DATA =
    (SERVER=DEDICATED)
    (SERVICE_NAME = RBTT)
    tnsnames.ora for application server
    RBTT =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS=(PROTOCOL=TCP) (HOST=database server name) (PORT = 1521))
    (CONNECT_DATA =
    (SERVER=DEDICATED)
    (SERVICE_NAME = RBTT)
    is this is the right one..
    and regarding this connectivity between two servers tnsnames.ora and listener.ora plays a vital role....should i have to make any changes in sqlnet.ora in both application server and database server...should i have to copy sqlnet.ora,listener.ora in application server...and what has to be set in both???
    I have changed sqlnet.ora in database server in names.directory_path=tnsnames.ora
    thanks in advance,
    R.Ratheesh

  • When connecting to website using sso, packet sniffing shows ntlm user is using {server name}\{user name} instead of {domain name}\{user name}

    I moved to windows 7 and firefox 12 and my internal website via the servername (not FQN) is now prompting me for the username and password in firefox. I do not get prompted for a username and password when using IE9 to access the site via servername (not FQN).
    packet sniffing shows IE9 is using my windows domain as the windows domain. packet sniffing shows Firefox is using the web servers servername as the domain.
    If I use the fully qualified server name then firefox authenticates successfully. this is not a problem on my winxp workstation with firefox 12.

    The only time it fails is in windows 7 and the address used of HTTP://servername. I updated the above post to show it works in XP with ff12.
    There is no proxy server involved.
    I am logged into the domain.
    If I use the fully qualified servername as the address it works. Http://servername.domain.local

  • RemoteApp Server Name Setting in Server 2012

    Hi all,
    we are using RD Web Access with IE 10 to provide our windows application to the users. The server is running windows server 2008 R2.
    Now we are installing a new Server 2012.
    In Server 2008 R2 it is possible to define the server name for the remoteapp clients in the remoteapp-manager (e.g. "test.de").
    Where is this defined in Server 2012?
    Thanks a lot in advance
    Ulrich Schumacher

    Hi,
    You may download the cmdlet below to your RD Connection Broker server and use it to change the name:
    Change published FQDN for Server 2012 or 2012 R2 RDS Deployment
    http://gallery.technet.microsoft.com/Change-published-FQDN-for-2a029b80
    -TP

  • Renaming TFS Server name upon migration from TFS 2010 to TFS 2012

    We are migrating from TFS 2010 on existing server to TFS 2012 on new server. All components (TFS 2012, SQL 2012, SPS 2010) are directly on the new server similar to existing server (TFS 2010, SQL 2008 R2, WSS 3.0).
    The new server has a new name, however the service provider that does the actual migration,
    wants to rename
    the new server to be same name as the name of the original existing server when it is shutdown. The rename is intended to be done using
    netdom utility.
    I noticed there are articles by microsoft and others that describe various issues that may arrise as
    result of TFS server rename. However service provider still plans to rename based on his field experience and best practices.
    What do u recommend to do in this aspect ? Why would it be necessary to rename and not use the new name (DNS can map old name as well to the new IP) ? What are the actual risks in such rename and is it worth it ?
    Thank u

    Hi Cathy,
    Thank u for your reply.
    We know that renaming the new server to the same name as the original one, is
    not a must for the migration to work. The issue in question is as follows :
    1. A Microsoft partner that has hands on experience in TFS migration, and planned to migrate for us, recommends to rename the new server name, to the original server name, utilizing net_dom command, and to do it during / after  same procedure u
    provided link to.
    2. We found Microsoft documentation that cautions about renaming the server, e.g. renaming SQL server which is in our case on same machine where TFS 2012 is to be installed. However, the partner urges us to rename, explaining that net_dom should perform
    the rename safely without caution risk.
    Kindly let u sknow if Micorsoft considers such rename with net_dom to be a good
    practice in low risk for such migration,
    or better keep the new server name as it is and just map the old server name in DNS to the IP of the new server.
    Thank u.

Maybe you are looking for