Error on SYSTEM.DATABASECH ANGELOGLOCK while re-executing a migration

Hello,

absolutely new to Liquibase, I’m running my first tests.

I’m using Ant task updateDatabase and change sets defined directly inside SQL scripts using comments like

–liquibase formatted sql

–changeset com.noemalife:1 dbms:oracle

etc.


The first run works fine, all change sets are executed and DB objects (oracle) are deployed. I can see Davide

Update:

I have this problem when I run Liquibase with the Oracle “system” user (my patch cares about creating a couple of other users, thus for testing purposes I use system directly to do that).

The other strange thing is that after the system’s patch run succesfully, in the lock table I can still see the lock is active.

When I run other patches in other schemas(ex. the ones created by the system’s patch), I have the patch completing successfully and the lock released in the lock table; relaunching that patch behaves as expected: Liquibase detects the patch is already in place ad does nothing.


This said, now my doubt is if Liquibase has problems, in the system schema, in detecting the lock table is already existing (and fails trying to deploy it) or if there is some kind of locking/commit problem.


Any suggestion is welcome


Thanks

Made new tests, it’s not a matter of lock.


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


Thanks

The log about Derby is fine, Liquibase checks for the driver since it supports Derby and just logs that it doesn’t find it.


I’m suspicious the problem is related to liquibase using the SYSTEM schema to determine if an object is a system object vs. a “normal” object. I created https://liquibase.jira.com/browse/CORE-1415 to help track the issue.


Nathan