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 improvements for Oracle (2nd try) #1573
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ount Oracle use exists instead of count
(cherry picked from commit 3dcb9c5)
FORCE option is not needed here and appeared only in Oracle 11. (cherry picked from commit ae307ec)
(cherry picked from commit fe567c6)
(cherry picked from commit 04e538a)
FBA create/drop. Got rid of quotation confusion. (cherry picked from commit 373cacf)
Where possible, changed the current schema to FLYWAY_AUX in order to ensure that create/clean scripts work correctly for non-default schemas. (cherry picked from commit 748bdd0)
(cherry picked from commit 099efab)
Disabling of FBA can be done on another schema's objects. Edited some comments and variable/method names in order to avoid confusing with other Flashback features. Renamed Spatial to Locator whenever occurred. Spatial is a separate paid option, while Locator is free and available even on XE and is actually meant in the code (see Oracle white paper on Spatial). Only metadata is cleaned, and domain indexes should be dropped along with other objects. (cherry picked from commit d32fc97)
Fixed support for FBA tracked tables, queue tables, scheduler jobs in non-default schemas. Removed faulty filters on object names to exclude wrong objects - replaced with proper conditions, revised drop order and separate steps for MV logs and domain indexes. Merge remote-tracking branch 'remotes/origin/oracle-improve-clean' into oracle-improve-clean-2
Prefetched lists of objects used in order to reduce the number of vain data dictionary scans.
Truly excellent work Victor! I really appreciated your thorough pull requests. Well thought out, clean code, polished tests, necessary docs to clarify reasoning, ... Top class! Keep them coming! |
This was referenced Apr 11, 2017
dohrayme
pushed a commit
to dohrayme/flyway
that referenced
this pull request
Feb 3, 2020
Clean improvements for Oracle (2nd try)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is to address some flaws mentioned in issue #1550. It partially supersedes canceled PR #1572. Some changes are stroke out.
The main goals of this PR are:
to simplifyOracleSchema.doClean()
method: make it easily extensible with more object types;The full change is split into a chain of non-breaking smaller commits, so they could be reviewed easier.
The list of changes done:
optimization:
count(*) > 0
replaced withexists()
;refactoring:
OracleSchema
toOracleDbSupport
;logic of finding and dropping of objects of certain types encapsulated into correspondingOracleSchemaObjectType
enum values;other fixes:
These changes have been successfully tested on Oracle 10.2.0.1 XE, 10.2.0.5 EE, 11.2.0.4 EE. To be tested on 11 XE, 12 EE.
Originally I had intention to extend Clean method with more schema-owned object types:
and others that can be cleaned but ignored.
But now I see there's a flaw in SchemaObject's OO design, which should be fixed in a separate change. So I removed my refactoring changes from this PR (I didn't like them after a fresh morning look) and kept only those related to performance and bugs. So the goal of simplifying doClean() hasn't been achieved yet.