You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Scope

This article describes regular database maintenance tasks that should be carried out on a regular basis. It applies for JobScheduler 1.11 and newer. FEATURE AVAILABILITY STARTING FROM RELEASE 1.11

See the Job JobSchedulerCleanupHistory article for information about database maintenance tasks for JobScheduler older than 1.11.

Introduction

Two command line scripts are now provided with the JobScheduler for database maintenance from release 1.11.x and newer. These scripts replace the JobSchedulerCleanupHistory JITL Job, which is not included in the JobScheduler installation release 1.11.x and newer. All the JobSchedulers accessing the database tables listed in the next section should be stopped before the scripts are run. This means, for example, all the JobSchedulers in a cluster.

Database Table Usage

The JobScheduler writes information about each task and order into the following database tables:

  • SCHEDULER_HISTORY
  • SCHEDULER_ORDER_HISTORY
  • SCHEDULER_ORDER_STEP_HISTORY

The sos/dailyplan/CreateDailyPlan job writes to the table:

  • DAILY_PLAN

The sos/jade/jade_import job writes to the table:

  • JADE_FILES
  • JADE_FILES_HISTORY

The plugin com.sos.jitl.reporting.plugin.FactPlugin writes to the database table:

  • REPORTING_*

Without regular maintenance, these tables can become very large, which can reduce the performance and eventually result in no more space being available.

To avoid this, the following scripts should be run on a regular basis:

  • ./bin/cleanup_jobscheduler_tables.(sh|cmd)
  • ./bin/cleanup_reporting_tables.(sh|cmd)

Parametrized cleanup scripts

  • The setup knows two databases; the JobScheduler database and the Reporting database and separate script is provided for each..

./bin/cleanup_jobscheduler_tables.(sh|cmd)

  • This script cleans the following database tables:
    • SCHEDULER_HISTORY
    • SCHEDULER_ORDER_HISTORY
    • SCHEDULER_ORDER_STEP_HISTORY
  • It uses the database connection setting stored in:
    • ./config/hibernate,cfg.xml.
  • This script has only one argument - for the age of the records.
    • All records older then the specified age are removed.
  • If this script is called without an argument then you get its usage

    Usage: cleanup_jobscheduler_tables.(sh|cmd) age          | age : Age of table entries in days
    
    Example: - To remove entries older than 14 days call:
               cleanup_jobscheduler_tables.cmd 14
             - To remove all entries call:
               cleanup_jobscheduler_tables.cmd 0

./bin/cleanup_reporting_tables.(sh|cmd)

  • This script cleans the following database tables:
    • DAILY_PLAN
    • JADE_FILES
    • JADE_FILES_HISTORY
    • REPORTING_*
  • It uses the database connection setting stored in:
    • ./config/reporting_hibernate,cfg.xml.
  • This script has two arguments for the age of the records and for the range of the tables.
    • All records older then the specified age are removed.
    • You can filter the tables in which the records will be removed with the range argument. Possible values are all, reporting, dailyplan or yade.
  • If this script is called without an argument then you get its usage

    Usage: cleanup_reporting_tables.(sh|cmd) range age
           range           | which tables? all, reporting, dailyplan, yade
           age             | Age of table entries
    Example: - Remove entries older than 14 days in all tables then call
               cleanup_reporting_tables.cmd all 14
             - Remove entries older than 14 days in reporting tables then call
               cleanup_reporting_tables.cmd reporting 14
             - Remove all entries then call
               cleanup_reporting_tables.cmd all 0

 

 

 

  • No labels