By configuring database parameters, you can flexibly adjust the behavior of database instances, including but not limited to cache size, number of connections, resource utilization, and storage paths for various types of files.
Parameter scope
Database parameters are divided into two levels with different scopes of effect:
GLOBAL level:
Function: It takes effect only on the current node and will not be automatically synchronized to other nodes in the cluster.
Characteristics: After a node restart, GLOBAL modifications become invalid. After modification, the changes take effect only for new sessions established on this node; existing sessions must reconnect to apply the new values.
SESSION level:
Function: It affects only the current established single session (connection). When a client connects, it automatically inherits the current global parameter values as the initial session values.
Characteristics: Modifications are only effective for the current session and become invalid after the session ends.
Query database parameters
You can query parameters in the following two ways:
Method 1:
1.2 On the Instance List page, select the required instance ID.
1.3 Enter the Parameter Settings > Database Parameters page and search and view computing engine parameters.
Method 2: Query via SQL commands. Use the SHOW VARIABLES statement to perform queries. By default, it returns parameter values at the current session (SESSION) level. To query global (GLOBAL) settings, add the GLOBAL keyword.
SHOW VARIABLES LIKE 'auto_increment_increment';
SHOW GLOBAL VARIABLES LIKE 'auto_increment_increment';
Modify Database Parameters
2. On the Instance List page, select the required instance ID.
3. Go to the Parameter Settings > Database Parameters page, search for database parameters, and in the Current Value column, click the icon to modify the parameter. 4. (Optional) If the parameter takes effect after a restart, restart the instance if it is required by your business needs.