What is Contained DataBase?

SQL Server 2012 Onwards we have a new solution termed as contained database. Contained database is defined as a database which has the database user without logins. It includes all settings related to databases along with its metadata, thus system will be having no dependency with SQL server login. Users can easily connect to a contained database without having to go through the log in at DB engine.

Contained database feature provides two containment modes:

  • None – By default each database has its mode set as NONE. This means there is no contained database feature being used.
  • Partial – With partially contained databases, we can define boundaries between databases and the server, so the metadata will exist inside the databases. It makes SQL Server databases more portable and less dependent on underlying hosts. 

A contained database is a database that is isolated from other databases and from the instance of SQL Server that hosts the database

  • Isolated from other databases
  • Isolated from SQL Server instance
  • No Login needed

Applications can access the database independent of the sql server instance information

SQL Server needs to be configured before you can create contained databases

Database needs to be configured to be a contained database


Contained database is not fully featured DB and it is a partial because it doesn't have sql server instance principles as like the normal instance

but contained database dose not share anything it is always can found in contained db. it doesn't have login and if any db have login then it is fully covered features

A fully contained database includes all the settings and metadata required to define the database and has no configuration dependencies on the instance of the SQL Server Database Engine where the database is installed

Benefits

One of the problems that occurs when moving databases, is that some important information can be unavailable when a database is moved from one instance to another. 

For example, login information is stored within the instance instead of in the database. When you move a non-contained database from one instance to another instance of SQL Server, 

this information is left behind. You must identify the missing information and move it with your database to the new instance of SQL Server. This process can be difficult and time-consuming

Limitations

Partially contained databases do not allow the following features.

Replication, change data capture, or change tracking.

Numbered procedures

Schema-bound objects that depend on built-in functions with collation changes

Binding change resulting from collation changes, including references to objects, columns, symbols, or types.

Comments

Popular posts from this blog

Email Sending through O365 using OAuth Protocol

IISRESET vs App Pool Recycling ?

Deploy .Net6.0 Web api with docker