ALTER DATABASE

ALTER DATABASE — change the behavior of the database

Syntax

ALTER DATABASE alter_database_command

Where alter_database_command can be one or more of the following:

CHANGE ENCRYPTION TYPE <encryption_type>

FLUSH QUERY PERFORMANCE METRICS

RUN GARBAGE COLLECTION <target_size>

Where encryption_type is NONE, AES128, or AES256, and target_size is the desired amount of used memory (in bytes).

Description

Use ALTER DATABASE to change the operation of the database.

The ALTER DATABASE command affects all SMs and TEs in the database.

Modifying the Storage Encryption Type

ALTER DATABASE CHANGE ENCRYPTION TYPE <encryption_type>

Where encryption_type can be one of the following:

Encryption Type Description

NONE

No storage encryption is enabled on the database

AES128

Storage is encrypted with the AES-128 cipher

AES256

Storage is encrypted with the AES-256 cipher

The current storage encryption type of the database can be determined by querying the DISK_ENCRYPTION column in the SYSTEM.NODES table.

If the DISK_ENCRYPTION column contains a percent complete, the SM is in the process of changing the encryption type of its storage.

Write aggregated statement metrics to the log

ALTER DATABASE FLUSH QUERY PERFORMANCE METRICS

FLUSH QUERY PERFORMANCE METRICS aggregates the statement metrics from each TE in the database, clears stored metrics from each TE, and writes (flushes) the top n aggregated metrics that took the most time to execute, to the log. The default value of n is 10. n is configurable using the stmt-metrics-log-count database option. The metrics are logged in the sql-statement-metrics logging category at the warn logging level.

Request Garbage Collection

ALTER DATABASE RUN GARBAGE COLLECTION <target_size>

The RUN GARBAGE COLLECTION command is used to request that each SM and TE in the database perform one round of flushing cached data from memory. This process will stop either when the target_size memory usage is reached, or when all unused data has been released. This command will not force memory that is in use by the database to be released. It is best to allow each process to perform its own memory management: users should not need this command under normal circumstances.

Flushing cached data from memory can significantly impact the performance of the database, until the caches are re-populated. This command may be suggested by NuoDB Support in specific situations.