Monday, March 12, 2012

Error when changing sa password or when trying to access DB via sa

Hi,
Two weird things with the sa account, and I found a solution on
Microsoft.com, but it's not working.
First, when I go to change the SA password in Enterprise Manager, I
get the following error:
Error 21776: [SQL-DMO] The name 'dbo' was not found in the Users
collection. If the name is a qualified name, use [] to separate
various parts of the name, and try again.
So, I checked the knowledgebase and found this:
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q218/1/72.ASP&NoWebContent=1#appliesto
This is the exact issue I'm having, but when I run: sp_changedbowner
sa
... I get the following message in Query Analyzer:
Server: Msg 15109, Level 16, State 1, Procedure sp_changedbowner, Line
22
Cannot change the owner of the master database.
So, I searched for this error and found this:
http://support.microsoft.com/default.aspx?scid=kb;en-us;328173
Catch-22... I need to change the Master DB to be owned by 'sa', yet it
won't let me change it since it's not already owned. Am I missing
something? This did happen just after I restored a database, just as
discribed in the first support doc, but it gives no exact syntax on
what to plug into Query Analyzer to resolve the issue, other then
using the sp_changedbowner stored procedure. And I must be using it
incorrectly to get the error, or it's another bug in MS SQL.
Can someone point me to the right direction? What should be an easy
back-up and restore is turning into a multi-hour ordeal.
Thanks,
Alex.If your a local admin or domain admin connect to the SQL Server using Query
Analyser and ask for a 'WinNT Authentication' then issue the following
command
A. Change the password of a login without a former password
This example changes the password for the login Victoria from a NULL
password to "B3r12-36".
EXEC sp_password NULL, 'B3r12-36', 'Victoria'
In EnterPrise manager Delete and Re-Register the troublesome server, when
registering use the new password.
--
HTH
Ryan Waight, MCDBA, MCSE
"Alex" <alex@.totallynerd.com> wrote in message
news:2ba4b4eb.0310270835.36d6e245@.posting.google.com...
> Hi,
> Two weird things with the sa account, and I found a solution on
> Microsoft.com, but it's not working.
> First, when I go to change the SA password in Enterprise Manager, I
> get the following error:
> Error 21776: [SQL-DMO] The name 'dbo' was not found in the Users
> collection. If the name is a qualified name, use [] to separate
> various parts of the name, and try again.
> So, I checked the knowledgebase and found this:
>
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q218/1/72.ASP&NoWebContent=1#appliesto
> This is the exact issue I'm having, but when I run: sp_changedbowner
> sa
> ... I get the following message in Query Analyzer:
> Server: Msg 15109, Level 16, State 1, Procedure sp_changedbowner, Line
> 22
> Cannot change the owner of the master database.
> So, I searched for this error and found this:
> http://support.microsoft.com/default.aspx?scid=kb;en-us;328173
> Catch-22... I need to change the Master DB to be owned by 'sa', yet it
> won't let me change it since it's not already owned. Am I missing
> something? This did happen just after I restored a database, just as
> discribed in the first support doc, but it gives no exact syntax on
> what to plug into Query Analyzer to resolve the issue, other then
> using the sp_changedbowner stored procedure. And I must be using it
> incorrectly to get the error, or it's another bug in MS SQL.
> Can someone point me to the right direction? What should be an easy
> back-up and restore is turning into a multi-hour ordeal.
> Thanks,
> Alex.|||Yes, you cannot change database owner to MASTER.
If you run sp_helpuser on your restored database, should
show the "LoginName" as NULL if 'sa' do not own it.
You only needed to run sp_changedbowner on your restored
database. -->
use <restored_db>
go
sp_changedbowner 'sa'
go

No comments:

Post a Comment