Create Schedules

1. Documentación en Tahiti -> Oracle Database, 11g Release 2 (11.2) -> Master Book List -> Administrator’s Guid -> 29 Scheduling Jobs with Oracle Scheduler -> Creating and Managing Schedules to Define Jobs

2. Vamos a repetir el ejercicio anterior, pero esta vez utilizando Schedules.

Click “Targets” ->
-> Click “Databases” ->
-> Click “OCM” ->
-> Click “Server” ->
-> Click “Schedules” ->
-> Click “Create” ->
-> Name = “MONTHLY_STATS_HR” ->
-> Time Zone = “(UTC+01:00) Madrid” ->
-> Click “Scheudle Attributes” ->
-> Repeat = “By Months” ->
-> Seleccionamos el día “25” ->
-> Time = “12 00 00 AM” ->
-> Click “OK”

3. Una vez hemos creado la planificación (Schedule) ya podemos crear un Job asociado a ésta.

Click “Targets” ->
-> Click “Databases” ->
-> Click “OCM” ->
-> Click “Server” ->
-> Click “Jobs” ->
-> Click “Create” ->
-> Name = “GATHER_STATS_HR” ->
-> PL/SQL =

BEGIN
  DBMS_STATS.GATHER_SCHEMA_STATS(
    OWNNAME=>'HR',
    METHOD_OPT=>'FOR ALL INDEXED COLUMNS SIZE AUTO',
    DEGREE=>2,
    CASCADE=>TRUE,
    NO_INVALIDATE=>FALSE);
END;

-> Click “Schedule” ->
-> Schedule Type = “User Pre-defined Schedule” ->
-> Click icono de Linterna ->
-> Seleccionamos MONTHLY_STATS_HR ->
-> Click “OK”

Probamos la ejecución del Job manualmente.

Seleccionamos “GATHER_STATS_HR” ->
-> Click “Run Now”

4. Borramos el Job y el Schedule.

Click “Jobs” ->
-> Seleccionamos “GATHER_STATS_JOBS” ->
-> Click “Delete” ->
-> Seleccionamos “Drop the job and stop any running instance.” ->
-> Click “Yes”

Click “Schedules” ->
-> Seleccionamos “MONTHLY_STATS_HR” ->
-> Click “Delete” ->
-> Seleccionamos “Drop the job and stop any running instance.” ->
-> Click “Yes”