Ócáid
Mar 31, 11 PM - Apr 2, 11 PM
An ócáid foghlama SQL, Fabric and Power BI is mó. Márta 31 – 2 Aibreán. Bain úsáid as cód FABINSIDER chun $ 400 a shábháil.
Cláraigh inniuNí thacaítear leis an mbrabhsálaí seo a thuilleadh.
Uasghrádú go Microsoft Edge chun leas a bhaint as na gnéithe is déanaí, nuashonruithe slándála, agus tacaíocht theicniúil.
Applies to:
SQL Server
This topic discusses how to prepare to change to the partially contained database model and then provides the migration steps.
In this topic:
Review the following items when considering migrating a database to the partially contained database model.
You should understand the partially contained database model. For more information, see Contained Databases.
You should understand risks that are unique to partially contained databases. For more information, see Security Best Practices with Contained Databases.
Contained databases do not support replication, change data capture, or change tracking. Confirm the database does not use these features.
Review the list of database features that are modified for partially contained databases. For more information, see Modified Features (Contained Database).
Query sys.dm_db_uncontained_entities (Transact-SQL) to find uncontained objects or features in the database. For more information, see.
Monitor the database_uncontained_usage XEvent to see when uncontained features are used.
Contained databases must be enabled on the instance of SQL Server Database Engine, before contained databases can be created.
The following example enables contained databases on the instance of the SQL Server Database Engine.
sp_configure 'contained database authentication', 1;
GO
RECONFIGURE ;
GO
The following example enables contained databases on the instance of the SQL Server Database Engine.
In Object Explorer, right-click the server name, and then click Properties.
On the Advanced page, in the Containment section, set the Enable Contained Databases option to True.
Select OK.
A database is converted to a contained database by changing the CONTAINMENT option.
The following example converts a database named Accounting
to a partially contained database.
USE [master]
GO
ALTER DATABASE [Accounting] SET CONTAINMENT = PARTIAL
GO
The following example converts a database to a partially contained database.
In Object Explorer, expand Databases, right-click the database to be converted, and then click Properties.
On the Options page, change the Containment type option to Partial.
Select OK.
The following example migrates all users that are based on SQL Server logins to contained database users with passwords. The example excludes logins that are not enabled. The example must be executed in the contained database.
DECLARE @username sysname ;
DECLARE user_cursor CURSOR
FOR
SELECT dp.name
FROM sys.database_principals AS dp
JOIN sys.server_principals AS sp
ON dp.sid = sp.sid
WHERE dp.authentication_type = 1 AND sp.is_disabled = 0;
OPEN user_cursor
FETCH NEXT FROM user_cursor INTO @username
WHILE @@FETCH_STATUS = 0
BEGIN
EXECUTE sp_migrate_user_to_contained
@username = @username,
@rename = N'keep_name',
@disablelogin = N'disable_login';
FETCH NEXT FROM user_cursor INTO @username
END
CLOSE user_cursor ;
DEALLOCATE user_cursor ;
Contained Databases
sp_migrate_user_to_contained (Transact-SQL)
sys.dm_db_uncontained_entities (Transact-SQL)
Ócáid
Mar 31, 11 PM - Apr 2, 11 PM
An ócáid foghlama SQL, Fabric and Power BI is mó. Márta 31 – 2 Aibreán. Bain úsáid as cód FABINSIDER chun $ 400 a shábháil.
Cláraigh inniuOiliúint
Modúl
Migrate SQL Server workloads to Azure SQL Database - Training
Learn the essentials of Azure SQL Database deployment and migration. Explore its benefits, exclusive features, and migration options while optimizing performance and application connections for a smooth transition to the cloud.
Deimhniú
Microsoft Certified: Azure Database Administrator Associate - Certifications
Administer an SQL Server database infrastructure for cloud, on-premises and hybrid relational databases using the Microsoft PaaS relational database offerings.
Doiciméadúchán
sys.dm_db_uncontained_entities (Transact-SQL) - SQL Server
sys.dm_db_uncontained_entities (Transact-SQL)
Security Best Practices with Contained Databases - SQL Server
Understand and mitigate the unique threats to contained databases, including those related to the USER WITH PASSWORD authentication process in SQL Server.
Manage metadata when making a database available on another server - SQL Server
Manage Metadata When Making a Database Available on Another Server
contained database authentication (server configuration option) - SQL Server
Learn about the contained database authentication option. See how to turn it on so that you can attach contained databases to the SQL Server Database Engine.