问题描述
我正在尝试使用Liquibase在数据库中创建一些表.
I am trying to create a few tables in a DB using Liquibase.
某些背景:我在本地h2数据库上执行了相同的changelog.xml文件,并且工作成功.我用松鼠测试了以下的oracle数据库,用户名,密码和驱动程序,并成功连接了它.因此,我可以肯定地知道我正在遇到液基问题.我进行了广泛的Google搜索,但在SO上或其他任何地方都找不到任何可以帮助我的东西.
Some background: I executed the same changelog.xml file on a local h2 database and it worked succussfully. And I tested the below oracle database, username, password and driver with squirrel and it connected successfully. So I'm fairly certain that I am facing a liquibase problem. I did extensive google-ing and did not find anything on SO or anywhere else that could helped me.
我在命令提示符下输入了以下内容:
I entered the following into the command prompt:
C:\>java -jar liquibase-core-2.0.5.jar --driver=oracle.jdbc.OracleDriver
--classpath=ojdbc6-11.2.0.3.0.jar --changeLogFile=changelog.xml
--url="jdbc:oracle:thin:@myDatabase"
--username=myUsername --password=myPassword --logLevel=debug update
哪个返回:
DEBUG 9/30/13 3:09 PM:liquibase: Unable to load/access Apache Derby driver class
to check version
DEBUG 9/30/13 3:09 PM:liquibase: Connected to myUsername@jdbc:oracle:thin:@myDatabase
DEBUG 9/30/13 3:10 PM:liquibase: Executing QUERY database command: SELECT LOCKED
FROM DATABASECHANGELOGLOCK WHERE ID=1 FOR UPDATE
Liquibase Update Failed: Empty result set, expected one row
SEVERE 9/30/13 3:10 PM:liquibase: Empty result set, expected one row
liquibase.exception.LockException: liquibase.exception.DatabaseException: Empty
result set, expected one row
at liquibase.lockservice.LockService.acquireLock(LockService.java:121)
at liquibase.lockservice.LockService.waitForLock(LockService.java:61)
at liquibase.Liquibase.update(Liquibase.java:102)
at liquibase.integration.commandline.Main.doMigration(Main.java:825)
at liquibase.integration.commandline.Main.main(Main.java:134)
Caused by: liquibase.exception.DatabaseException: Empty result set, expected one
row
at liquibase.util.JdbcUtils.requiredSingleResult(JdbcUtils.java:124)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:
159)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:
167)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:
163)
at liquibase.lockservice.LockService.acquireLock(LockService.java:96)
... 4 more
推荐答案
我在这里找到了答案:
I found the answer here: http://forum.liquibase.org/topic/message-regarding-an-empty-result-set-for-databasechangeloglock
删除databasechangeloglock表可以为我解决它.
Deleting the databasechangeloglock table solved it for me.
这篇关于Liquibase更新错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!