How to change system databases owner from sa to some other login

  • Hi Guys,

    we have our client policy now to change/rename all the processes running as 'sa' account, so they dont want a login with a name 'sa' as we have currently, they want it to be changed to someother name like 'abcsa123'.

    I have checked the system databases owner is 'sa', so shall i rename 'sa' or create a new account and disable 'sa'.

    I have no problem renaming it everything is fine when i did in my laptop, but when i tried to change system db owner from 'sa' to other users its shows me an error message saying, master,model,tempdb and msdb owners cannot be changed.

    Can any one suggest me what to do exactly.

    Thanks.

  • Use "sp_changedbowner". for eample, to change the owner of the current database to "Albert":

    EXEC sp_changedbowner 'Albert'(from BOL)

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • will it work for system databases too

  • Sorry, don't know.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • You can rename sa safely. The database's owner references the login's SID, not the login's name . Even if you change the name of sa, the SID remains the same.

    If you want really secure, rename sa and disable it. Make sure you have a sysadmin login for yourself first.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • you don't want to change the ownership, who knows what would break.

    Rename SA, go with Windows auth only or disable SA from logging in.

  • thanks guys, i will talk this in our meeting and renaming is not a problem, but i guess if they want a new id to be replaced with sa then i might get some prolems changing its role...

  • If they want to change the owner of the system databases, ask them for the justification for that request.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply