Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12345»»»

Worst Practices - Objects Not Owned by DBO Expand / Collapse
Author
Message
Posted Sunday, October 14, 2001 12:00 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: Moderators
Last Login: Today @ 6:56 AM
Points: 6,804, Visits: 1,934
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/awarren/worstpracticesobjectsnotownedbydbo.asp>http://www.sqlservercentral.com/columnists/awarren/worstpracticesobjectsnotownedbydbo.asp

Andy
SQLAndy - My Blog!
Connect with me on LinkedIn
Follow me on Twitter
Post #1309
Posted Sunday, October 14, 2001 10:07 PM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Friday, September 7, 2007 8:30 AM
Points: 74, Visits: 1
I agree with you 100%. I am currently working on a project where they have made all objects owned by user "rms" and they have turned on Case Sensitivity, don't ask me why. It is like pulling your hair out. I think until people actually experience the agony they will not completely realize how unpleasant they can make life. I have learned the hard way more than once, and although previously I knew that making objects be owned by anyone other than dbo was bad, I had not yet lived with the consequences. Also, in this case, you can kiss all of your dynamic SQL (inside stored procedures) goodbye. From one who has been there, don't do it! And while you're at it, unless you absolutely have to, do not turn on Case Sensitivity. With both, you will end up debugging things that used to work, and debugging things that you know should work.

Mindy Curnutt




Post #22426
Posted Sunday, October 14, 2001 10:52 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, July 31, 2007 8:20 AM
Points: 885, Visits: 1
Hi there

Yes, I agree and learnt the hard way. This is a real gotcha when your an oracle DBA moving into the SQLServer realm. Basically I now take the approach of all DBO owned objects then either application or other roles to security records accordingly, this is a much similar and better managed approach (and for all the reasons discussed in your article).

Cheers

Chris




Chris Kempster
www.chriskempster.com
Author of "SQL Server Backup, Recovery & Troubleshooting"
Author of "SQL Server 2k for the Oracle DBA"
Post #22427
Posted Monday, October 15, 2001 1:55 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 12:58 PM
Points: 2,923, Visits: 1,872
Yes definitely

When I did the SQL 6.5 courses I was lucky enough to be taught by a trainer with commercial dba and they stressed the importance of this.

One thing I am not clear on. In SQL 6.5 you had to use sp_addalias to make logins impersonate dbo. SQL 7 seems to discourage this, and yet simply adding a login to the db_owner group seems to create these ownership issues.

How are you supposed to do it SQL 8 if you don't use sp_addalias?



LinkedIn Profile
Newbie on www.simple-talk.com
Post #22428
Posted Monday, October 15, 2001 2:12 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, April 25, 2004 11:19 PM
Points: 8, Visits: 1
I agree fully. Btw.: Have you ever tried to change owner on a userdefined data type? If it is a nightmare to change owners on ordinary objects, it has been impossible for me to figure out how to handle udt's.

Per-Johan




Post #22429
Posted Monday, October 15, 2001 3:54 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, September 27, 2012 10:43 PM
Points: 126, Visits: 56
I agree for the most part...object ownership can be a real pain if everyone is allowed to create objects. There are some pretty strange circumstances where object ownership can be very beneficial. One interesting thing about SQL Server is that you can have a view owned by userA with the exact same name as a table owned by DBO. It's a very usefull way of limiting an applications access to a database without modifing the DATA or the application in any way. For example, an web application was written to allow HR to query employee records from a database before you were the DBA. Now you are faced with the task of removing the EMP_Password column from the web application, but the backend HR system still needs this data. You could just create a view of the dbo.Employee table With Encryption and name it dbo.Employee_View. Then create a View of the dbo.Employee_View view called WebAppUser.Employee and that's it you're done. Object ownership can be tricky, but object ownership can help you trick things too!





Post #22430
Posted Monday, October 15, 2001 5:22 PM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: Moderators
Last Login: Today @ 6:56 AM
Points: 6,804, Visits: 1,934
Dan, there are certainly some interesting things you can do with object ownership. Now whether you should...thats the question! If you're using it intentionally to solve a business need, good for you - though maybe sometime we can debate whether there is a better, more elegant method that would just use dbo

Mindy - saw your post earlier, just didnt have time to respond - case sensitivity....definitely will make the worst practices list sooner or later! I'm ok with limited use of this on a few columns, but not database wide. What a time sink.

Thanks to all who have posted comments so far - I appreciate you taking the time to do so.

Andy



Andy
SQLAndy - My Blog!
Connect with me on LinkedIn
Follow me on Twitter
Post #22431
Posted Tuesday, October 16, 2001 12:06 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, December 6, 2004 4:36 AM
Points: 1, Visits: 1
quote:

I am currently working on a project where they have made all objects owned by user "rms"



WOW, I thought he only worked with free software. I wonder what the /. crowd will say.

Sorry, I couldn't help myself






Post #22432
Posted Tuesday, October 16, 2001 12:43 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, February 22, 2005 1:48 AM
Points: 12, Visits: 1
I totally agree! I have been caught out a couple of times because of ownership - it's a real pain.

Life's much easier if it's dbo all the way...





Post #22433
Posted Tuesday, October 16, 2001 1:26 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, July 28, 2004 2:55 AM
Points: 12, Visits: 1
This is somthing i have been trying to stress to the development team i work with for ages. thanks for a well written back-up to my nagging.




Post #22434
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse