

Because this master key is not encrypted by the service master key, a password must be specified when it is opened.Facebook Twitter Google + LinkedIn Pinterest Email Share. Creates a backup of the "AdventureWorks2012" master key. In Object Explorer, connect to an instance of Database Engine.Ĭopy and paste the following example into the query window and click Execute. The directory should be protected with highly restrictive access control lists (ACLs).

This is where you'll create the file specified in the next step. Identify an NTFS directory in which to create the backup of the key. Obtain a removable backup medium for storing a copy of the backed-up key.

This password is subject to complexity checks. In SQL Server Management Studio, connect to the SQL Server instance containing the database master key you wish to back up.Ĭhoose a password that will be used to encrypt the database master key on the backup medium. Using SQL Server Management Studio with Transact-SQL To back up the database master key Requires CONTROL permission on the database. We recommend that you back up the master key as soon as it's created, and store the backup in a secure, off-site location. But if the master key is encrypted only with a password, it must be explicitly opened. If it's encrypted with the service master key, the master key doesn't have to be explicitly opened. The master key must be open and, therefore, decrypted before it's backed up. Before you begin Limitations and restrictions For this reason, you should back up the database master key and store the backup in a secure off-site location. If it's deleted or corrupted, SQL Server may be unable to decrypt those keys, and the data encrypted using them will be effectively lost. The database master key is used to encrypt other keys and certificates inside a database. This topic describes how to back up a database master key in SQL Server by using Transact-SQL.
