Find answers to your technical questions and learn how to use our products
Search suggestions:
Find answers to your technical questions and learn how to use our products
Search suggestions:
USE MASTER
GO
CREATE MASTER KEY ENCRYPTION BY PASSWORD = '<enter strong password>'
GO
CREATE CERTIFICATE <name of new EDM certificate>
WITH SUBJECT = '<enter any subject e.g. CSEDM TDE Certificate for the EDM Availability Group>'
USE MASTER
GO
BACKUP CERTIFICATE <name of new EDM certificate>
TO FILE = '<enter file location, for example C:><name of new EDM certificate>_File.cer'
WITH PRIVATE KEY (FILE = '<enter file location, for example C:><name of new EDM certificate>_Key.pvk' ,
ENCRYPTION BY PASSWORD = '<enter strong password>' )
GO
USE MASTER
GO
CREATE MASTER KEY ENCRYPTION BY PASSWORD = '<strong password>'
GO
USE MASTER
GO
CREATE CERTIFICATE <name of new EDM certificate as used on the Primary SQL Server>
FROM FILE = '<enter file location, for example C:><name of new EDM certificate as used on the Primary SQL Server>.cer'
WITH PRIVATE KEY (FILE = '<enter file location, for example C:><name of new EDM certificate as used on the Primary SQL Server>.pvk',
DECRYPTION BY PASSWORD = '<strong password (same password used to encrypt the private key on the Primary SQL Server>' );
USE <name of EDM DB>
GO
CREATE DATABASE ENCRYPTION KEY
WITH ALGORITHM = AES_256
ENCRYPTION BY SERVER CERTIFICATE <name of new EDM certificate>
GO
ALTER DATABASE <name of EDM DB>
SET ENCRYPTION ON
SELECT
db.name,
db.is_encrypted,
dm.encryption_state,
dm.percent_complete,
dm.key_algorithm,
dm.key_length
FROM sys.databases db
LEFT OUTER JOIN sys.dm_database_encryption_keys dm
ON db.database_id = dm.database_id;