Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004
    Location
    I currently live under the bridges in Seattle
    Posts
    2

    Exclamation Unanswered: how do u fix @@servername = NULL without restart SQL server ?

    @@servername sometimes returns NULL depending on how you have been messing around with replication and various other settings.

    The simple solution offered to fix this is to delete the entries in the system tables and sp_addserver 'servername','local' and then restart the SQL service.

    This is fine but what do you do in the situation where the SQL server is a 24/7 production box ? Does anyone know of a method / hack to fix this without stopping the service ?

    Thanks

    s

  2. #2
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    As a final task you must restart the service to take new settings, as stated in this KBA [http://support.microsoft.com/default...;EN-US;303774].

    HTH
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    The simple answer is to use KB #303774, but that does require stopping SQL Server to take effect.

    It is much more complicated if you can't stop and restart SQL server. The first part of this procedure is to follow the procedure from the article above, but don't actually restart SQL. Then things start to get complicated.

    You'll have to improvise, but the general plan goes something like:

    1) Get the SQL design team to help you determine where in RAM the buffer is that holds the value for @@servername on your machine.
    2) Call in the team that designed the server hardware to determine where that buffer physically is on the chips in your machine.
    3) Disassemble your server while it is running, being very careful not to unplug anything in the process.
    4) Bring up a scanning electron microscope, and prepare it for use.
    5) Issue an IO_Freeze call (the documentation is in the IO device driver developers guide, but I don't know of a copy of that online).
    6) Fire the electron microscope to change the contents of the buffer in RAM. This will require repeated firings for each bit you need to reset.
    7) As soon as possible, issue an IO_Thaw call so that the server can resume writing to disk.
    8) Reassemble the server hardware.
    9) Pack everything up, and send everyone home.

    I've never actually done this, but serveral of us discussed the concept one night at Tech-Ed. I'd estimate the cost somewhere around 750-800 million dollars, although that could be reduced significantly if you can get some of the technical expertise donated. I'd still strongly suggest that you consider restarting SQL Server instead of going to this amount of trouble.

    -PatP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •