Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean Oracle scheduled jobs #799

Merged
merged 2 commits into from Oct 14, 2014

Conversation

@dan-nawrocki
Copy link

@dan-nawrocki dan-nawrocki commented Jul 14, 2014

I'm using flyway on a very large Oracle schema. One of the issues I found was that a clean didn't remove existing scheduled jobs; this pull request fixes it. Let me know if there's anything you'd like me to add in order to get this in to 3.1.

@lukaseder
Copy link
Contributor

@lukaseder lukaseder commented Jul 14, 2014

I've recently been doing some work for a client who is using jobs. I think that if you want to go this way, you really have to clean up and correctly handle all sorts of job-related artefacts. In other words, all artefacts that can be created with the DBMS_SCHEDULER package should be dropped:

  • chains (with chain rules, chain steps)
  • credentials
  • database destinations
  • file watchers
  • groups
  • jobs
  • job classes
  • programs (with arguments)
  • schedules
  • windows

I wonder, though, if there's a one-size-fits-all solution here. If you're using jobs with queues, maybe you'd also want Oracle AQ / Streams packages to be managed by this Flyway clean function?

Loading

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Aug 3, 2014

Hi Dan,

thanks for submitting the pull request. Could you add a test case for this as well?

Cheers
Axel

Loading

@axelfontaine axelfontaine added this to the Flyway 3.1 milestone Aug 3, 2014
@dan-nawrocki dan-nawrocki changed the title Clean Oralce scheduled jobs Clean Oracle scheduled jobs Aug 4, 2014
@dan-nawrocki
Copy link
Author

@dan-nawrocki dan-nawrocki commented Aug 4, 2014

Test case added.

@lukaseder I couldn't find anything simple to clean up everything related to the dbms_scheduler -- it looks like everything in that package would require a different DROP statement (dbms_scheduler.drop_job vs dbms_scheduler.drop_chain vs etc). We'd probably need separate code blocks to dynamically create all those DROPs individually.

AQ streams do appear to be cleaned by 3.1 out of the box. This was one of the selling points I used to push for adoption of flyway over the incomplete homegrown clean/migrate solution at my company.

Thanks!

Loading

axelfontaine added a commit that referenced this issue Oct 14, 2014
@axelfontaine axelfontaine merged commit 31df10d into flyway:master Oct 14, 2014
1 check failed
Loading
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Oct 14, 2014

Thank you very much Dan! Merged. Should be part of 3.1 due out before the end of the month.

Cheers
Axel

Loading

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Aug 17, 2017

@dan-nawrocki Could you please get in touch with me via email? (axel at boxfuse.com) Thanks!

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants