Solved

Change Database Ownership from a restored database

Posted on 2013-11-01
4
249 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
ID: 39617183
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
ID: 39617191
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
ID: 39617867
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
ID: 39617884
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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 Migration Tip #1 – Source Server Health can be found listed in my profile here: http:…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

920 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

13 Experts available now in Live!

Get 1:1 Help Now