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

Compare with Current View Page History

« Previous Version 6 Next »

Creating the dumpfile

This is a sample for MySql.

1.Stop the JobScheduler

2.Create a dump of 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

 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

Setup a new job scheduler instance. This instance should have no own jobs.

To access a 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
  • No labels