Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In addition a script is provided (./bin/cleanup_inventory_tables.(cmd|sh)) for deleting database inventory records. These Such records can remain when in place if a JobScheduler older earlier than version release 1.11.2 has been deleted or when if the ID or Port port of a JobScheduler is changed. 


Info
titleIMPORTANT NOTE

Note that all the JobSchedulers JobScheduler instances accessing the database tables listed in the next section below should be stopped before the scripts are runexecuted. This applies, for example, to all the JobSchedulers JobScheduler instances in a cluster.

 


Database Table Usage

JobScheduler Tables

The JobScheduler writes information about each Task and Order into to the following database tables:

...

Database Cleanup Scripts

From version release 1.11.x onwards onward the JobScheduler can be set up to use either one or two databases: the JobScheduler database can either be used for both JobScheduler and Reporting tables or the Reporting Tables can be written to managed with a separate Reporting databaseDatabase. A separate cleanup script is provided for each set of database tables.

...

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

Clean up

...

JobScheduler Tables

  • This script cleans the following tables in the JobScheduler database:
    • SCHEDULER_HISTORY
    • SCHEDULER_ORDER_HISTORY
    • SCHEDULER_ORDER_STEP_HISTORY
  • It uses the database connection setting settings stored in:
    • ./config/hibernate,cfg.xml.
  • This script has makes use of only one argument - for the age of the records to be deleted.
    • All records older then than the specified age are removed.
  • If this script is called without an argument then it will ask for a parameter as follows:

    Code Block
    titleUse of the cleanup_jobscheduler_tables script
    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


Clean up Reporting Tables

  • This script cleans up the following tables in the Reporting database:
    • DAILY_PLAN
    • JADE_FILES
    • JADE_FILES_HISTORY
    • REPORTING_*
  • It The script uses the database connection setting settings stored in:
    • ./config/reporting_hibernate,cfg.xml.
  • This script has makes use of two arguments: for the age of the records and for the range of the tables.
    • All records older then than the specified age are removed.
    • The range argument is used to filter the tables in from which the records will be removed from. Possible values are include all, reporting, dailyplan or yade.

...


If this script is called without an argument then it will ask for parameters as follows:

Code Block
titleUse of the cleanup_reporting_tables script
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

 


Clean up Inventory Tables

There are situations where when the removal of inventory data from the Reporting database Database may be required. These are:

  • In version releases 1.11.0 and 1.11.1 the inventory data remains remain in the Reporting database when Database if a JobScheduler is uninstalled.
    Note that with version releases 1.11.2 and newer inventory data is automatically deleted when if a JobScheduler is uninstalled.
    Jira
    serverSOS JIRA
    serverId6dc67751-9d67-34cd-985b-194a8cdc9602
    keySET-96

  • If the JobScheduler Id ID or HTTP port are modified. This causes a new set of inventory data to be written and allows the obsolete inventory data set to remain in place.

If obsolete inventory data is are not removed from the Reporting databaseDatabase then it will still be possible for users with the necessary permissions to view this information in the JOC Cockpit.

...

  • This script cleans all INVENTORY_* database tables in the Reporting database Database.
  • It expects the database connection setting settings in ./config/reporting_hibernate.cfg.xml.
  • This script has three arguments to identify a specific JobScheduler instance. These are
    • JobScheduler IdID
    • Host
    • HTTP port
  • With the single argument info a list of existing JobScheduler instances from the inventory will be displayed.
    • This call is helpful to see the exact values of IdID, host and HTTP port.
  • If this script is called without an argument then you get its usage:

    Code Block
    Usage: cleanup_inventory_tables.(cmd|sh) [JobSchedulerId JobSchedulerHost JobSchedulerHTTPPort] | [info]
           JobSchedulerId           | The Id, hostname and http port of a
           JobSchedulerHost         | JobScheduler which data should be
           JobSchedulerHTTPPort     | removed in the INVENTORY tables of the
                                    | reporting database.
       or
           info                     | Shows a list of existing JobScheduler
                                    | instances in the INVENTORY tables


  • Example for an info output:

    Code Block
    JobSchedulerId                   | Host                             | Port
    ---------------------------------------------------------------------------
    scheduler.1.11-reporting         | OH                               | 40413
    scheduler.1.11-x86               | OH                               | 40186
    SP_41110x1                       | SP                               | 40119
    scheduler.1.11                   | OH                               | 40411
    scheduler.1.11-reporting         | OH                               | 40423
    scheduler.1.11.1                 | OH                               | 40471


...

  • This script cleans the following table in the Reporting database Database:
    • AUDIT_LOG
  • It uses the database connection setting settings stored in:
    • ./config/reporting.hibernate,cfg.xml.
  • This script has makes use of only one argument - for the age of the records.
    • All records older then than the specified age are removed.
  • If this script is called without an argument then it will ask for a parameter as follows:

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