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

Oracle cleanup - flyway fails on tables that have Flashback enabled #687

Closed
awal11 opened this issue Jan 31, 2014 · 2 comments
Closed

Oracle cleanup - flyway fails on tables that have Flashback enabled #687

awal11 opened this issue Jan 31, 2014 · 2 comments

Comments

@awal11
Copy link

@awal11 awal11 commented Jan 31, 2014

I have a schema with tables set to use Oracle Flashback/Total Recall (full audit implemented completely on database side).

After I create the tables with command like

ALTER TABLE USERS FLASHBACK ARCHIVE FDA_TRAC

Oracle creates 'magic' tables like SYS_FBA_HIST_61527 that flyway fails to delete automatically, throwing:
ORA-55622: DML, ALTER and CREATE UNIQUE INDEX operations are not allowed on table "SCOTT"."SYS_FBA_HIST_61527"

To be able to clean the schema one would need to execute

ALTER TABLE USERS NO FLASHBACK ARCHIVE

before attempting to delete anything.

So how should I help:

  • if this pull request #629 gets accepted - I guess I don't need to do anything - is there a chance for it?
  • I could update OracleSchema.java to detect and 'NO FLASHBACK' appropriate tables automatically - would such patch be accepted?
  • if so - should I add a test case for it? It will end up @Ingored as Flashback not enabled in most oracle instances and not very popular.
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Feb 2, 2014

Thanks for your report and your offer.

A pull request with an @ignore test case would really be ideal. This way not only you, but all other users of Flyway will also benefit from this.

Looking forward to your contribution!
Axel

awal11 pushed a commit to awal11/flyway that referenced this issue Feb 3, 2014
…enabled

Added test case (once launched it will prevent any schema cleanup) and code that disables flasback during cleanup.
awal11 pushed a commit to awal11/flyway that referenced this issue Feb 6, 2014
…til the asynchronous process of removing flashback is completed, before allowing the process to continue
axelfontaine added a commit that referenced this issue Feb 11, 2014
Fixing #687 - added code that can remove Flashback tables in Oracle and a test case for it. Also fixed one incorrect Oracle test configuration method.
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Feb 11, 2014

Merged. Thanks!

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.