Wednesday, March 28, 2012

Property Owner is not available for Database

I am getting this error while selecting the properties of one database.

Property Owner is not available for Database '[TEST]'. This property may not exist for this object, or may not be retrievable due to insufficient access rights. (Microsoft.SqlServer.Smo)

Suddently this error started coming ? why ?

Make sure that the database owner is/was not a user / principal which has been deleted in the meantime. Orphaned database owner can be fixed using the sp_changedbowner and assigning a new owner to the database.

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Thanks..

I am getting this error while executing this.Do you know how to see the current/previous owner in studio ?

USE [TEST]

GO

EXEC sp_changedbowner 'dbo'

GO

Error

Msg 15151, Level 16, State 1, Line 1

Cannot find the principal 'dbo', because it does not exist or you do not have permission.

|||

You will have to provide a server prinicpal like 'sa'

To get the current owners, you will have to use something like the following:

SELECT databases.NAME,server_Principals.NAME

FROM sys.[databases]

INNER JOIN sys.[server_principals]

ON

[databases].owner_sid = [server_principals].sid


Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

1) In this database all the tables/views owner is dbo.does that mean dbo should set as database owner ?

Your query is seleted only 7 databases Out of 15 databases . What is that mean ?

Can one database work with out principal login ? What is the default owner of non-system databases ?

Is there any code changes required if any database owner change ?

2) In studio , what is the difference between root--> security-->logins vs root>databases>TEST-->security--> users

Thanks

Julius

|||

That means that a macthing sid is not found int he server principals table, these database seem owner orphaned. Use a left join to find out which ones are not in there.

Databases can work without a principals owner but this should not be a normal state.

The default owner of newly created database is the server principal who created the database.


The are no code changes unless you use something like database ownership chaining.

2) The first path are the server principals (logins who have access to the server), the second path are the database principals (Server principals mapped to database principals) whoc have certain permissions on the database either through individual rights or group memebership.

Jens K. Suessmeyer

http://www.sqlserver2005.de

No comments:

Post a Comment