Hi @CharlieLor ,
This is because you will not be able to restore database until you get the Certificate, the Private key and the password.
You need create a master key:
USE master;
GO
CREATE MASTER KEY ENCRYPTION BY PASSWORD = '<UseStrongPasswordHere>';
Create or obtain a certificate protected by the master key:
CREATE CERTIFICATE MyServerCert WITH SUBJECT = 'My DEK Certificate';
And then back up the certificate and its associated private key:
BACKUP CERTIFICATE MyServerCert TO FILE = 'D:\MyServerCert.cer'
WITH PRIVATE KEY(FILE = 'D:\MyServerCert.prvk',
ENCRYPTION BY PASSWORD = 'StrongPassword'
)
Protect your database by using the certificate.
After completing these operations above, you will have no problem with these operations.
For more information you can refer to the official documentation:
https://learn.microsoft.com/en-us/sql/relational-databases/security/encryption/transparent-data-encryption?view=sql-server-ver15