Database Research & Development

  • Home
  • NoSQL
    • NoSQL
    • Cassandra
  • Databases
    • Database Theory
    • Database Designing
    • SQL Server Coding Standards
    • SQL Server
    • PostgreSQL
    • MySQL
    • Greenplum
    • Linux
  • Interviews
    • SQL Server Interviews
    • MySQL Interviews
    • SQL Puzzles
  • DBA Scripts
    • SQL Server DBA Scripts
    • PostgreSQL DBA Scripts
    • MySQL DBA Scripts
    • Greenplum DBA Scripts
  • Home
  • Blog Archives !
  • (: Laugh@dbrnd :)
  • Contact Me !
sqlserverinterviews
Home 2016 May SQL Server: How to enable Transparent Data Encryption (TDE) on a Database?

SQL Server: How to enable Transparent Data Encryption (TDE) on a Database?

This article is half-done without your Comment! *** Please share your thoughts via Comment ***

In the previous post, I shared basic details about the Transparent Data Encryption (TDE) of the SQL Server.

Whenever we are encrypting our data or database, we should enable the TDE on a SQL Server Database Level.
After enabling, It will encrypt data files, page files, and backup files of the database.

Below are the necessary steps and T-SQL script to enable TDE on a Database.

Steps:

  • Create a master key.
  • Create or obtain a certificate protected by the master key.
  • Create a database encryption key and protect it with the certificate.
  • Set the database to use encryption.
  •  

    Sample script to enable TDE:

    Create the master key in Master Database:

    1
    2
    3
    4
    USE Master
    GO
    CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'dbrndSecured8*8';
    GO

    Create a certificate:

    1
    2
    CREATE CERTIFICATE SecurityCertificate WITH SUBJECT = 'dbrndSecuredCertificate';
    GO

    Use the database to enable TDE:

    1
    2
    USE Database_Name
    GO

    Associate the certificate to the Database:

    1
    2
    3
    4
    CREATE DATABASE ENCRYPTION KEY
    WITH ALGORITHM = AES_128
    ENCRYPTION BY SERVER CERTIFICATE SecurityCertificate;
    GO

    Enable encryption on the Database:

    1
    2
    3
    ALTER DATABASE Database_Name
    SET ENCRYPTION ON;
    GO

    May 15, 2016Anvesh Patel
    SQL Server: Transparent Data Encryption (TDE) to Encrypt a DatabaseSQL Server: Script to enable Native Backup Compression for all Database Backups
    Comments: 2
    1. Santanu
      April 19, 2018 at 9:32 am

      How do we do same in mysql?

      • Anvesh Patel
        Anvesh Patel
        April 19, 2018 at 10:13 am

        Not sure about exact one, but below are few samples:
        https://www.dbrnd.com/2016/07/mysql-password-encryption-using-the-advanced-encryption-standard-algorithm-aes_encrypt/
        https://www.dbrnd.com/2016/07/mysql-choose-data-type-and-length-of-the-secure-hash-algorithm-sha/

    Anvesh Patel
    Anvesh Patel

    Database Engineer

    May 15, 2016 SQL ServerAnvesh Patel, certificate, database, database research and development, dbrnd, master key, SQL Query, SQL Server, SQL Server Administrator, SQL Server Monitoring, SQL Server Performance Tunning, SQL Server Tips and Tricks, TDE, Transparent Data Encryption, TSQL
    About Me!

    I'm Anvesh Patel, a Database Engineer certified by Oracle and IBM. I'm working as a Database Architect, Database Optimizer, Database Administrator, Database Developer. Providing the best articles and solutions for different problems in the best manner through my blogs is my passion. I have more than six years of experience with various RDBMS products like MSSQL Server, PostgreSQL, MySQL, Greenplum and currently learning and doing research on BIGData and NoSQL technology. -- Hyderabad, India.

    About DBRND !

    dbrnd

    This is a personal blog (www.dbrnd.com).

    Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated.

    Feel free to challenge me, disagree with me, or tell me I’m completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or anonymous comments) - so keep it polite.

    The content of this website is protected by copyright. No portion of this website may be copied or replicated in any form without the written consent of the website owner.

    Recent Comments !
    • Anvesh Patel { Sure will do... } – May 27, 12:43 PM
    • Anvesh Patel { Great... } – May 27, 12:41 PM
    • Anvesh Patel { Great... } – May 27, 12:39 PM
    • Anvesh Patel { Great... } – May 27, 12:36 PM
    • Anvesh Patel { Great... } – May 27, 12:28 PM
    • Anvesh Patel { Great... } – May 27, 12:27 PM
    • Anvesh Patel { Great... } – May 27, 12:16 PM
    • Older »
    Follow Me !
    • facebook
    • linkedin
    • twitter
    • youtube
    • google
    • flickr
    © 2015 – 2019 All rights reserved. Database Research & Development (dbrnd.com)
    Posting....