Saturday, February 25, 2012

Cloning a SQL 2005 Database

hi,
I have cloned a VM of a SQL Server 2005 database to a new server with a
different name.
I have run the sp_dropserver and sp_addserver commands as well documented to
change the server name within the sql instance to the new cloned server name.
The issue i have is that the logins on the new cloned server still contains
the local group and local account details from the old machine.
I have renamed the groups and accounts within NT, but when i try to change
rename the logins within sql , i get the error.
TITLE: Microsoft SQL Server Management Studio
--
Unable to rename LBOPS2\SQLServer2005MSSQLUser$LBOPS2$MSSQLSERVER.
(ObjectExplorer)
--
ADDITIONAL INFORMATION:
Rename failed for Login 'LAOPS2\SQLServer2005MSSQLUser$LAOPS2$MSSQLSERVER'.
(Microsoft.SqlServer.Smo)
For help, click:
http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Rename+Login&LinkId=20476
--
An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)
--
The name change cannot be performed because the SID of the new name does not
match the old SID of the principal. (Microsoft SQL Server, Error: 15098)
For help, click:
http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.2050&EvtSrc=MSSQLServer&EvtID=15098&LinkId=20476
--
BUTTONS:
OK
--
Many Thanks
JonHi Jon
"Jon Bird" wrote:
> hi,
> I have cloned a VM of a SQL Server 2005 database to a new server with a
> different name.
> I have run the sp_dropserver and sp_addserver commands as well documented to
> change the server name within the sql instance to the new cloned server name.
> The issue i have is that the logins on the new cloned server still contains
> the local group and local account details from the old machine.
> I have renamed the groups and accounts within NT, but when i try to change
> rename the logins within sql , i get the error.
> TITLE: Microsoft SQL Server Management Studio
> --
> Unable to rename LBOPS2\SQLServer2005MSSQLUser$LBOPS2$MSSQLSERVER.
> (ObjectExplorer)
> --
> ADDITIONAL INFORMATION:
> Rename failed for Login 'LAOPS2\SQLServer2005MSSQLUser$LAOPS2$MSSQLSERVER'.
> (Microsoft.SqlServer.Smo)
> For help, click:
> http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Rename+Login&LinkId=20476
> --
> An exception occurred while executing a Transact-SQL statement or batch.
> (Microsoft.SqlServer.ConnectionInfo)
> --
> The name change cannot be performed because the SID of the new name does not
> match the old SID of the principal. (Microsoft SQL Server, Error: 15098)
> For help, click:
> http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.2050&EvtSrc=MSSQLServer&EvtID=15098&LinkId=20476
> --
> BUTTONS:
> OK
> --
>
> Many Thanks
> Jon
>
Have you looked at using the script in:
http://support.microsoft.com/kb/246133/
Then dropping the logins and re-creating new ones with the same SIDs.
John

No comments:

Post a Comment