Log shipping error: server not found

  • hi

    i am trying to get log shiping setup on one of our servers, but when i try to complete the job, it says server name GRNSQL004 does not exist
    which in fairness, it does not exist, the primary server i am working on is called grnsql001

    but when i select @@servername i get GRNSQL004..

    how do i go about fixing this? i can read online about dropserver, but the very name makes me fearful of trying as this is my main business critical sql server

    any advice?

    mal

  • dopydb - Monday, April 3, 2017 7:07 AM

    hi

    i am trying to get log shiping setup on one of our servers, but when i try to complete the job, it says server name GRNSQL004 does not exist
    which in fairness, it does not exist, the primary server i am working on is called grnsql001

    but when i select @@servername i get GRNSQL004..

    how do i go about fixing this? i can read online about dropserver, but the very name makes me fearful of trying as this is my main business critical sql server

    any advice?

    mal

    Did you rename the server in the past?  That is usually how this happens. When @@servername is incorrect the meta data for the server name is incorrect. It's explained in several places and is actually not that unusual. Did you read about it in this article?:
    SERVERPROPERTY (Transact-SQL)

    The way to fix it is what you have read about:
    sp_dropserver 'GRNSQL004';
    GO
    sp_addserver 'grnsql001', local;
    GO

    You need to restart the server for the changes to take effect so you would want to do this during a maintenance window.

    Sue

  • I just found this and it's probably a better article to read about this issue - has more details on different scenarios, issues:
    Rename a Computer that Hosts a Stand-Alone Instance of SQL Server

    Sue

  • hi Sue

    thanks for this, cant remeber the server ever being 004, must have been done by the hardware guys and then changes later, i guess if i find i have any issues i can always rename back to grnsql004? although id be 99.5% sure nothing references 004

    mal

  • dopydb - Monday, April 3, 2017 7:34 AM

    hi Sue

    thanks for this, cant remeber the server ever being 004, must have been done by the hardware guys and then changes later, i guess if i find i have any issues i can always rename back to grnsql004? although id be 99.5% sure nothing references 004

    mal

    Yes...and that would be one of the advantages of doing it during a maintenance window. You'd have time to mess around with it. I've had to do it more times that I care to think about and you feel more comfortable with it after you've done it a couple of times. Here is another couple of things you can run and check the mismatches:

    SELECT @@SERVERNAME
    SELECT SERVERPROPERTY('MachineName')
    SELECT SERVERPROPERTY('ServerName')


    Books Online /SQL Server help files also have more information in the topic on @@SERVERNAME

    Sue

  • all worked fine ! thanks for help Sue

Viewing 6 posts - 1 through 6 (of 6 total)

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