liquibase.exception.DatabaseException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • When I create a table in Oracle with a column of type "NUMBER" without mentioning its precision or scale: {code:sql} CREATE TABLE example ( id NUMBER ); {code} Then generateChangeLog will generate the following XML structure: {code:xml} <changeSet author="user (generated)" id="1360601396312-1"> <createTable tableName="EXAMPLE"> <column name="ID" type="NUMBER(0,-127)"/> </createTable> </changeSet> {code} When executing this changeSet on an Oracle database, I get the following exception: {code} SEVERE 2/11/13 6:01 PM:liquibase: Change Set test.xml::1360601396999-1::user (generated) failed. Error: Error executing SQL CREATE TABLE EXAMPLE (ID NUMBER(0,-127)): ORA-01727: numeric precision specifier is out of range (1 to 38) liquibase.exception.DatabaseException: Error executing SQL CREATE TABLE EXAMPLE (ID NUMBER(0,-127)): ORA-01727: numeric precision specifier is out of range (1 to 38) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:62) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:104) at liquibase.database.AbstractDatabase.execute(AbstractDatabase.java:1091) at liquibase.database.AbstractDatabase.executeStatements(AbstractDatabase.java:1075) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:317) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:27) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:58) at liquibase.Liquibase.update(Liquibase.java:114) at liquibase.integration.commandline.Main.doMigration(Main.java:825) at liquibase.integration.commandline.Main.main(Main.java:134) Caused by: java.sql.SQLSyntaxErrorException: ORA-01727: numeric precision specifier is out of range (1 to 38) 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:92) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55) ... 9 more {code} I can work around this issue by modifying the XML and changing "NUMBER(0,-127)" into "NUMBER".
    via by Andy Goossens,
  • When I create a table in Oracle with a column of type "NUMBER" without mentioning its precision or scale: {code:sql} CREATE TABLE example ( id NUMBER ); {code} Then generateChangeLog will generate the following XML structure: {code:xml} <changeSet author="user (generated)" id="1360601396312-1"> <createTable tableName="EXAMPLE"> <column name="ID" type="NUMBER(0,-127)"/> </createTable> </changeSet> {code} When executing this changeSet on an Oracle database, I get the following exception: {code} SEVERE 2/11/13 6:01 PM:liquibase: Change Set test.xml::1360601396999-1::user (generated) failed. Error: Error executing SQL CREATE TABLE EXAMPLE (ID NUMBER(0,-127)): ORA-01727: numeric precision specifier is out of range (1 to 38) liquibase.exception.DatabaseException: Error executing SQL CREATE TABLE EXAMPLE (ID NUMBER(0,-127)): ORA-01727: numeric precision specifier is out of range (1 to 38) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:62) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:104) at liquibase.database.AbstractDatabase.execute(AbstractDatabase.java:1091) at liquibase.database.AbstractDatabase.executeStatements(AbstractDatabase.java:1075) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:317) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:27) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:58) at liquibase.Liquibase.update(Liquibase.java:114) at liquibase.integration.commandline.Main.doMigration(Main.java:825) at liquibase.integration.commandline.Main.main(Main.java:134) Caused by: java.sql.SQLSyntaxErrorException: ORA-01727: numeric precision specifier is out of range (1 to 38) 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:92) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55) ... 9 more {code} I can work around this issue by modifying the XML and changing "NUMBER(0,-127)" into "NUMBER".
    via by Andy Goossens,
  • Executing SQL Script via Ant
    via Stack Overflow by user1259318
    ,
  • 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.
    via by Nathan Voxland,
  • 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.
    via by Nathan Voxland,
  • Hibernate - Table or view doesnt not exist error
    via Stack Overflow by rufy
    ,
    • liquibase.exception.DatabaseException: Error executing SQL CREATE TABLE EXAMPLE (ID NUMBER(0,-127)): ORA-01727: numeric precision specifier is out of range (1 to 38) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:62) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:104) at liquibase.database.AbstractDatabase.execute(AbstractDatabase.java:1091) at liquibase.database.AbstractDatabase.executeStatements(AbstractDatabase.java:1075) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:317) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:27) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:58) at liquibase.Liquibase.update(Liquibase.java:114) at liquibase.integration.commandline.Main.doMigration(Main.java:825) at liquibase.integration.commandline.Main.main(Main.java:134) Caused by: java.sql.SQLSyntaxErrorException: ORA-01727: numeric precision specifier is out of range (1 to 38) 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:92) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55) ... 9 more

    Users with the same issue

    jpvee
    2 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    577 more bugmates