PL/SQL Documentation server

The procedures and functions needed for administrating the scheduler server are located in the SO_ADMINISTRATOR package.
These procedures are the same used by the scheduler client on the server monitor window and the server parameters window.

The server procedures can only be executed under the installation user.
Back to top 

Server log

All server actions are written to the server log. The log can be queried with the database view SO_VW_SCHEDULER_LOG.
The time after which old server log must be deleted can be adjusted with the procedure SO_ADMINISTRATOR.SCHEDULER_LOG.

procedure scheduler_log(
    p_server_keep_days in integer default 999999);
  
Parameter Description
p_server_keep_days The number of days after which scheduler server log is deleted.
The default after installation is 30 days.
Error Description
OSC-10054
PROGRAM MUST BE EXECUTED UNDER SCHEDULER OWNER "%1"

Example 1

In this example the period after which the old server log must be deleted is set to 10 days.

exec so_administrator.scheduler_log(10);
  
Back to top 

Start the scheduler server

The scheduler server process is itself a scheduler script and activated as a scheduler task. The name of the server scheduler script created during the installation is SO_SERVER_PROCESS.
Starting the server process is nothing more than creating and activating a scheduler task.

procedure scheduler_start
    p_script_name in varchar2 default 'so_server_process',
    p_dbms_job_oracle_restart in varchar2 default 'Y',
    p_dbms_job_restart_wait in integer default 15);
  
Parameter Description
p_script_name The scheduler script name.
The name is not case sensitive.
p_dbms_job_oracle_restart If set and the running scheduler task database session aborts abnormally (for example the database shuts down during execution) it is restarted.
p_dbms_job_restart_wait The period in seconds after which the scheduler task must be restarted.
Error Description
OSC-10054
PROGRAM MUST BE EXECUTED UNDER SCHEDULER OWNER "%1"

Example 2

In this example a new server process is started.

exec so_administrator.scheduler_start;
  

If the scheduler queue is closed the background process will not start; open the queue and start a new plsql scheduler server process.

Back to top 

Stop the scheduler server

The server can be stopped with the procedure SO_ADMINISTRATOR.SCHEDULER_STOP.

procedure scheduler_stop;
  
Error Description
OSC-10054
PROGRAM MUST BE EXECUTED UNDER SCHEDULER OWNER "%1"

Example 3

The procedure sends only a stop request to the server process; it does not wait until the scheduler process itself is stopped.

exec so_administrator.scheduler_stop;
  
Back to top 

Kill the scheduler server

Killing the server process does not mean the server process is killed but that the server process will kill all current active scheduler tasks.
When there are no more active scheduler tasks left the server process will stop.

procedure scheduler_kill;
  
Error Description
OSC-10054
PROGRAM MUST BE EXECUTED UNDER SCHEDULER OWNER "%1"

Example 4

The procedure sends only a kill request to the server process; it does not wait until the scheduler process itself is stopped.

exec so_administrator.scheduler_kill;
  
Back to top 

Continue scheduler server process

If a server process has received a stop or kill request it may take some time till the server proces itself finally stops. This could be the case when the server process is still waiting for active tasks to finish.
If the server during this period receives a continue request it will discard the stop (or kill) request and continue processing.

procedure scheduler_continue;
  
Error Description
OSC-10054
PROGRAM MUST BE EXECUTED UNDER SCHEDULER OWNER "%1"

Example 5

If the server process has picked up the continue request in time can be seen in the server log.

exec so_administrator.scheduler_continue;
  
Back to top 

Interrupt scheduler server

The server process can be interrupted with the procedure SO_ADMINISTRATOR.SCHEDULER_INTERRUPT. Everytime the server receives an interrupt a message is written to the server log.

procedure scheduler_interrupt;
  

Example 6

The procedure sends only an interrupt request to the server process; it does not check if it is actually running or that it has received the request.

exec so_administrator.scheduler_interrupt;
  
Back to top 

Restart the scheduler server

When the scheduler server is restarted a new oracle process is created for the server process.

procedure scheduler_restart;
  
Error Description
OSC-10054
PROGRAM MUST BE EXECUTED UNDER SCHEDULER OWNER "%1"

Example 7

exec so_administrator.scheduler_restart;
  
Back to top 

Maximum load

For setting the scheduler server use the procedure SO_ADMINISTRATOR.SCHEDULER_LOAD.

procedure scheduler_load(
    p_server_load in integer default 999999);
  
Parameter Description
p_server_load Specifies the maximum scheduler server load.
The minimum is zero and the maximum is 999999.
Error Description
OSC-10054
PROGRAM MUST BE EXECUTED UNDER SCHEDULER OWNER "%1"

Example 8

In this example the load is set to hundred.

exec so_administrator.scheduler_load(100);
  
Back to top 

Check interval

The scheduler server interval is set with the procedure SO_ADMINISTRATOR.SCHEDULER_INTERVAL.

procedure scheduler_interval(
    p_server_interval in integer default 900);
  
Parameter Description
p_server_interval The scheduler server interval, the period in seconds after the scheduler server wakes up and does an extra check.
The minimum is fifteen seconds and the maximum is 999999 seconds.
Error Description
OSC-10054
PROGRAM MUST BE EXECUTED UNDER SCHEDULER OWNER "%1"

Example 9

In this example the interval is set to ten minutes (= 600 seconds).

exec so_administrator.scheduler_interval(600);
  
Back to top