Results 1 to 6 of 6

Thread: Clean spring batch metadata tables

  1. #1
    Join Date
    Aug 2012
    Posts
    17

    Default Clean spring batch metadata tables

    How can I clean up spring batch metadata tables?

    Thanks.

  2. #2

    Default

    Quote Originally Posted by Tiago Melo View Post
    How can I clean up spring batch metadata tables?

    Thanks.
    * See issue BATCH-1747.
    * See RemoveSpringBatchHistoryTasklet @ https://github.com/arey/spring-batch-toolkit
    * Read blog entry (french): Sprint Batch s'auto-nettoie
    Olivier BAZOUD - co-author of Spring Batch in Action

  3. #3

    Default

    Quote Originally Posted by Tiago Melo View Post
    How can I clean up spring batch metadata tables?

    Thanks.
    I've used this with v2.1.7.RELEASE

    Code:
    DELETE FROM BATCH_STEP_EXECUTION_CONTEXT ;
    DELETE FROM BATCH_JOB_EXECUTION_CONTEXT ;
    DELETE FROM BATCH_STEP_EXECUTION ;
    DELETE FROM BATCH_JOB_EXECUTION ;
    DELETE FROM BATCH_JOB_PARAMS ;
    DELETE FROM BATCH_JOB_INSTANCE ;
    
    DELETE FROM BATCH_STEP_EXECUTION_SEQ ;
    DELETE FROM BATCH_JOB_EXECUTION_SEQ ;
    DELETE FROM BATCH_JOB_SEQ ;

  4. #4
    Join Date
    Aug 2012
    Posts
    17

    Default

    Quote Originally Posted by johnmmcparland View Post
    I've used this with v2.1.7.RELEASE

    Code:
    DELETE FROM BATCH_STEP_EXECUTION_CONTEXT ;
    DELETE FROM BATCH_JOB_EXECUTION_CONTEXT ;
    DELETE FROM BATCH_STEP_EXECUTION ;
    DELETE FROM BATCH_JOB_EXECUTION ;
    DELETE FROM BATCH_JOB_PARAMS ;
    DELETE FROM BATCH_JOB_INSTANCE ;
    
    DELETE FROM BATCH_STEP_EXECUTION_SEQ ;
    DELETE FROM BATCH_JOB_EXECUTION_SEQ ;
    DELETE FROM BATCH_JOB_SEQ ;

    That's it. Thanks!

  5. #5

    Default

    Quote Originally Posted by Tiago Melo View Post
    That's it. Thanks!
    Yikes I made a big mistake here...

    Code:
    DELETE FROM BATCH_STEP_EXECUTION_CONTEXT ;
    DELETE FROM BATCH_JOB_EXECUTION_CONTEXT ;
    DELETE FROM BATCH_STEP_EXECUTION ;
    DELETE FROM BATCH_JOB_EXECUTION ;
    DELETE FROM BATCH_JOB_PARAMS ;
    DELETE FROM BATCH_JOB_INSTANCE ;
    
    DELETE FROM BATCH_STEP_EXECUTION_SEQ ;
    DELETE FROM BATCH_JOB_EXECUTION_SEQ ;
    DELETE FROM BATCH_JOB_SEQ ;
    
    -- These are needed
    INSERT INTO BATCH_STEP_EXECUTION_SEQ values(0);
    INSERT INTO BATCH_JOB_EXECUTION_SEQ values(0);
    INSERT INTO BATCH_JOB_SEQ values(0);
    Those insertions at the end are very important! As I found out here

    Please do use the updated version!

  6. #6
    Join Date
    Aug 2012
    Posts
    17

    Default

    Quote Originally Posted by johnmmcparland View Post
    Yikes I made a big mistake here...

    Code:
    DELETE FROM BATCH_STEP_EXECUTION_CONTEXT ;
    DELETE FROM BATCH_JOB_EXECUTION_CONTEXT ;
    DELETE FROM BATCH_STEP_EXECUTION ;
    DELETE FROM BATCH_JOB_EXECUTION ;
    DELETE FROM BATCH_JOB_PARAMS ;
    DELETE FROM BATCH_JOB_INSTANCE ;
    
    DELETE FROM BATCH_STEP_EXECUTION_SEQ ;
    DELETE FROM BATCH_JOB_EXECUTION_SEQ ;
    DELETE FROM BATCH_JOB_SEQ ;
    
    -- These are needed
    INSERT INTO BATCH_STEP_EXECUTION_SEQ values(0);
    INSERT INTO BATCH_JOB_EXECUTION_SEQ values(0);
    INSERT INTO BATCH_JOB_SEQ values(0);
    Those insertions at the end are very important! As I found out here

    Please do use the updated version!
    Oh that's right. Thank you very much for your help!

    Cheers!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •