Flyway修复将Oracle数据库抛出FlywaySqlException [英] Flyway repair throws FlywaySqlException with Oracle DB
问题描述
我正在尝试使用flyway修复方法从具有Spring Boot配置的架构版本表中删除不成功的迁移条目.我的代码是这样的;
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
您有什么想法吗?这里有并行操作吗?顺便说一句,我正在使用Oracle ATP数据库和flyway社区版.
Do you have any ideas? Is there any parallel operation here? Btw, I am using Oracle ATP database and flyway community edition.
推荐答案
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).
在这种情况下,您可以尝试提交commit;
.这应该使您可以运行修复,然后再次迁移.
请参阅: https://dbaclass.com/article/ora -12838-cannot-readmodify-object-modifying-parallel/
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/
这篇关于Flyway修复将Oracle数据库抛出FlywaySqlException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!