Ó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 article describes how to restore the service master key in SQL Server by using Transact-SQL.
Rabhadh
It is unlikely that you will ever need to restore the service master key. If you do, you should proceed with extreme caution. For more information, see Back Up the Service Master Key.
When the service master key is restored, SQL Server decrypts all the keys and secrets that have been encrypted with the current service master key, and then encrypts them with the service master key loaded from the backup file.
If any one of the decryptions fails, the restore will fail. You can use the FORCE option to ignore errors, but this option will cause the loss of any data that cannot be decrypted.
Regenerating the encryption hierarchy is a resource-intensive operation. Schedule this during a period of low demand.
Rabhadh
The service master key is the root of the SQL Server encryption hierarchy. The service master key directly or indirectly secures all other keys in the tree. If a dependent key cannot be decrypted during a forced restore, data that is secured by that key will be lost.
Requires CONTROL SERVER permission on the server.
Retrieve a copy of the backed-up service master key, either from a physical backup medium or a directory on the local file system.
In Object Explorer, connect to an instance of Database Engine.
On the Standard bar, select New Query.
Copy and paste the following example into the query window and select Execute.
-- Restores the service master key from a backup file.
RESTORE SERVICE MASTER KEY
FROM FILE = 'c:\temp_backups\keys\service_master_key'
DECRYPTION BY PASSWORD = '3dH85Hhk003GHk2597gheij4';
GO
Nóta
The file path to the key and the key's password (if it exists) will be different than what is indicated above. Please make sure that both are specific to your server and key set-up.
Ó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
Doiciméadúchán
Back up a database master key - SQL Server
Learn how to back up a database master key in SQL Server by using Transact-SQL. This essential key encrypts other keys and certificates.
Restore a database master key - SQL Server
Learn how to restore the database master key in SQL Server by using SQL Server Management Studio with Transact-SQL.
Create a Database Master Key - SQL Server
Create a database master key in SQL Server by using Transact-SQL. Be sure you have the required permissions.