Skip to content

Instantly share code, notes, and snippets.

@xi-ao
Last active March 5, 2020 09:27
Show Gist options
  • Save xi-ao/5d7a122dafea9dc460a32d2d3c77b68c to your computer and use it in GitHub Desktop.
Save xi-ao/5d7a122dafea9dc460a32d2d3c77b68c to your computer and use it in GitHub Desktop.
Purge jobs executions from Rundeck H2 Database
DELETE FROM PUBLIC.REFERENCED_EXECUTION;
DELETE FROM PUBLIC.BASE_REPORT;
DELETE FROM WORKFLOW_WORKFLOW_STEP wws
WHERE wws.WORKFLOW_COMMANDS_ID IN (
SELECT WORKFLOW_id FROM EXECUTION
);
DELETE FROM WORKFLOW_STEP ws
WHERE ws.ID NOT IN (
SELECT wws.WORKFLOW_STEP_ID FROM WORKFLOW_WORKFLOW_STEP wws
);
DELETE FROM EXECUTION;
DELETE FROM WORKFLOW w
WHERE w.ID NOT IN (
SELECT wws.WORKFLOW_COMMANDS_ID FROM WORKFLOW_WORKFLOW_STEP wws
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment