For encrypting database we need to do this few steps:
- Create master key on master database :
1 | create master key encryption by password = 'testPassword'
|
- Create a server certificate derived from database master key :
1 | create certificate test_cert with subject = 'test_cert'
|
- Use our database and create database encryption key by our server certificate:
1
2 | create database encryption key with algorithm = AES_256
encryption by server certificate test_cert
|
- Set encryption on on database level:
1 | alter database test set encryption on
|
There are few restrictions and possible problems with encrypted databases :
- If you don't backup our master key, certificate and encryption key it will not possible to restore or move our database to another server
- Encrypted database have performance overhead
No comments:
Post a Comment