onmode and p arguments: Add or remove virtual processors (SQL administration API)

Use the onmode and p arguments with the admin() or task() function to dynamically add or remove virtual processors for the current database server session. This function does not update the onconfig file.

Syntax


1  EXECUTE FUNCTION
1 admin
1 task
2  (
2  "onmode"  ,  "p" ,
1  "number" ,
2.1 "aio"
2.1 "bts"
2.1 "cpu"
2.1 "encrypt"
2.1 "jvp"
2.1 "lio"
2.1 "po"
2.1 "shm"
2.1 "soc"
2.1 "tli"
2.1 "vpclass"
1 (1) "-number" ,
2.1 "bts"
2.1 "cpu"
2.1 "encrypt"
2.1 "jvp"
2.1 "vpclass"
3  ) ;
Notes:
  • 1 UNIX™ only
Element Description Key Considerations
number The number of virtual processors to add or to remove. A positive number adds virtual processors. The maximum number of virtual processors you can add depends on the operating system.

UNIX: A negative number removes virtual processors. The number of virtual processors to drop cannot exceed the actual number of processors of the specified type.

vpclass The name of a user-defined virtual processor class.

Windows™: The number argument must be set to 1 because you can only create one instance of a user-defined virtual processor.

Usage

You can use this function only when the database server is in online mode.

The number of CPU VPs should not exceed the number of physical processors on your system, but no error is issued if they do. The database server uses the number of CPU VPs to allocate resources for parallel database queries (PDQ). If you drop CPU VPs, your queries might run significantly slower. After you change the number of CPU VPs, the Reinit field in the output from the onstat -g mgm command shows how many queries are waiting for other queries to complete.

See the HCL OneDB™ Performance Guide for more information about performance implications of the CPU VP class.

For a description of each virtual processor class, see the HCL OneDB Administrator's Guide.

This function is equivalent to the onmode -p command.

Example

The following example adds one CPU virtual processor:
EXECUTE FUNCTION task("onmode","p","1","cpu");
The following example removes one Java™ virtual processor:
EXECUTE FUNCTION task("onmode","p","-1","jvp");