Transparent Data Encryption (TDE) for Always On Availabilty Group database

Kazi Ariful Haq 161 Reputation points
2021-04-30T21:34:18.313+00:00

Hi,

We have TDE enabled database in one of our production database of SQL server 2017. We need to configure always on set up to secondary server. As per various site I found I have to create master key in secondary replica then need to restore original certificate and private key. After that I have to restore full bakcup and transaction log backup from primary to secondary reply with no-recovery mode. Upto this all are fine. Then I have to run below command to add the database in availability group-

USE master
GO
ALTER AVAILABILITY GROUP [avail_group_name] ADD DATABASE [database_name]

But I get error when I run this command as there is no availability group and I can not alter any availabity group which does not exist. Also let me know what command should I use to add the database in secondary replica.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,492 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. CarrinWu-MSFT 6,891 Reputation points
    2021-05-03T06:24:16.947+00:00

    Hi @Kazi Ariful Haq ,

    Welcome to Microsoft Q&A!

    Could you please use the sys.dm_database_encryption_keys dynamic management view to find the state of database encryption. In TDE, all files and filegroups in a database are encrypted. If any filegroup in a database is marked READ ONLY, the database encryption operation fails, please get more information from this link.
    93271-check.png

    Best regards,
    Carrin


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. CarrinWu-MSFT 6,891 Reputation points
    2021-05-05T03:34:12.69+00:00

    Hi @Kazi Ariful Haq , we have not get a reply from you. Did any answers could help you? If there has an answer helped, please do "Accept Answer". If not, please let us know. By doing so, it will benefit for community members who have this similar issue. Your contribution is highly appreciated. Thank you!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.