All Products
Search
Document Center

Lindorm:ALTER SYSTEM

Last Updated:Jul 15, 2024

You can use the ALTER SYSTEM syntax to modify dynamic system parameters.

Applicable engines and versions

The ALTER SYSTEM syntax is applicable to LindormTable and LindormTSDB.

Important

The version of Lindorm SQL must be 2.6.3.2 or later. For more information about how to view the version of Lindorm SQL, see SQL versions.

Syntax

alter_system_statement ::= ALTER SYSTEM SET configuration_identifier = configuration_literal

Parameters

Parameter

Description

configuration_identifier

The name of the dynamic parameter. The parameter name must be a SQL identifier. For more information about the items that can be configured for this parameter, see Supported configuration items.

configuration_literal

The value of the dynamic parameter. The value must be a SQL constant. The following types of constants are supported:

  • Constants of the BIGINT type.

  • Constants of the DOUBLE type.

  • Constants of the BOOLEAN type.

  • Constants of the VARCHAR type.

Supported configuration items

Configuration item

Data type

Applicable engine

Description

FILE_FORMAT_VERSION

Integer

LindormTable

Specifies the number of versions retained for data files in LindormTable. By default, two versions are retained for a data file in LindormTable.

Note

If the Cell Tag is not supported since ldFileVersion is too small=2 error message is returned when you use LindormTable, you can set this parameter to 5 to solve the issue.

SLOW_QUERY_RECORD_ENABLE

Boolean

LindormTable

Specifies whether to enable the slow query view for LindormTable. If this parameter is set to TRUE, the information about the queries whose execution duration exceeds the specified threshold is recorded in the lindorm._slow_query_ view. You can use the information for O&M, inspection, or troubleshooting. Valid values:

  • TRUE

  • FALSE (default)

SLOW_QUERY_TIME_MS

Integer

LindormTable

Specifies the execution duration threshold for slow queries. Queries whose execution duration exceeds the threshold are considered slow queries and are recorded in the lindorm_slow_query view. Unit: millisecond. The default value of this parameter 10000 ms, which equals to 10 seconds.

Note

Only queries sent to the Lindorm server after a new threshold is configured are checked based on the new threshold.

MAX_CONN

Integer

LindormTable

Specifies the maximum number of connections to LindormTable. The value of this parameter must be greater than 0.

Important

This item is available only in LindormTable 2.6.6 and later versions. If you cannot upgrade the LindormTable version of your instance to 2.6.6 or a later version in the console, contact the technical support (DingTalk ID: s0s3eg3).

USER_AUTH

Boolean

LindormTSDB

Specifies whether to enable the user authentication and permission verification feature for LindormTSDB. Valid values:

  • TRUE: Enable the user authentication and permission verification feature. If this feature is enabled, you must provide your username and password when you connect to LindormTSDB. LindormTSDB verifies the user and authenticates the data objects in the SQL statements that are initiated by using the connection.

  • FALSE (default): Do not enable the user authentication and permission verification feature. If this feature is disabled, you can connect to LindormTSDB without the need to provide your username and password.

    Important

    After the user authentication and permission verification feature is enabled for LindormTSDB, user credentials are required for all subsequent requests. If you do not specify user credentials in a request, the request may fail the authentication. You must also specify user credentials when you execute the ALTER SYSTEM statement to enable the user authentication and permission verification feature. After the feature is enabled, some existing services may fail to be accessed. Therefore, we recommend that you carefully plan and fully evaluate the impacts before you enable the feature.

Examples

  • Set the number of versions retained for data files in LindormTable to 5.

    ALTER SYSTEM SET FILE_FORMAT_VERSION = 5;

    Verify the result

    You can execute the SHOW SYSTEM VARIABLES LIKE 'FILE_FORMAT_VERSION'; statement to check whether the parameter is successfully configured.

  • Enable the slow query view for LindormTable and specify the execution duration threshold for slow queries.

    -- Enable the slow query view.
    ALTER SYSTEM SET SLOW_QUERY_RECORD_ENABLE = TRUE; 
    
     
    ALTER SYSTEM SET SLOW_QUERY_TIME_MS = 1000; 

    Verify the result

    You can execute the SHOW SYSTEM VARIABLES LIKE 'SLOW_QUERY_TIME_MS'; statement to check whether the parameter is successfully configured.

  • Set the maximum number of connections to LindormTable to 5,000.

    ALTER SYSTEM SET MAX_CONN = 5000;

    Verify the result

    You can execute the SHOW SYSTEM VARIABLES LIKE 'MAX_CONN'; statement to check whether the parameter is successfully configured.

  • Enable or disable the user authentication and permission verification feature.

    -- Enable the user authentication and permission verification feature.
    ALTER SYSTEM SET USER_AUTH=TRUE; 
    
    -- Disable the user authentication and permission verification feature.
    ALTER SYSTEM SET USER_AUTH=FALSE;