Share via

Column Level Encryption with High Availability Group

Anonymous
2024-03-07T01:01:04.0633333+00:00

We use SQL 2017 enterprise to setup high availability group with one AG contains 28 databases. Recently, on primary server, column level encryption is implemented on two databases. Symmetric key is created at DB1 as

CREATE SYMMETRIC KEY JanainaKey09 WITH ALGORITHM = AES_256 ENCRYPTION BY CERTIFICATE Shipping04;

Symmetric Key is created at DB2 with more option as

CREATE SYMMETRIC KEY #MarketingXXV WITH ALGORITHM = AES_128, KEY_SOURCE = 'The square of the hypotenuse is equal to the sum of the squares of the sides', IDENTITY_VALUE = 'Pythagoras' ENCRYPTION BY CERTIFICATE Marketing25;

After failover to the Secondary server, data can't be decrypted. It returns NULL instead of plain value. Restore the Service Master Key from Primary Server. The data still can't be decrypted. How to solve this issue?

SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories


1 answer

Sort by: Most helpful
  1. Erland Sommarskog 134.7K Reputation points MVP Volunteer Moderator
    2024-03-07T22:42:10.8966667+00:00

    So didn't I post an example to get this working in response to a previous questions of yours a month or two ago? I would suggest that you find that post, and set up an AG and implement encryption as I suggested in your post, so that you learn the process.

    I would guess that you have managed to mess something up, but what is hard to say on a distance.

    Was this answer helpful?

    0 comments No comments

Your answer

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