The process of making converts a database to contained database consist of 2 steps.
To view if an instance contains any Contained database.
select name, containment from sys.databases;
select * from sys.dm_db_uncontained_entities;
select * from sys.sql_modules;
Step 1: Enable server property Contained Database authentication parametersp_configure 'Contained database authentication', 1;
go
Reconfigure
Step 2: set database to contained databaseuse master
go
alter database vcdb_2016 set containment = PARTIAL
To view Contained databaseselect name, containment from sys.databases;
If there is a need to migrate any users to the Contained database. It can be achieved with the following TSQL. Please check provided link if many users need to be migrated. Otherwise, each user will need to be migrated manually with "sp_migrate_user_to_contained" procedure.
https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-migrate-user-to-contained-transact-sql?view=sql-server-2017
Just as an example.
Just as an example.
sp_migrate_user_to_contained
@username = N'Barry',
@rename = N'keep_name',
@disablelogin = N'do_not_disable_login' ;
Other means of migration to Azure can be done using SQL Server Management Studio to copy the database over. Detach and attach method works as well.
No comments:
Post a Comment