Deployment accounts and best practice

  • 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

  • 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

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • 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.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Many thanks guys

    E

  • 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

  • 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

  • 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

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • 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

  • 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

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply