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

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

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?

@axelfontaine
Copy link
Contributor

Hi Dan,

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

Cheers
Axel

@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

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!

axelfontaine pushed a commit that referenced this pull request Oct 14, 2014
@axelfontaine axelfontaine merged commit 31df10d into flyway:master Oct 14, 2014
axelfontaine pushed a commit that referenced this pull request Oct 14, 2014
@axelfontaine
Copy link
Contributor

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

Cheers
Axel

@axelfontaine
Copy link
Contributor

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

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

Successfully merging this pull request may close these issues.

None yet

3 participants