The SET_SYSTEM_STATS procedure is used to set system statistics.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only MySQL mode.
Syntax
DBMS_STATS.SET_SYSTEM_STATS (
pname VARCHAR2,
pvalue NUMBER);
Parameters
| Parameter | Description |
|---|---|
| pname | The parameter name. Valid values: cpu_speed, disk_seq_read_speed, disk_rnd_read_speed, and network_speed. |
| pvalue | The value of the parameter. |
Exceptions
| Error code | Description |
|---|---|
| ORA-20001 | The name of the system statistics is invalid. |
Considerations
To execute this procedure, you must have the SYSDBA privilege or be the SYS user.
Examples
Here is an example of using the DBMS_STATS.SET_SYSTEM_STATS procedure to set system statistics. In this example, we set the system statistics parameter named cpu_speed. The pvalue is set to 5000, which should be based on actual measurements or estimates and represents the number of CPU cycles that can be executed per second in the current hardware environment.
BEGIN
-- Set the CPU speed to 5000. The value 5000 is illustrative and represents CPU speed in some unit of measurement.
DBMS_STATS.SET_SYSTEM_STATS('cpu_speed', 5000);
END;
/
If you want to set the sequential read speed of the disk (disk_seq_read_speed), you can execute the following call:
BEGIN
-- Set the disk sequential read speed to 200. The value 200 is illustrative and represents disk speed in some unit of measurement.
DBMS_STATS.SET_SYSTEM_STATS('disk_seq_read_speed', 200);
END;
/