Skip to main content

Reset parameters

After you modify the value of a parameter, you can use the ALTER SYSTEM RESET statement to reset the parameter to its default value as needed.

Procedure

  1. Log in to seekdb.

    The following example shows how to connect to the database. Please replace the actual environment variables with your own.

    mysql -h127.xx.xx.xx -P2881 -uroot -p***** -A
  2. Execute the following command to view the parameter value.

    SHOW PARAMETERS LIKE '%enable_sql_audit%';   

    The query result is as follows:

    +------------------+-----------+-------+---------------------------------------------------------------------------------------------------------------+-------------------+---------------+-----------+
    | name | data_type | value | info | edit_level | default_value | isdefault |
    +------------------+-----------+-------+---------------------------------------------------------------------------------------------------------------+-------------------+---------------+-----------+
    | enable_sql_audit | BOOL | False | specifies whether SQL audit is turned on. The default value is TRUE. Value: TRUE: turned on FALSE: turned off | DYNAMIC_EFFECTIVE | true | 0 |
    +------------------+-----------+-------+---------------------------------------------------------------------------------------------------------------+-------------------+---------------+-----------+
    1 row in set
  3. Execute the following command to reset the parameter value.

    The statement is as follows:

    ALTER SYSTEM RESET
    parameter_name [SCOPE = {SPFILE | BOTH}]

    The following table describes the related parameters.

    • SCOPE specifies the scope of the parameter reset. The default value is BOTH. SPFILE and BOTH are described as follows:

      • SPFILE: specifies to reset only the parameter value in the parameter table. The reset value takes effect only after seekdb is restarted.

      • BOTH: specifies to reset both the parameter value in the parameter table and the memory value. The reset value takes effect immediately and remains effective after seekdb is restarted.

    Example:

    • Reset the parameter value

      ALTER SYSTEM RESET enable_sql_audit;
  4. After the reset is successful, you can use the SHOW PARAMETERS statement to verify whether the parameter value is reset, depending on the actual situation (whether to restart seekdb or not).

    SHOW PARAMETERS LIKE '%enable_sql_audit%';   

    The result is as follows:

    +------------------+-----------+-------+---------------------------------------------------------------------------------------------------------------+-------------------+---------------+-----------+
    | name | data_type | value | info | edit_level | default_value | isdefault |
    +------------------+-----------+-------+---------------------------------------------------------------------------------------------------------------+-------------------+---------------+-----------+
    | enable_sql_audit | BOOL | True | specifies whether SQL audit is turned on. The default value is TRUE. Value: TRUE: turned on FALSE: turned off | DYNAMIC_EFFECTIVE | true | 1 |
    +------------------+-----------+-------+---------------------------------------------------------------------------------------------------------------+-------------------+---------------+-----------+
    1 row in set

References