Solved

Change Database Ownership from a restored database

Posted on 2013-11-01
4
248 Views
Last Modified: 2014-09-24
I have a MS SQL 2000 server that I took the backup databases from, and restored them to a new and differently named MS SQL 2008 R2 server.

The restore went fine, and I can browse the tables and run queries.

I am installing an ERP Database Server Software (Infor Syteline 8.03) in a linked multi-site environment.
When I got to link the databases, I get the following error.

"Failed to link the database as multi-site:
[Microsoft][ODBC SQL Server Driver][SQL Server] Could not find server 'OLD SERVER NAME' in sys.servers. Verify thath the correct server name was specified. If necessary, execute the stored procedure SP_addlinkedserver to add the server to sys.servers.
[Microsoft][ODBC SQL Server Driver][SQL Server] The statement has been terminated."

I guess I am looking for a Query to change "OLD SERVER NAME" to "NEW SERVER NAME"

The stored procedure sp_addserver 'NEW SERVER NAME', 'local'; will not work because it says the server already exists.

I did not migrate the master database to this server. could that be the issue.
0
Comment
Question by:Moordoom
  • 3
4 Comments
 
LVL 39

Expert Comment

by:lcohan
Comment Utility
This will change it to SA but you can replace that with the owner you want:

exec sp_changedbowner 'sa'
ALTER AUTHORIZATION ON SCHEMA::OneShopSecureCart TO dbo;
GO
0
 
LVL 39

Expert Comment

by:lcohan
Comment Utility
For linked server I think you are out of luck with rename because I don't think you can rename linked servers, but you can create them correctly for your needs.

Before dropping existing linked server MAKE SURE you right click and script it the save that and keep safe!!
0
 

Author Comment

by:Moordoom
Comment Utility
EXEC sp_changedbowner 'sa' does not change the server the driver is trying to look for.
I am looking for a way to change the server name in sys.servers
0
 
LVL 39

Accepted Solution

by:
lcohan earned 500 total points
Comment Utility
Your question title is:

<<Change Database Ownership from a restored database>>

and sp_changedbowner does exactly that.


In the details you ask indeed for a linked server name change and my comment Posted on 2013-11-01 at 11:33:37  ID: 39617191 is just the answer to that. You can't rename it, you can't update SQL System tables directly anymore.
0

Featured Post

Why spend so long doing email signature updates?

Do you spend loads of your time carrying out email signature updates? Not very interesting are they? Don’t let signature updates get you down. Let Exclaimer Cloud - Signatures for Office 365 make managing email signatures a breeze.

Join & Write a Comment

Welcome to my series of short tips on migrations. Whilst based on Microsoft migrations the same principles can be applied to any type of migration. My first tip is around source server preparation. No migration is an easy migration, there is a…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now