Using Liquibase on Teradata 14.

I am able to use liquibase on SQL Server without problems. However, if I try it on Teradata 14 I get the error below. I downloaded the jdbc from Teradata and downloaded the latest liquibase teradata extension which is liquibase-terdata-3.0.jar

I don’t get the meaning of the error message. It looks like it is looking at SQL Server because of “information_schema”.

What am I missing?

D:\liquibase-3.2.2-binTeradata>liquibase  --changeLogFile=D_THTR_DM_S.xml genera

teChangeLog

Unexpected error running Liquibase: liquibase.exception.DatabaseException: com.t

eradata.jdbc.jdbc_4.util.JDBCException: [Teradata Database] [TeraJDBC 14.00.00.4

1] [Error 3802] [SQLState 42S02] Database ‘information_schema’ does not exist.

Do you have a liquibase.properties file that may be affecting the result?

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

Hi Steve,

Thanks for responding. Here is the property file I am using:

driver=com.teradata.jdbc.TeraDriver
classpath=liquibase.jar;terajdbc4.jar;tdgssconfig.jar;liquibase-teradata-3.0.jar
url=jdbc:teradata:// /database=

username=dbadmin
password=

I am just creating a changeLogFile since my database is already existing. I noticed that the Liquibase tables, DATABASECHANGELOG and DATABASECHANGELOGLOCK are not created in Teradata, unlike with MS SQL.

Attached is a screenshot of the Liquibase folder I have and its contents.

Thanks

Chris

Database Engineer

Data Engineering Services

Walt Disney Studios

It seems to be expecting to find an information_schema which probably doesn’t exist in teradata. Can you run with --logLevel=DEBUG and post the full stackTrace you are getting?

Nathan

I did that and no stackTrace came out

D:\liquibase-3.2.2-binTeradata>liquibase --changeLogFile=D_THTR_DM_S.xml generateChangeLog --logLevel=DEBUG
Unexpected error running Liquibase: liquibase.exception.DatabaseException: com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata Database] [TeraJDBC 14.00.00.41] [Error 3802] [SQLState 42S02] Database ‘information_schema’ does not exist.

D:\liquibase-3.2.2-binTeradata>

This is all that was displayed

Thanks

Chris

Ok I got the debug to work, here it is:

D:\liquibase-3.2.2-binTeradata>liquibase --logLevel=DEBUG --changeLogFile=D_THTR
_DM_S.xml generateChangeLog
DEBUG 9/18/14 1:24 PM: liquibase: Connected to DBADMIN@jdbc:teradata
DEBUG 9/18/14 1:24 PM: liquibase: Not adjusting the auto commit mode; it is alre
ady true
DEBUG 9/18/14 1:24 PM: liquibase: Executing QUERY database command: SELECT DATAB
ASE
DEBUG 9/18/14 1:24 PM: liquibase: Computed checksum for 1411071846832 as 5480f31
d56f4801ec3f36ad2aa8d4ea5
Unexpected error running Liquibase: liquibase.exception.DatabaseException: com.t
eradata.jdbc.jdbc_4.util.JDBCException: [Teradata Database] [TeraJDBC 14.00.00.4
1] [Error 3802] [SQLState 42S02] Database ‘information_schema’ does not exist.

SEVERE 9/18/14 1:24 PM: liquibase: liquibase.exception.DatabaseException: com.te
radata.jdbc.jdbc_4.util.JDBCException: [Teradata Database] [TeraJDBC 14.00.00.41
] [Error 3802] [SQLState 42S02] Database ‘information_schema’ does not exist.
liquibase.exception.LiquibaseException: liquibase.command.CommandExecutionExcept
ion: liquibase.exception.DatabaseException: com.teradata.jdbc.jdbc_4.util.JDBCEx
ception: [Teradata Database] [TeraJDBC 14.00.00.41] [Error 3802] [SQLState 42S02
] Database ‘information_schema’ does not exist.
        at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLo
g(CommandLineUtils.java:139)
        at liquibase.integration.commandline.Main.doMigration(Main.java:904)
        at liquibase.integration.commandline.Main.run(Main.java:170)
        at liquibase.integration.commandline.Main.main(Main.java:89)
Caused by: liquibase.command.CommandExecutionException: liquibase.exception.Data
baseException: com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata Database]
[TeraJDBC 14.00.00.41] [Error 3802] [SQLState 42S02] Database ‘information_schem
a’ does not exist.
        at liquibase.command.AbstractCommand.execute(AbstractCommand.java:13)
        at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLo
g(CommandLineUtils.java:137)
        … 3 more
Caused by: liquibase.exception.DatabaseException: com.teradata.jdbc.jdbc_4.util.
JDBCException: [Teradata Database] [TeraJDBC 14.00.00.41] [Error 3802] [SQLState
 42S02] Database ‘information_schema’ does not exist.
        at liquibase.snapshot.ResultSetCache.get(ResultSetCache.java:77)
        at liquibase.snapshot.JdbcDatabaseSnapshot$CachingDatabaseMetaData.getUn
iqueConstraints(JdbcDatabaseSnapshot.java:448)
        at liquibase.snapshot.jvm.UniqueConstraintSnapshotGenerator.listConstrai
nts(UniqueConstraintSnapshotGenerator.java:88)
        at liquibase.snapshot.jvm.UniqueConstraintSnapshotGenerator.addTo(Unique
ConstraintSnapshotGenerator.java:70)
        at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGen
erator.java:72)
        at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorC
hain.java:50)
        at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGen
erator.java:62)
        at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorC
hain.java:50)
        at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGen
erator.java:62)
        at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorC
hain.java:50)
        at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGen
erator.java:62)
        at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorC
hain.java:50)
        at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGen
erator.java:62)
        at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorC
hain.java:50)
        at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGen
erator.java:62)
        at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorC
hain.java:50)
        at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:153
)
        at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.ja
va:226)
        at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.ja
va:248)
        at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnap
shot.java:185)
        at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:167
)
        at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:56)
        at liquibase.snapshot.DatabaseSnapshot.(DatabaseSnapshot.java:33)
        at liquibase.snapshot.JdbcDatabaseSnapshot.(JdbcDatabaseSnapshot.j
ava:22)
        at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGe
neratorFactory.java:126)
        at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGe
neratorFactory.java:119)
        at liquibase.command.DiffCommand.createReferenceSnapshot(DiffCommand.jav
a:190)
        at liquibase.command.DiffCommand.createDiffResult(DiffCommand.java:140)
        at liquibase.command.GenerateChangeLogCommand.run(GenerateChangeLogComma
nd.java:45)
        at liquibase.command.AbstractCommand.execute(AbstractCommand.java:8)
        … 4 more
Caused by: com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata Database] [Ter
aJDBC 14.00.00.41] [Error 3802] [SQLState 42S02] Database ‘information_schema’ d
oes not exist.
        at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDatabaseSQLException(E
rrorFactory.java:307)
        at com.teradata.jdbc.jdbc_4.statemachine.ReceiveInitSubState.action(Rece
iveInitSubState.java:108)
        at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.subStateM
achine(StatementReceiveState.java:321)
        at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.action(St
atementReceiveState.java:202)
        at com.teradata.jdbc.jdbc_4.statemachine.StatementController.runBody(Sta
tementController.java:123)
        at com.teradata.jdbc.jdbc_4.statemachine.StatementController.run(Stateme
ntController.java:114)
        at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.jav
a:381)
        at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.jav
a:323)
        at com.teradata.jdbc.jdbc_4.TDStatement.doNonPrepExecuteQuery(TDStatemen
t.java:311)
        at com.teradata.jdbc.jdbc_4.TDStatement.executeQuery(TDStatement.java:10
87)
        at liquibase.snapshot.ResultSetCache$ResultSetExtractor.executeAndExtrac
t(ResultSetCache.java:185)
        at liquibase.snapshot.JdbcDatabaseSnapshot$CachingDatabaseMetaData$6.fas
tFetchQuery(JdbcDatabaseSnapshot.java:467)
        at liquibase.snapshot.ResultSetCache$SingleResultSetExtractor.fastFetch(
ResultSetCache.java:262)
        at liquibase.snapshot.ResultSetCache.get(ResultSetCache.java:55)
        … 33 more

For more information, use the --logLevel flag

D:\liquibase-3.2.2-binTeradata>

I looked at the Teradata code on Github and it doesn’t seem to mention the string ‘information_schema’ anywhere.

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

Am I missing some drivers or using the wrong ones?

Here where I downloaded the following:

Liquibase : http://sourceforge.net/projects/liquibase/files/Liquibase%20Core/liquibase-3.2.2-bin.zip/download

Teradata Extensions (3.0): https://github.com/liquibase/liquibase-teradata/releases

Teradata JDBC: https://downloads.teradata.com/download/license?destination=download/files/7424/187200/1/TeraJDBC__indep_indep.14.10.00.39.zip&message=License%2520Agreement

Is it also confusing with my SQL Server extensions? But my SQL Server version is on a totally separate Liquibase folder

Chris

Nathan

Thank you so much for the info.

Since the Teradata extension is a contributed code, does this mean that this won’t have a fix to work with ChangeLog/GenreateChangeLog commands?

Thanks

Chris

On further review, it looks like the Teradata extension does not support any snapshot logic which would include generateChangeLog, unfortunately. The Teradata support was contributed code and I thought it included it, sorry. The extension should be overriding the default behavior of querying INFORMATION_SCHEMA with a call to DBC instead but that was not implemented.

From what I understand, the Teradata extension should work well for update/updateSQL commands, but will not work for diff/diffChangeLog/generateChangelog commands or preconditions that check the database state.

Nathan

Support can certainly be implemented, it’s just that I don’t have a local teradata database currently to test against in order to do the work myself. I may be able to get to it at some point, but it probably won’t be for a month or two. If you wanted to look at implementing it yourself beforehand you certainly could. If you are, let me know and I can give you some pointers.

Nathan