我正在尝试使用 Liquibase 在数据库中创建一些表。
一些背景知识:我在本地 h2 数据库上执行了相同的 changelog.xml 文件,并且成功运行。我用松鼠测试了下面的oracle数据库、用户名、密码和驱动程序,它连接成功。所以我相当肯定我正面临一个 liquibase 问题。我进行了广泛的谷歌搜索,但没有在 SO 或其他任何可以帮助我的地方找到任何东西。
我在命令提示符中输入了以下内容:
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