Re: dbo question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Steen Persson (SPE_at_REMOVEdatea.dk)
Date: 01/18/05


Date: Tue, 18 Jan 2005 09:15:23 +0100

Thanks Wayne,

I investigated it a little bit further, and I think I found out what
confused me. When I look at the dbo user for a database in EM, it shows no
Login Name. If I then look at the same db in QA (sp_helpdb) it shows the
owner ok.

The cases where EM doesn't show a login name, seems to be the ones where the
dbo isn't mapped to a login name that has been created as a login in SQL
but is a user that's member of the SystemAdministrator role (and/or in the
local admin groups on the server). This might be obvious and clear for
others, but it confused me a little bit...;-).

Thanks for your inputs.

Regards
Steen

Wayne Snyder wrote:
> dbo is always mapped to something. It is safe to map all of them to
> sa or some other login you expect will always exist.... I use either
> sa or a trusted login so moving databases arouns isn't quite so much
> trouble.
>
>
> "Steen Persson" <SPE@REMOVEdatea.dk> wrote in message
> news:u36YSpI$EHA.612@TK2MSFTNGP09.phx.gbl...
>> Hi Mark
>>
>> The reason for removing this specific dbo user, is because we are
>> trying to "clean up" our SQL server installations. We have 8 servers
>> for various applications and there haven't really been any corporate
>> guidelines for how to install them. They are therefore installed and
>> configured in different ways.
>>
>> As I understand the sp_changedbowner, it will map the username
>> spcified to the dbo role, but I'm not sure that's what I want.
>> If I look at some of the other SQLServers, it looks like no specific
>> loginname has been mapped to 'dbo'. In this case I assume that dbo
>> is the loginnames which are members of the System Administrators
>> Role on the server. I don't know if this scenario is advisable or
>> not, but would it be possible to remove the dbo mapping to a
>> specific loginname and change it to a "blank" loginname?
>>
>> /Steen
>>
>>
>> Mark Allison wrote:
>>> Hello Steen,
>>>
>>> You can use sp_changedbowner like this:
>>>
>>> use <mydb>
>>> exec sp_changedbowner 'sa'
>>>
>>> This will map the sa login to dbo user in the mydb database. Why do
>>> you want to remove the dbo user?
>>>
>>> Mark.
>>>
>>>
>>>> Hi
>>>>
>>>> I can see that in some of our databases, the user 'dbo' are mapped
>>>> to a specific loginname where in others it's not mapped to
>>>> anything. How can I change this so the 'dbo' user isn't mapped to
>>>> a specific useraccount. The reason is that I'd like to remove the
>>>> login that's set as 'dbo' for those databases.
>>>>
>>>> I've looked in BOL, but I'm not quite sure about the steps to
>>>> perform to get this fixed. I know that all members of the Sysadmin
>>>> role is mapped to 'dbo' so that's what I'd like to have rather
>>>> than mapping a specific user to the 'dbo' user.
>>>>
>>>> Since it's in our production environment is has to be changed, I'd
>>>> like to be fairly sure about the steps to do before I just go ahead
>>>> and change it...;-)
>>>>
>>>> Regards
>>>> Steen



Relevant Pages

  • Re: Confused about dbo
    ... neither the explicit database owner or aliased to the dbo user. ... member of the db_owner role does not mean you are aliased to the dbo user. ... When you connect to SQL Server you do so using a login. ...
    (microsoft.public.sqlserver.security)
  • Re: db_owner role in SQL 2k
    ... Windows login name. ... login that is the owner of a database and members of the sysadmin role. ... >> the username dbo" ... >> FULL permission to do anything and everything. ...
    (microsoft.public.sqlserver.programming)
  • Re: Change dbo
    ... I have a database where a user is defined as the dbo on a database. ... I tried using SQL Server Manger ... The login for this person maps to dbo. ...
    (microsoft.public.sqlserver.security)
  • Re: db_owner role in SQL 2k
    ... > The owner of a database is a login, which is listed in the sysdatabases ... > table in the master database as the owner of the database. ... and their user name will ALWAYS be DBO. ... > automatically members of the public role. ...
    (microsoft.public.sqlserver.programming)
  • Re: Confused about dbo
    ... Make sure you understand the difference between login names and user names. ... database within a SQL Server instance. ... There are several ways you could have the username dbo. ... the true owner of the database. ...
    (microsoft.public.sqlserver.security)