March 16, 2005 at 7:00 am
I have 2 System Databases - Model and MSDB - that list in EM as Owner 'UNKNOWN'
I think the owner may have been an account that has been deleted. WHen I attempt to sp_changedbowner 'sa' I get this error:
Server: Msg 15109, Level 16, State 1, Procedure sp_changedbowner, Line 22
Cannot change the owner of the master database.
What are the ramifications of leaving it like this and does anyone know how I can re-assign the owner? thank you!
March 16, 2005 at 8:49 am
Follow the procedures from this link: http://support.microsoft.com/default.aspx?scid=kb;en-us;224071
Make sure you login as SA. The ramnifications of leaving it like this is you'll still be able to execute jobs but new jobs created won't execute on the specified schedule date/time.
March 17, 2005 at 11:38 am
A little code snippetto make the change (I'd probably restart SQL afterwards as well).
---
--- fix_db_sid.sql
---
use master
go
exec sp_configure 'allow updates',1
go
reconfigure with override
go
update sysdatabases
set sysdatabases.sid = s.sid
from syslogins as s
where sysdatabases.name in ('model', 'msdb')
and s.loginname = 'sa'
go
checkpoint
go
exec sp_configure 'allow updates',0
go
reconfigure with override
go
---
--- end of fix_db_sid.sql
---
RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."
March 17, 2005 at 12:50 pm
I would not run that code !
sp_changedbowner not only touches the sid from sysdatabases it also updates sysusers (sid, status and updatedate)
Try the detach/attach procedures better
* Noel
March 18, 2005 at 12:09 pm
reconfigure with override
go
declare @sid varbinary(85)
select @sid = sid from master.dbo.syslogins
where loginname = 'sa'
update master.dbo.sysdatabases
set sid = @sid
where dbid = db_id()
exec sp_configure 'allow', 0
reconfigure with override
March 18, 2005 at 12:16 pm
you could do that even with the previous one too! But What I am trying to get at is that yours and previously posted code are only changing sysdatabases table and may be leaving inconsistencies in sysuser.
If you want to run any code just copy what sp_changedbowner does and comment out the check for the system databases
hth
* Noel
March 18, 2005 at 12:51 pm
Thank you Noel. Looks like I need to look at the detach/attach procedures like you said. Thanks again
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply