Creating the database dump file

This is an example for MySSQL.

1. Stop the JobScheduler

2. Create a dump of the history tables

 ./mysqldump 
 scheduler SCHEDULER_HISTORY SCHEDULER_ORDER_HISTORY  SCHEDULER_ORDER_STEP_HISTORY  SCHEDULER_VARIABLES  
 --host=<host> --port=<port>  --user=<user>  -p 
 --add-drop-table --skip-comments --single-transaction --opt > scheduler_history.dmp

3. Create an archive database

 prompt:~> ./mysql --host=<host> --port=<port> --user=<user> -p scheduler_archive 
 mysql> create database scheduler_archive
 mysql> exit

4. Import dump to the archive

 prompt:~>./mysql --host=<host> --port=<port> --user=<user> -p scheduler_archive < scheduler_history.dmp

5. Delete old records (please check scheduler_archive before doing this)

 prompt:~> ./mysql --host=<host> --port=<port> --user=<user> -p scheduler 
 mysql> delete from SCHEDULER_HISTORY where start_time < '2012-01-01';
 mysql> delete from SCHEDULER_ORDER_HISTORY where start_time < '2012-01-01';
 mysql> delete from SCHEDULER_ORDER_STEP_HISTORY where start_time < '2012-01-01';
 mysql> exit

6. Optimize table

 prompt:~> ./mysql --host=<host> --port=<port> --user=<user> -p scheduler 
 mysql> OPTIMIZE TABLE SCHEDULER_HISTORY,SCHEDULER_ORDER_HISTORY,SCHEDULER_ORDER_STEP_HISTORY;
 mysql> exit

How to access logs from the archive by id

Set-up a new JobScheduler instance. This instance should have not run any jobs.

To access the task log

 http://localhost:4444/show_log?task=1262811

To access an order log

 http://localhost:4444/show_log?order=backup_pg_sql&history_id=403816