This topic describes the general system parameters and variables in OceanBase Database.
Cluster parameters
memory_limit: specifies the maximum memory available in OceanBase Database. The value ofmemory_limitis unlimited. Ifmemory_limitis set to a value greater than the total physical memory, other values calculated based onmemory_limitwill be excessively large.Default value:
0MValue range: [0M, +∞)
Example:
obclient> ALTER SYSTEM SET memory_limit='50G';
system_memory: specifies the size of the system memory space reserved for thesys500tenant.Default value:
30GValue range: [0M, +∞)
Example:
obclient> ALTER SYSTEM SET system_memory='30G';
memstore_limit_percentage: specifies the percentage of the memory occupied by the MemStore among the total available memory of a tenant.Default value:
50Value range: (0, 100)
Example:
obclient> ALTER SYSTEM memstore_limit_percentage=50;
trace_log_slow_query_watermark: specifies the query execution time threshold. A query whose execution time exceeds this threshold is considered a slow query. Trace logs of slow queries are written to system logs.Default value:
100msValue range: [1ms, +∞)
Example:
obclient> ALTER SYSTEM trace_log_slow_query_watermark='100ms';
enable_syslog_recycle: specifies whether to enable system log recycling.Default value:
FalseValid values:
TrueandFalseExample:
obclient> ALTER SYSTEM enable_syslog_recycle=False;
max_syslog_file_count: specifies the maximum number of log files that can be retained.Default value:
0Value range: [0, +∞)
Example:
obclient> ALTER SYSTEM max_syslog_file_count=0;
enable_sql_audit: specifies whether to enable SQL Audit.Default value:
TrueValid values:
TrueandFalseExample:
obclient> ALTER SYSTEM enable_sql_audit=True;
datafile_disk_percentage: specifies the percentage of occupied space of the disk where thedata_dirdirectory resides. The disk of thedata_dirdirectory will be initialized by OceanBase Database to store data.Default value:
0Value range: [0, 99]
Example:
obclient> ALTER SYSTEM datafile_disk_percentage=90;
enable_rebalance: specifies whether to enable automatic load balancing. In the sys tenant, it specifies whether to enable load balancing across tenants, and in a user tenant, it specifies whether to enable load balancing within the tenant.Default value:
TrueValid values:
TrueandFalseExample:
obclient> ALTER SYSTEM enable_rebalance=True;
resource_hard_limit: specifies how resource units are allocated.Default value:
100Value range: (0, 10000]
Example:
obclient> ALTER SYSTEM resource_hard_limit=100;
stack_size: specifies the size of the function call stack for programs.Default value:
512KValue range: [512K, 20M]
Example:
obclient> ALTER SYSTEM stack_size='1M';
syslog_level: specifies the level of system logs to be printed.Default value:
INFOValid values:
DEBUG,TRACE,INFO,WARN,USER_ERR,ERROR, andPERF.Example:
obclient> ALTER SYSTEM syslog_level=INFO;
Tenant parameters
freeze_trigger_percentage: specifies the threshold of memory used by tenants for triggering a global freeze.Default value:
20Value range: (0, 100)
Example:
obclient> ALTER SYSTEM freeze_trigger_percentage=20;
major_compact_trigger: specifies the number of minor compactions for triggering a global major compaction.Default value:
0Value range: [0, 65535]
Example:
obclient> ALTER SYSTEM major_compact_trigger=5;
cpu_quota_concurrency: specifies the maximum concurrency allowed for each CPU quota of a tenant.Default value:
4Value range: [1, 20]
Example:
obclient> ALTER SYSTEM cpu_quota_concurrency=4;
writing_throttling_trigger_percentage: specifies the upper limit of the write speed. If the value of this parameter is set to100, write throttling is disabled.Default value:
100Value range: [0, 100]
Example:
obclient> ALTER SYSTEM SET writing_throttling_trigger_percentage=100;
audit_trail: specifies whether to enable database auditing.Default value:
NONEValid values:
NONE
OS
DB
DB, EXTENDED
DB_EXTENDED
Example:
obclient> ALTER SYSTEM SET audit_trail=NONE;
undo_retention: specifies the time range in seconds of data versions to be retained by the system. This variable is used to control the collection of data of multiple versions in minor compactions.Default value:
1800Value range: [0, 4294967295]
Example:
obclient> ALTER SYSTEM SET undo_retention=1800;
System variables
recyclebin: specifies whether to enable the recycle bin.Default value:
OFFValid values:
1orON0orOFF
Example:
obclient> SET GLOBAL recyclebin=OFF;or
obclient> SET GLOBAL recyclebin=0;
ob_query_timeout: specifies the query timeout duration in microseconds.Default value:
10000000Value range: N/A
Example:
obclient> SET GLOBAL ob_query_timeout=10000000;
ob_trx_idle_timeout: specifies the idle timeout duration in microseconds in which no transactions are executed. A timeout occurs when the execution interval between two statements exceeds the value of this parameter.Default value:
86400000000Value range: [100000000, +∞)
Example:
obclient> SET GLOBAL ob_trx_idle_timeout=86400000000;
ob_trx_timeout: specifies the transaction timeout duration in microseconds.Default value:
86400000000Value range: N/A
Example:
obclient> SET GLOBAL ob_trx_timeout=86400000000;
ob_read_consistency: specifies the read consistency level.Default value:
STRONGValid values:
0: An empty string
1: FROZEN
2: WEAK
3: STRONG
Example:
obclient> SET GLOBAL ob_read_consistency=STRONG;or
obclient> SET GLOBAL ob_read_consistency=3;
ob_sql_work_area_percentage: specifies the maximum percentage of tenant memory for SQL execution.Default value:
5Value range: [0, 100]
Example:
obclient> SET GLOBAL ob_sql_work_area_percentage=5;
parallel_servers_target: specifies the queue condition for parallel queries on each server. When the number of threads taken by parallel eXecution (PX) of multiple SQL queries exceeds the specified queue condition, subsequent SQL queries for PX must wait in a queue.Default value:
0Value range: [0, 9223372036854775807]
Example:
obclient> SET GLOBAL parallel_servers_target=0;
max_allowed_packet: specifies the maximum size in bytes of a network packet.Default value:
4194304Value range: [1024, 1073741824]
Example:
obclient> SET GLOBAL max_allowed_packet=4194304;
nls_date_format: specifies the format of converting a date value to a string and the format of implicitly converting a string to a date value.Note
This parameter applies only to the Oracle mode.
Default value:
DD-MON-RRValue range: N/A
Example:
obclient> SET GLOBAL nls_date_format='DD-MON-RR';
autocommit: specifies whether to automatically commit transactions.Default value:
ONValid values:
1orON0orOFF
Example:
obclient> SET GLOBAL autocommit=ON;or
obclient> SET GLOBAL autocommit=1;
ob_enable_plan_cache: specifies whether to enable the plan cache.Default value:
ONValid values:
1orON0orOFF
Example:
obclient> SET GLOBAL ob_enable_plan_cache=ON;or
obclient> SET GLOBAL ob_enable_plan_cache=1;
ob_plan_cache_percentage: specifies the percentage of the tenant memory that can be used by the plan cache.Default value:
5Value range: [0, 100]
Example:
obclient> SET GLOBAL ob_plan_cache_percentage=5;
ob_sql_audit_percentage: specifies the maximum percentage of the SQL audit memory to the total memory of the current tenant.Default value:
3Value range: [0, 80]
Example:
obclient> SET GLOBAL ob_sql_audit_percentage=3;
ob_enable_sql_audit: specifies whether to enable SQL auditing for the current tenant. When the parameter is set toFalse, SQL audit is disabled for all tenants.Default value:
TrueValid values:
TrueandFalseExample:
obclient> SET GLOBAL ob_enable_sql_audit=True;
transaction_isolation: specifies the isolation level of transactions.Default value:
READ-COMMITTEDValid values:
READ-UNCOMMITTED,READ-COMMITTED,REPEATABLE-READ, andSERIALIZABLEExample:
obclient> SET GLOBAL transaction_isolation='READ-COMMITTED';
validate_password_check_user_name: specifies whether the user account password can be the same as the username. When the value isON, the password cannot be the same as the username. When the value isOFF, the password can be the same as the username.Default value:
OFFValid values:
ONandOFFExample:
obclient> SET GLOBAL validate_password_check_user_name=ON;
validate_password_length: specifies the minimum length of a user account password.Default value:
0Value range: [0, 2147483647]
Example:
obclient> SET GLOBAL validate_password_length=0;
validate_password_mixed_case_count: specifies the minimum number of uppercase letters and the minimum number of lowercase letters that a user account password must contain.Default value:
0Value range: [0, 2147483647]
Example:
obclient> SET GLOBAL validate_password_mixed_case_count=0;
validate_password_number_count: specifies the minimum number of digits that a user account password must contain.Default value:
0Value range: [0, 2147483647]
Example:
obclient> SET GLOBAL validate_password_number_count=0;
validate_password_policy: specifies the password check strategy. The valueLOWindicates to implement only general password checks. The valueMEDIUMindicates to check the password length, the number of uppercase letters, lowercase letters, digits, special characters, and the password resemblance to the username.Default value:
LOWValid values:
LOWandMEDIUMExample:
obclient> SET GLOBAL validate_password_policy=LOW;
validate_password_special_char_count: specifies the minimum number of special characters that a user account password must contain.Default value:
0Value range: [0, 2147483647]
Example:
obclient> SET GLOBAL validate_password_special_char_count=0;
resource_manager_plan: specifies whether to activate the resource management plan. The CPU quota for limiting the user activities in a resource group varies based on the resource management plan.Common threads and parallel threads within a tenant tend to preempt CPU resources from each other. Specifying a resource isolation plan for the tenant can control the resource preemption strategy and limit the resource usage.
Default value: ""
Value range: N/A
Example:
Create multiple resource management plans for each tenant, such as DAYTIME and NIGHT. Then, you can activate different plans for different periods or application scenarios to maximize system performance.
delimiter// # Define the DAYTIME resource management plan begin DBMS_RESOURCE_MANAGER.CREATE_PLAN( PLAN => 'DAYTIME'); end; // begin DBMS_RESOURCE_MANAGER.CREATE_PLAN_DIRECTIVE( PLAN => 'DAYTIME', GROUP_OR_SUBPLAN => 'interactive_group' , COMMENT => 'Prioritize transaction processing (TP)', MGMT_P1 => 30); end; // begin DBMS_RESOURCE_MANAGER.CREATE_PLAN_DIRECTIVE( PLAN => 'DAYTIME', GROUP_OR_SUBPLAN => 'batch_group' , COMMENT => 'Allocate no more than 40% of CPU resources for analytical processing (AP), even with zero TP load.', MGMT_P1 => 20, UTILIZATION_LIMIT => 40); end; // # Define the NIGHT resource management plan begin DBMS_RESOURCE_MANAGER.CREATE_PLAN( PLAN => 'NIGHT'); end; // begin DBMS_RESOURCE_MANAGER.CREATE_PLAN_DIRECTIVE( PLAN => 'NIGHT', GROUP_OR_SUBPLAN => 'interactive_group' , COMMENT => 'Minimize resources for TP', MGMT_P1 => 10); end; // begin DBMS_RESOURCE_MANAGER.CREATE_PLAN_DIRECTIVE( PLAN => 'NIGHT', GROUP_OR_SUBPLAN => 'batch_group' , COMMENT => 'Allocate no more than 90% of CPU resources for AP, even with zero TP load.', MGMT_P1 => 90, UTILIZATION_LIMIT => 90); end; // # Letters in the username are automatically capitalized. To use lowercase letters, enclose the username in quotation marks. For example, specify it in the '"test001"' format. BEGIN DBMS_RESOURCE_MANAGER.SET_CONSUMER_GROUP_MAPPING (DBMS_RESOURCE_MANAGER.ORACLE_USER, 'test001', 'batch_group'); END;// select * from DBA_RSRC_GROUP_MAPPINGS;// # Execute the following statement to activate the DAYTIME plan for the daytime to prioritize TP tasks: SET GLOBAL resource_manager_plan='DAYTIME'; /MySQL mode ALTER SYSTEM SET resource_manager_plan = 'DAYTIME'; /Oracle mode # Execute the following statement to activate the NIGHT plan for the night time to prioritize batch/AP tasks: SET GLOBAL resource_manager_plan='NIGHT'; /MySQL mode ALTER SYSTEM SET resource_manager_plan = 'NIGHT'; /Oracle mode # Disable all resource plans and limits. SET GLOBAL resource_manager_plan=''; //MySQL mode ALTER SYSTEM SET resource_manager_plan = ''; /Oracle mode