Flyway repair throws FlywaySqlException with Oracle DB

Deadly 提交于 2020-02-23 07:43:05

问题


I am trying to use flyway repair method to delete unsuccessful migration entries from schema versioning table with spring boot configuration. My code is like this;

@Bean
public FlywayMigrationStrategy repairStrategy() {
    return flyway -> {
        flyway.repair();
        flyway.migrate();
    };
}

But after run, it throws an error like this(repair operation fails even when migration operation is commented out);

Error while retrieving the list of applied migrations from Schema History table 
SQL State  : 72000 
Error Code : 12838 
Message    : ORA-12838: cannot read/modify an object after modifying it in parallel

Do you have any ideas? Is there any parallel operation here? Btw, I am using Oracle ATP database and flyway community edition.


回答1:


Flyway repair will not repair your database for you (see docs here). What it does is repair the schema history table back to a valid state. Fixing the database is left up to the user (as it is a non-trivial task).

In this situation, you can try submitting a commit;. This should allow you to run repair and then migrate again. See: https://dbaclass.com/article/ora-12838-cannot-readmodify-object-modifying-parallel/



来源:https://stackoverflow.com/questions/59666601/flyway-repair-throws-flywaysqlexception-with-oracle-db

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!