585 pts.
 SQL Server Database Restore
When i restore a database from server1 to server2 as stand by/read-only mode the database restores with a database owner "domainrmartinez". How can i restore a database from server1 to server2 and the database owner as "sa"?

Software/Hardware used:
SQL Server 2005
ASKED: August 24, 2009  9:21 PM
UPDATED: September 4, 2009  7:31 PM

Answer Wiki:
You would need to change the owner on the source system before you backup the database. You can't make any changes to the database when it is in stand by /readonly mode.
Last Wiki Answer Submitted:  August 24, 2009  10:54 pm  by  Denny Cherry   64,520 pts.
All Answer Wiki Contributors:  Denny Cherry   64,520 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

the owner is sa before i backup the database.

 585 pts.

 

It might be changing the owner to the person restoring the database. It’s been a while since I’ve had to restore a database.

I assume that you have sysadmin rights on the server you are restoring the database to?

You won’t be able to change the owner until you bring the database online.

 64,520 pts.

 

a job is scheduled to restore the database on the second server. I set the job to run as sa.

 585 pts.

 

Can you check the owner_sid column in the sys.databases DMV as see what it shows for the database owner?

 64,520 pts.