Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Log Shipping warm Server To Live 3

Status
Not open for further replies.

Skittle

ISP
Sep 10, 2002
1,528
US
When a warm log shipping secondary server needs to become the primary you need to change the server name to make sure the applications out there can see the warm server.

Assuming the warm server has the same instance name as the primary ), in terms of renaming the server, is there anything else you need to do other than change the windows server name in Control panel?



Dazed and confused
 
You need to re-name the sql Server.
Here is a little script I have that will do that.

Code:
Create proc uspRenameServer 
@pNewName varchar(256)=null--If NULL we will attempt to rename server to the WINS machine name
/*
Purpose: renames SQL server. 
Server: all
*/
AS
Declare @OldName varchar(256)
Declare @NewName varchar(256)
set @OldName=''
select @OldName=isnull(srvname,'') from  master.dbo.sysservers where srvid=0 
If @pNewName is NULL
Begin
	create table #NName (NName varchar (256))
	insert #NName exec master.dbo.xp_getnetname
	select @NewName=Nname from #Nname
	drop table #Nname
End
ELSE If @pNewName is not NULL
Begin
	select @NewName=ltrim(rtrim(@pNewName))
End

If @OldName<>@NewName
BEGIN
	IF @OldName <>''
	BEGIN
		print 'Attempting to drop server '+@OldName
		Exec master.dbo.sp_dropserver  @OldName
	END
	print 'Attempting to add server '+@NewName
	Exec master.dbo.sp_addserver @NewName,'local'
	UPDATE msdb.sysjobs SET name = @NewName	
END
If isnull(@@Servername,'')<>@NewName 
Begin
	Print 'Please shut down and restart SQL Server in order to complete renaming.' 
End
Else If isnull(@@Servername,'')=@NewName 
Begin
	Print 'SQL Server is already named ' +@NewName
End

- Paul [batman]
- If at first you don't succeed, find out if the loser gets anything.
 
I hit the submit button to soon. I have used log shipping in the past and I would recommend changing the connection string in the application rather than re-naming the server.

- Paul [batman]
- If at first you don't succeed, find out if the loser gets anything.
 
Rather than changing the machine name I recommend either:

1. Adding a DNS entry with the name of the dead machine but pointing to the IP of the backup machine.
2. Changing the connection string to point to the backup machine.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
MRDenny and one above are both right. Been living with log shipping for 8 years. Do not rename the server
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top