TDE ENCRYPTION

  • I'm having trouble with TDE.

    I used the following code a few weeks ago and I don't remember the errors that I got.

    USE MASTER

    GO

    CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'Encrypt01!@'

    CREATE CERTIFICATE CERT05 WITH SUBJECT = 'Cert4u12!@'

    USE Adventureworks2012

    CREATE DATABASE ENCRYPTION KEY

    WITH ALGORITHM = AES_256 -- Error

    ENCRYPTION BY SERVER CERTIFICATE TDECert

    USE MASTER

    ALTER Database Adventureworks2012 SET ENCRYPTION ON

    SELECT db_name(database_id), encryption_state, percent_complete, key_algorithm, key_length

    FROM sys.dm_database_encryption_keys

    -- SELECT * FROM sys.certificates

    -------------------------------------------------------------------------------------------

    -- Set Encryption off

    ALTER DATABASE Adventureworks2012 SET ENCRYPTION OFF

    -- Warning: The certificate used for encrypting the database encryption key has not been backed up. You should immediately back up the certificate and the private key associated with the certificate.

    -- If the certificate ever becomes unavailable or if you must restore or attach the database on another server, you must have backups of both the certificate and the private key or you

    -- will not be able to open the database.

    .

    How do I drop everything and start over?

    How to you backup the certificate?

    What am I doing wrong?

    Thanks.

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • he problem was solved.

    I had to DROP the following:

    drop database encryption key

    drop certificate TDECert

    drop master key

    Then I performed the following:

    BACKUP SERVICE MASTER KEY TO FILE = 'C:\Temp\service_master_ key'

    ENCRYPTION BY PASSWORD = '3dH85Hhk003GHk2597gheij4';

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply