Friday, February 24, 2012

DBO user missing in two databases

SQL 2K on Windows 2003
I know the documentation says that the dbo user account in each database can
't be deleted, but it has gone missing overnight on two databases. This has
caused my SA account to hose since it references the dbo user for these two
db's.
I have failed so far at creating a dbo user account for the sa login. It gi
ves me error 15405:Cannot use the reserved user or role name 'sa'.
I have also not been successful at creating the dbo user account with a diff
erent system administrator login. It gives me the error 15023:user or role
'dbo' already exists in the current database.
I'm stuck and could really use some suggestions.
Thanks in advance,
unsophisticated - small time dba
ShirleyTo change the owner of the databases simply use sp_changedbowner e.g.
use <your db name>
go
exec sp_changedbowner 'sa','true'
go
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"ShirleyL" <shirleyNoSpamL@.abshernw.com> wrote in message
news:uUSwC1PJFHA.1096@.tk2msftngp13.phx.gbl...
SQL 2K on Windows 2003
I know the documentation says that the dbo user account in each database
can't be deleted, but it has gone missing overnight on two databases. This
has caused my SA account to hose since it references the dbo user for these
two db's.
I have failed so far at creating a dbo user account for the sa login. It
gives me error 15405:Cannot use the reserved user or role name 'sa'.
I have also not been successful at creating the dbo user account with a
different system administrator login. It gives me the error 15023:user or
role 'dbo' already exists in the current database.
I'm stuck and could really use some suggestions.
Thanks in advance,
unsophisticated - small time dba
Shirley|||Jasper Smith wrote:
> To change the owner of the databases simply use sp_changedbowner e.g.
> use <your db name>
> go
> exec sp_changedbowner 'sa','true'
> go
>
There is a small and totally insignificant danger in using sa as a database
owner. When cross database ownership chaining for the database or the server
is activated, and there are non sysadmins in the database with dbo_owner
rights, then the can create stored procedure which access sp's in the master
database like sp_addsrvrolemember.
Hans

No comments:

Post a Comment