There are some cases where I KNOW that a source table vs. a reference table are different and ALWAYS will be, so not something I want to worry about or change.
Is there any way to specify a list where that particular table (or view or index, etc.) is just IGNORED as part of the diff?
TY Eduard for your reply.
I am actually running this from a command line, and it appears that the --diffExcludeObjects" is an unknown option:
Error:
SEVERE: Unexpected error running Liquibase: Unknown option: âdiffExcludeObjectsâ
liquibase.exception.CommandLineParsingException: Unknown option: âdiffExcludeObjectsâ
at liquibase.integration.commandline.Main.parseOptionArgument(Main.java:1216)
at liquibase.integration.commandline.Main.parseOptions(Main.java:1155)
at liquibase.integration.commandline.Main$1.run(Main.java:259)
at liquibase.integration.commandline.Main$1.run(Main.java:193)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:145)
at liquibase.integration.commandline.Main.run(Main.java:193)
at liquibase.integration.commandline.Main.main(Main.java:156)
Thanks for all the help so far â this works, but NOT 100%.
First if I use something like
excludeObjects=âAUDIT_","PMERRâ,âEDW_PROCESS_CONTROLâ,âEDW_RUN_CONTROLâ,âPM_SRC_EVENTâ,âPM_SRC_HEARTBEATâ,âPM_TGT_HEARTBEATâ-
it DOES NOT use the wildcards in the table names, so it misses things like AUDIT_CONTROL.
It also misses all of the PMERR_nnnnn tables â they are still included in the diff.
IF I do THIS:
excludeObjects=âAUDIT_CONTROLâ,âAUDIT_CONTROL_EDWâ,âEDW_PROCESS_CONTROLâ,âEDW_RUN_CONTROLâ,âPMERR_DATAâ,âPMERR_MSGâ,âPMERR_SESSâ,âPMERR_TRANSâ,âPM_SRC_EVENTâ,âPM_SRC_HEARTBEATâ,âPM_TGT_HEARTBEATâ
it WILL exclude each of those tables from the MISSING part of the diff, but NOT in the âUNEXPECTED TABLESâ diff results.
Can the exclude be forced to ignore on BOTH sides of the diff (so the UNEXPECTED TABLES doesnât show up?)
excludeObjects accepts an object name, which is the regexp (regular expression), exclude any object from the database which name matches the regexp .
So for example: âtable:*._lockâ will match a table that ends with _lock".
In your example, you can try using such regexp to exclude required tables from diff output.
Regarding your second concern, sorry but Iâm not clear and not able to understand it. Could you be more precise on it?
Thanks for the help with this â regex worked â I missed that initially in the document.
i DID try this:
âAUDIT*.â,âPMERR*.â but they did NOT filter out the various AUDIT_nnn and PMERR_NNN tables. I DID test these in a regex tester and it should have found those tables.
As for the second, I PUT in this to exclude the object:
âŚ
,âPM_TGT_HEARTBEATâ
BUT when I run the diff, that table appears in the diff as a âUnexpected tableâ - I want to not have the diff look at EITHER the source OR target for this table â just ignore it all together.
Actually I realized I had a typo â the regex did NOT work.
I used:
âAUDIT*.â but it did NOT filter any of the AUDIT_NNN tables â I had to explicitly enter them.
AND the exclusions do NOT seem to take into account the target db â just the reference db. Is there any way to make the exclusions cover BOTH (so that âunexpected tableâ is not shown)?
Thanks â that change in the regex fixed the issue.
I NOW still have ONE issue for the diff â it does NOT ingore one of the tables I put on the exclude list on the TARGET side. I am still getting:
Unexpected Table(s):
PM_TGT_HEARTBEAT
Even though that is listed in the exclude:
âexcludeObjects=âAUDIT.","PMERR.â,âPM_TGT_HEARTBEATâ
Is there any way to force that? Also is there a way to have liquibase return a return code of 0 if no diffs are found and NON-zero if diffs are found?
Folks,
I NOW still have ONE issue for the diff â it does NOT ingore one of the tables I put on the exclude list on the TARGET side. I am still getting:
Unexpected Table(s):
PM_TGT_HEARTBEAT
Even though that is listed in the exclude:
âexcludeObjects=âAUDIT. ","PMERR. â,âPM_TGT_HEARTBEATâ
Any ideas on how to exclude a table from the TARGET side?