You can modify tenant-level parameters by using SQL statements. You can set tenant-level parameters for the sys tenant or user tenants. Tenant-level parameters configured for the sys tenant apply to the sys tenant and other tenants. Tenant parameters configured for a user tenant apply only to this user tenant.
Modify tenant-level parameters in MySQL mode
In MySQL mode, execute the following statement to set tenant-level parameters:
ALTER SYSTEM [SET] parameter_name = expression [SCOPE = {MEMORY | SPFILE | BOTH}]
[COMMENT [=] 'text']
[SERVER [=] 'ip:port' | ZONE [=] 'zone']
[TENANT=all|TENANT_NAME];
Notes:
expression: specifies the value of the modified parameter.SCOPE: specifies the effective scope of the parameter. Default value:BOTH. Parameters:MEMORY: indicates that only parameters in the memory can be modified, and the modification takes effect immediately. The modification becomes invalid after the server is restarted. However, no parameter supports this modification.SPFILE: indicates that only parameters in the configuration table can be modified. The modification takes effect after the server is restarted.BOTH: indicates that parameters can be modified in both the configuration table and the memory. The modification takes effect immediately and remains effective after the server is restarted.
SERVER: the server to be modified in the specified tenant.ZONE: the zone to be modified in the specified tenant.ALTER SYSTEMallows you to specify a zone or server, not both. You can specify only one zone or server at a time.If you do not specify a zone or server when you modify a tenant-level parameter, the modification takes effect for all zones and servers in the tenant.
The
TENANT=all | TENANT_NAMEclause is used only by the sys tenant to modify the parameters of other tenants or all tenants.
Sample code:
Set a parameter of the
mytenanttenant from the sys tenant.obclient> ALTER SYSTEM SET log_disk_utilization_threshold = 20 TENANT='mytenant';Set a parameter of the sys tenant from the system.
obclient> ALTER SYSTEM SET log_disk_utilization_threshold = 20;Set a parameter of a user tenant as the administrator of the user tenant.
obclient> ALTER SYSTEM SET log_disk_utilization_threshold = 20 SCOPE=SPFILE; obclient> ALTER SYSTEM SET log_disk_utilization_threshold = 20; obclient> ALTER SYSTEM SET log_disk_utilization_threshold = 20 SERVER='xx.xx.xx.xx:2882'; obclient> ALTER SYSTEM SET log_disk_utilization_threshold = 20 ZONE='z1';
Modify tenant-level parameters in Oracle mode
In Oracle mode, use the following syntax to set tenant-level parameters:
ALTER SYSTEM SET parameter_name = expression;
Sample code:
Set the parameter of a tenant after you log on as the administrator of the tenant.
obclient> ALTER SYSTEM SET log_disk_utilization_threshold = 20;