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

Deployment accounts and best practice Expand / Collapse
Author
Message
Posted Friday, January 10, 2014 9:01 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Wednesday, April 23, 2014 7:16 AM
Points: 693, Visits: 757
Up untill now I have handed over my code to be deployed.

Now things are different and it caused me to think. Once the SQL software is installed and an instance created, which account would you use to create your database and its objects? If you used SSIS and SSAS as well would this be a different account when deploying.

As I mentioned SSIS I would prefer answers relevant to SQL 2012 rather than 2008.

Are there any good links / white papers etc as this must be documented somewhere as a best practice.

Another day learning something is a day well spent
E

PS Thanks in Advance
Post #1529858
Posted Sunday, January 12, 2014 8:42 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Yesterday @ 1:01 PM
Points: 15,558, Visits: 27,932
I don't think there is a single right answer to this. I very much believe that you should NOT use the administrative accounts as owners of the databases or for any other security other than administrative tasks. From there, all security should be set up using as little access as possible. Meaning, if a login only needs read access, only give it read access. If login needs to read and write data, only let it read and write data, etc.

----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1530106
Posted Sunday, January 12, 2014 11:04 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 8:58 PM
Points: 36,794, Visits: 31,253
I agree with Grant. If you're responsible only for given databases, you should have only dbo privs as a max. I would also strongly recommend that all code being promoted use ONLY the 2 part naming convention to prevent any confusion (and, it helps performance a bit, as well) especially if there's some other schema in play other than just dbo. It will also help with an object accidently being owned by a user.

The "SA" user should actually be disabled. If DBAs actually need "SA" privs to do their jobs, for reasons of traceability, it should be a part of their privs instead of having them login as "SA" or some other common login.

If you need the 3 or 4 part naming convention because some object is in another database or even on another server /instance, DON'T use the 3 or 4 part naming convention even then. Instead, setup a synonym to do the job for you. If the name of a database changes or is moved to a different server, it's MUCH easier to redefine a handful of synonyms than it is to find all of the 3 and 4 part naming in code and changing it.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1530127
Posted Sunday, January 12, 2014 12:37 PM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Wednesday, April 23, 2014 7:16 AM
Points: 693, Visits: 757
Many thanks guys

E
Post #1530144
Posted Monday, January 13, 2014 9:09 PM


SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, July 3, 2014 10:59 AM
Points: 79, Visits: 247
Grant,

I read at brentozar.com:
http://www.brentozar.com/blitz/jobs-owned-by-user-accounts/
http://www.brentozar.com/blitz/database-owners/

So would you recommend striving towards not using SA (possibly even renaming/disabling it), and creating new accounts that are least privilege for specific purposes?

I've always setup the Windows service accounts in this way, but not so much for jobs and db owners (I did run into the scenario Brent presents where IT had disabled an old user account that had been used for running a handful of jobs)


Why is it that people who can't take advice always insist on giving it? - James Bond, Casino Royale
Post #1530526
Posted Tuesday, January 14, 2014 3:12 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Wednesday, April 23, 2014 7:16 AM
Points: 693, Visits: 757
Still looking into this. SSA jobs will be set up under a different account and one that will not be discontiinued.

Still unsure on the database owner and may go SA

Thnaks for the links
E
Post #1530586
Posted Tuesday, January 14, 2014 3:48 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Yesterday @ 1:01 PM
Points: 15,558, Visits: 27,932
dbassassin (1/13/2014)
Grant,

I read at brentozar.com:
http://www.brentozar.com/blitz/jobs-owned-by-user-accounts/
http://www.brentozar.com/blitz/database-owners/

So would you recommend striving towards not using SA (possibly even renaming/disabling it), and creating new accounts that are least privilege for specific purposes?

I've always setup the Windows service accounts in this way, but not so much for jobs and db owners (I did run into the scenario Brent presents where IT had disabled an old user account that had been used for running a handful of jobs)


Yeah, pretty much. I've worked at the extreme end, where everything and everyone had 'sa' privs. It's impossible to manage. You're seriously better off if you can limit access as much as possible. Plus, depending on the type of company you're working for, you may need to for legal compliance reasons.


----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1530597
Posted Tuesday, January 14, 2014 10:06 AM


SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, July 3, 2014 10:59 AM
Points: 79, Visits: 247
Grant/Jeff

Would you say that using SA as the database owner or jobs account is not a preferred method. Did you make new user accounts for each purpose?

Jeff

Have you run into any issues when disabling/renaming the SA account?


Why is it that people who can't take advice always insist on giving it? - James Bond, Casino Royale
Post #1530767
Posted Tuesday, January 14, 2014 12:15 PM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Yesterday @ 1:01 PM
Points: 15,558, Visits: 27,932
I would use system administration ownership for packages and databases, yes, but not the 'sa' account. Two different critters.

----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1530827
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse