Skip to main content

SET_SYSTEM_STATS

The SET_SYSTEM_STATS procedure is used to set system statistics.

Syntax

DBMS_STATS.SET_SYSTEM_STATS (
pname VARCHAR2,
pvalue NUMBER);

Parameters

ParameterDescription
pnameThe name of the parameter. Valid values: cpu_speed, disk_seq_read_speed, disk_rnd_read_speed, and network_speed.
pvalueThe value of the parameter.

Exceptions

Error CodeDescription
HY000The name of the system statistic is incorrect.

Usage Notes

  • To run this procedure, you must connect as the specified user.

Examples

Here is an example of using the DBMS_STATS.SET_SYSTEM_STATS stored procedure to set system statistics. In this example, we set the cpu_speed parameter to 5000. This value should be based on actual measurements or estimates and represents the number of CPU cycles per second in the current hardware environment.

BEGIN
-- Set the CPU speed to 5000. This is a sample value representing CPU speed in a certain unit.
DBMS_STATS.SET_SYSTEM_STATS('cpu_speed', 5000);
END;
/

If you want to set the sequential disk read speed (disk_seq_read_speed), you can execute the following call:

BEGIN
-- Set the sequential disk read speed to 200. This is a sample value representing disk speed in a certain unit.
DBMS_STATS.SET_SYSTEM_STATS('disk_seq_read_speed', 200);
END;
/