Liquibase tables are not detected in oracle running in the SYSTEM schema

Description

From http://forum.liquibase.org/topic/error-on-system-databasech-angeloglock-while-re-executing-a-migration

I re-run migration, but using the command line tool and the same database changelog and files, in order to use the logLevel parameter and get some more detailed information.

here is the command I run:

java -jar liquibase-core-3.0.2.jar --driver=oracle.jdbc.OracleDriver --classpath=./lib/ojdbc6-11.2.0.3.jar --changeLogFile=dbchangelog.xml --url="jdbc:oracle:thin:@localhost:1521:WBMD" --username=system --password=...... --logLevel=debug update

And here the log I get:

DEBUG 25/07/13 17.04:liquibase: Unable to load/access Apache Derby driver class to check version
DEBUG 25/07/13 17.04:liquibase: Connected to SYSTEM@jdbc:oracle:thin:@localhost:1521:WBMD
DEBUG 25/07/13 17.04:liquibase: Setting auto commit to false from true
DEBUG 25/07/13 17.04:liquibase: Create Database Lock Table
DEBUG 25/07/13 17.04:liquibase: Executing EXECUTE database command: CREATE TABLE SYSTEM.DATABASECHANGELOGLOCK (ID INTEGER NOT NULL, LOCKED NUMBER(1) NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR2(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID))
Liquibase update Failed: liquibase.exception.DatabaseException: Error executing SQL CREATE TABLE SYSTEM.DATABASECHANGELOGLOCK (ID INTEGER NOT NULL, LOCKED NUMBER(1) NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR2(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID)); on jdbc:oracle:thin:@localhost:1521:WBMDINSERT INTO SYSTEM.DATABASECHANGELOGLOCK (ID, LOCKED) VALUES (1, 0): ORA-00955: nome già utilizzato da un oggetto esistente

SEVERE 25/07/13 17.04:liquibase: liquibase.exception.DatabaseException: Error executing SQL CREATE TABLE SYSTEM.DATABASECHANGELOGLOCK (ID INTEGER NOT NULL, LOCKED NUMBER(1) NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR2(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID)); on jdbc:oracle:thin:@localhost:1521:WBMDINSERT INTO SYSTEM.DATABASECHANGELOGLOCK (ID, LOCKED) VALUES (1, 0): ORA-00955: nome già utilizzato da un oggetto esistente

liquibase.exception.LockException: liquibase.exception.DatabaseException: Error executing SQL CREATE TABLE SYSTEM.DATABASECHANGELOGLOCK (ID INTEGER NOT NULL, LOCKED NUMBER(1) NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR2(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID)); on jdbc:oracle:thin:@localhost:1521:WBMDINSERT INTO SYSTEM.DATABASECHANGELOGLOCK (ID, LOCKED) VALUES (1, 0): ORA-00955: nome già utilizzato da un oggetto esistente

at liquibase.lockservice.LockServiceImpl.acquireLock(LockServiceImpl.java:122)
at liquibase.lockservice.LockServiceImpl.waitForLock(LockServiceImpl.java:62)
at liquibase.Liquibase.update(Liquibase.java:123)
at liquibase.integration.commandline.Main.doMigration(Main.java:848)
at liquibase.integration.commandline.Main.main(Main.java:138)
Caused by: liquibase.exception.DatabaseException: Error executing SQL CREATE TABLE SYSTEM.DATABASECHANGELOGLOCK (ID INTEGER NOT NULL, LOCKED NUMBER(1) NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR2(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID)); on jdbc:oracle:thin:@localhost:1521:WBMDINSERT INTO SYSTEM.DATABASECHANGELOGLOCK (ID, LOCKED) VALUES (1, 0): ORA-00955: nome già utilizzato da un oggetto esistente

at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:56)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:98)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:64)
at liquibase.database.AbstractJdbcDatabase.checkDatabaseChangeLogLockTable(AbstractJdbcDatabase.java:778)
at liquibase.lockservice.LockServiceImpl.acquireLock(LockServiceImpl.java:95)
... 4 more
Caused by: java.sql.SQLSyntaxErrorException: ORA-00955: nome già utilizzato da un oggetto esistente

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193)
at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:1033)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1329)
at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1909)
at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1871)
at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:318)
at liquibase.executor.jvm.JdbcExecutor$1ExecuteStatementCallback.doInStatement(JdbcExecutor.java:86)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:49)
... 8 more

First, it's quite strange it talks about "Apache Derby" since I'm using Oracle only.
Anyway, it is quite clear to me that for some reason Liquibase is not able to detect that SYSTEM.DATABASECHANGELOGLOCK is not existing, and tries recrearing it.
This absolutely does not happen on any other schema migration on the same DB.

Environment

Oracle

Reporter

Nathan Voxland

Fix versions

Affects versions

Priority

Critical
Configure