Partially Contained Databases
Chris Anderson
Database Architect, CA Department of
Corrections and Rehabilitation
@realworldis
PROBLEM
After you migrate or restore a database from
one server to another, extra steps are
required to identify and move logins before
users can connect.
Partial Containment in SQL Server 2012 +
Traditional Database Auth
Objects
System
Databases
Users
Logins
User Database
Contained Database Auth
Objects
System
Databases
User Database
Benefits
A contained database can be migrated or
restored from one server to another and be
ready for use.
Uncontained Entities
But wait, there’s
more…
Just one more thing…
db_owner
Thank You @SacSQLUG!
Questions?
Chris Anderson
Database Architect, CA Department of Corrections
and Rehabilitation
@realworldis

Partially Contained Databases in SQL Server 2012+

Editor's Notes

  • #2 Thank you for having me out
  • #3 How many of you have migrated a database from one server to another? E.g. you have a month to do it? How many of you have had to restore a database from one server to another? How many of you had to do that restore at 2AM Sunday morning, got to get it running by Monday? I ask you to keep those scenarios in mind as you view this demo, and consider what pieces would make those situations more comfortable for you.
  • #4 Traditional databases are uncontained; Grant Fritchey: problem since beginning
  • #5 In contained databases, the authentication objects – logins – move into the schema of the user database
  • #6 Database owners (db_owner) can now add users to their database. Do not need to have a server-level role such as securityadmin Examine ‘Uncontained Entities’ to find dependencies on objects outside of the database
  • #7 Take Away: Contained users live within the schema of a user database; DB_Owners can be delegated more power without exposing server-level settings to them Call to Action: Try it out. A great first step is a reporting or application account that has a one-to-one relationship with a single databases