# Information Schema INNODB\_TABLESPACES\_ENCRYPTION Table

The [Information Schema](/docs/server/reference/system-tables/information-schema.md) `INNODB_TABLESPACES_ENCRYPTION` table contains metadata about [encrypted InnoDB tablespaces](/docs/server/security/encryption/data-at-rest-encryption/innodb-encryption/innodb-encryption-overview.md). When you [enable encryption for an InnoDB tablespace](/docs/server/security/encryption/data-at-rest-encryption/innodb-encryption/innodb-encryption-overview.md), an entry for the tablespace is added to this table. If you later [disable encryption for the InnoDB tablespace](/docs/server/security/encryption/data-at-rest-encryption/innodb-encryption/innodb-encryption-overview.md), then the row still remains in this table, but the `ENCRYPTION_SCHEME` and `CURRENT_KEY_VERSION` columns will be set to `0`.

Viewing this table requires the [PROCESS](/docs/server/reference/sql-statements/account-management-sql-statements/grant.md#global-privileges) privilege. It contains the following columns:

| Column                           | Description                                                                                                                                                                                                                                                                                      |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| SPACE                            | InnoDB tablespace ID.                                                                                                                                                                                                                                                                            |
| NAME                             | Path to the InnoDB tablespace file, without the extension.                                                                                                                                                                                                                                       |
| ENCRYPTION\_SCHEME               | Key derivation algorithm. Only 1 is currently used to represent an algorithm. If this value is 0, then the tablespace is unencrypted.                                                                                                                                                            |
| KEYSERVER\_REQUESTS              | Number of times InnoDB has had to request a key from the [encryption key management plugin](/docs/server/security/encryption/data-at-rest-encryption/key-management-and-encryption-plugins/encryption-key-management.md). The three most recent keys are cached internally.                      |
| MIN\_KEY\_VERSION                | Minimum key version used to encrypt a page in the tablespace. Different pages may be encrypted with different key versions.                                                                                                                                                                      |
| CURRENT\_KEY\_VERSION            | Key version that will be used to encrypt pages. If this value is 0, then the tablespace is unencrypted.                                                                                                                                                                                          |
| KEY\_ROTATION\_PAGE\_NUMBER      | Page that a [background encryption thread](/docs/server/security/encryption/data-at-rest-encryption/innodb-encryption/innodb-encryption-overview.md) is currently rotating. If key rotation is not enabled, then the value will be NULL.                                                         |
| KEY\_ROTATION\_MAX\_PAGE\_NUMBER | When a [background encryption thread](/docs/server/security/encryption/data-at-rest-encryption/innodb-encryption/innodb-encryption-overview.md) starts rotating a tablespace, the field contains its current size. If key rotation is not enabled, then the value will be NULL.                  |
| CURRENT\_KEY\_ID                 | Key ID for the encryption key currently in use.                                                                                                                                                                                                                                                  |
| ROTATING\_OR\_FLUSHING           | Current key rotation status. If this value is 1, then the [background encryption threads](/docs/server/security/encryption/data-at-rest-encryption/innodb-encryption/innodb-encryption-overview.md) are working on the tablespace. See [MDEV-11738](https://jira.mariadb.org/browse/MDEV-11738). |

When the [InnoDB system tablespace](/docs/server/server-usage/storage-engines/innodb/innodb-tablespaces/innodb-system-tablespaces.md) is encrypted, it is represented in this table with the special name: `innodb_system`.

## Example

```sql
SELECT * FROM information_schema.INNODB_TABLESPACES_ENCRYPTION 
WHERE NAME LIKE 'db_encrypt%';
+-------+----------------------------------------------+-------------------+--------------------+-----------------+---------------------+--------------------------+------------------------------+
| SPACE | NAME                                         | ENCRYPTION_SCHEME | KEYSERVER_REQUESTS | MIN_KEY_VERSION | CURRENT_KEY_VERSION | KEY_ROTATION_PAGE_NUMBER | KEY_ROTATION_MAX_PAGE_NUMBER |
+-------+----------------------------------------------+-------------------+--------------------+-----------------+---------------------+--------------------------+------------------------------+
|    18 | db_encrypt/t_encrypted_existing_key          |                 1 |                  1 |               1 |                   1 |                     NULL |                         NULL |
|    19 | db_encrypt/t_not_encrypted_existing_key      |                 1 |                  0 |               1 |                   1 |                     NULL |                         NULL |
|    20 | db_encrypt/t_not_encrypted_non_existing_key  |                 1 |                  0 |      4294967295 |          4294967295 |                     NULL |                         NULL |
|    21 | db_encrypt/t_default_encryption_existing_key |                 1 |                  1 |               1 |                   1 |                     NULL |                         NULL |
|    22 | db_encrypt/t_encrypted_default_key           |                 1 |                  1 |               1 |                   1 |                     NULL |                         NULL |
|    23 | db_encrypt/t_not_encrypted_default_key       |                 1 |                  0 |               1 |                   1 |                     NULL |                         NULL |
|    24 | db_encrypt/t_defaults                        |                 1 |                  1 |               1 |                   1 |                     NULL |                         NULL |
+-------+----------------------------------------------+-------------------+--------------------+-----------------+---------------------+--------------------------+------------------------------+
7 rows in set (0.00 sec)
```

## See Also

* [Encrypting Data for InnoDB / XtraDB](/docs/server/security/encryption/data-at-rest-encryption/innodb-encryption/innodb-encryption-overview.md)
* [Data at Rest Encryption](broken://pages/oH1AAxPLSc6Wq96yMJ2N)
* [Why Encrypt MariaDB Data?](broken://pages/xxDIEtn1OCmLfs6uAlFR)
* [Encryption Key Management](/docs/server/security/encryption/data-at-rest-encryption/key-management-and-encryption-plugins/encryption-key-management.md)

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/reference/system-tables/information-schema/information-schema-tables/information-schema-innodb-tables/information-schema-innodb_tablespaces_encryption-table.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
