Wednesday, March 28, 2012

properties owner and users owner.

In the properties section of a database there is a owner.
Under the users of a database there is the dbo with
a Login Name.
What is the difference between the 'two owners' ?
ben brugman
Hi,
"Both can be same in most of the situation."
DBO - DBO is a role, A user with a DBO role can do any activities inside
the database.
Properties section of a database there is a owner?
He will be person who creates the database. By default he will a DBO. This
owner can be changed using the procedure,
sp_changedbowner.
Thanks
Hari
MCDBA
"ben brugman" <ben@.niethier.nl> wrote in message
news:eCuSx$chEHA.4064@.TK2MSFTNGP12.phx.gbl...
> In the properties section of a database there is a owner.
> Under the users of a database there is the dbo with
> a Login Name.
> What is the difference between the 'two owners' ?
> ben brugman
>
|||Thanks for your time and quick response,
see inline :
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:O2$NJIdhEHA.2052@.tk2msftngp13.phx.gbl...
> Hi,
> "Both can be same in most of the situation."
I tried to make both the same.

> DBO - DBO is a role, A user with a DBO role can do any activities inside
> the database.
> Properties section of a database there is a owner?
> He will be person who creates the database. By default he will a DBO. This
> owner can be changed using the procedure,
> sp_changedbowner.
I cannot change the owner because :
"
Server: Msg 15110, Level 16, State 1, Procedure sp_changedbowner, Line 46
The proposed new database owner is already a user in the database.
"
And in the database he is the dbo owner, so I do not think deleting that
owner
is wise.
I still have difficulty grasping the difference between the two owners and
still would like them to be the same.
Thanks
ben brugman

> Thanks
> Hari
> MCDBA
>
>
> "ben brugman" <ben@.niethier.nl> wrote in message
> news:eCuSx$chEHA.4064@.TK2MSFTNGP12.phx.gbl...
>
|||Hari
DBO is a privileged user.
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:O2$NJIdhEHA.2052@.tk2msftngp13.phx.gbl...
> Hi,
> "Both can be same in most of the situation."
> DBO - DBO is a role, A user with a DBO role can do any activities inside
> the database.
> Properties section of a database there is a owner?
> He will be person who creates the database. By default he will a DBO. This
> owner can be changed using the procedure,
> sp_changedbowner.
> Thanks
> Hari
> MCDBA
>
>
> "ben brugman" <ben@.niethier.nl> wrote in message
> news:eCuSx$chEHA.4064@.TK2MSFTNGP12.phx.gbl...
>
|||'dbo' is a special database user and must exist in every database. The
database owner is the *login* that is mapped to the database 'dbo' user and
this mapping is stored in 2 places, sysdatabases and sysusers. These should
normally be the same login but can get out-of-sync in some situations, such
as a restore or attach. The query below will return the same login if the
owner entries are synchronized:
USE MyDatabase
SELECT 'sysdatabases mapping=' + SUSER_SNAME(sid)
FROM master..sysdatabases
WHERE name = DB_NAME()
UNION ALL
SELECT 'sysusers mapping=' + SUSER_SNAME(sid)
FROM sysusers
WHERE name = 'dbo'
You can execute sp_changedbowner to change or correct the mapping. If you
get error 15110, ensure the specified login is not already a database user
since a login can be mapped to only one database user at a time.
The 15110 error can also be raised due to an out-of-sync condition mentioned
above. In that case, temporarily change database ownership to a
non-conflicting login and then to the desired login like the example below:
USE MyDatabase
EXEC sp_addlogin 'TempOwner'
EXEC sp_changedbowner 'TempOwner'
EXEC sp_changedbowner 'MyDatabaseOwner'
EXEC sp_droplogin 'TempOwner'
GO
Hope this helps.
Dan Guzman
SQL Server MVP
"ben brugman" <ben@.niethier.nl> wrote in message
news:%23nqiINdhEHA.3076@.tk2msftngp13.phx.gbl...[vbcol=seagreen]
> Thanks for your time and quick response,
> see inline :
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:O2$NJIdhEHA.2052@.tk2msftngp13.phx.gbl...
> I tried to make both the same.
inside[vbcol=seagreen]
This
> I cannot change the owner because :
> "
> Server: Msg 15110, Level 16, State 1, Procedure sp_changedbowner, Line 46
> The proposed new database owner is already a user in the database.
> "
> And in the database he is the dbo owner, so I do not think deleting that
> owner
> is wise.
> I still have difficulty grasping the difference between the two owners and
> still would like them to be the same.
> Thanks
> ben brugman
>
>

No comments:

Post a Comment