FirebirdSQL logo

Encrypting a Database

Encrypts the database using the specified encryption plugin

Syntax
ALTER {DATABASE | SCHEMA}
  ENCRYPT WITH plugin_name [KEY key_name]
Table 1. ALTER DATABASE ENCRYPT Statement Parameters
Parameter Description

plugin_name

The name of the encryption plugin

key_name

The name of the encryption key

Encryption starts immediately after this statement completes, and will be performed in the background.Normal operations of the database are not disturbed during encryption.

The optional KEY clause specifies the name of the key for the encryption plugin.The plugin decides what to do with this key name.

Note

The encryption process can be monitored using the MON$CRYPT_PAGE field in the MON$DATABASE virtual table, or viewed in the database header page using gstat -e.gstat -h will also provide limited information about the encryption status.

For example, the following query will display the progress of the encryption process as a percentage.

select MON$CRYPT_PAGE * 100 / MON$PAGES
  from MON$DATABASE;
Note

SCHEMA is currently a synonym for DATABASE;this may change in a future version, so we recommend to always use DATABASE

Decrypting a Database

Decrypts the database using the configured plugin and key

Syntax
ALTER {DATABASE | SCHEMA} DECRYPT

Decryption starts immediately after this statement completes, and will be performed in the background.Normal operations of the database are not disturbed during decryption.

Note

SCHEMA is currently a synonym for DATABASE;this may change in a future version, so we recommend to always use DATABASE