The SET_SYSTEM_STATS procedure is used to set system statistics.
Syntax
DBMS_STATS.SET_SYSTEM_STATS (
pname VARCHAR2,
pvalue NUMBER);
Parameters
Parameter |
Description |
|---|---|
| pname | Parameter name. Valid values: cpu_speed, disk_seq_read_speed, disk_rnd_read_speed, and network_speed. |
| pvalue | Prefs value. |
Exceptions
Error Code |
Description |
|---|---|
| HY000 | The system statistics name entered is incorrect. |
Usage instructions
- To run this procedure, you must be connected as the specified user or have the
SYSDBAprivilege.
Examples
The following example shows how to use the DBMS_STATS.SET_SYSTEM_STATS stored 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 number 5000 here is illustrative and represents the CPU speed in a certain unit of measurement.
DBMS_STATS.SET_SYSTEM_STATS('cpu_speed', 5000);
END;
/
If you want to set the sequential read speed of a disk, for example (disk_seq_read_speed), you can execute the following call:
BEGIN
-- Set the sequential read speed of the hard disk to 200. The number 200 here is illustrative and represents the disk speed in a certain unit of measurement.
DBMS_STATS.SET_SYSTEM_STATS('disk_seq_read_speed', 200);
END;
/