Quantcast
Channel: Liquibase Forums
Viewing all 2993 articles
Browse latest View live

Re : Using Liquibase on Teradata 14.

$
0
0
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://<hostname> /database=<dbname>
username=dbadmin
password=<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





Re : Using Liquibase on Teradata 14.

$
0
0
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

Re : Using Liquibase on Teradata 14.

$
0
0
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

Re : Using Liquibase on Teradata 14.

$
0
0
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.<init>(DatabaseSnapshot.java:33)
        at liquibase.snapshot.JdbcDatabaseSnapshot.<init>(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>
































Re : Using Liquibase on Teradata 14.

$
0
0
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/

Re : Using Liquibase on Teradata 14.

$
0
0
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

Re : Using Liquibase on Teradata 14.

$
0
0
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

Re : Using Liquibase on Teradata 14.

$
0
0
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

Re : Using Liquibase on Teradata 14.

$
0
0
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

How to apply programatically only change sets which wasn't run?

$
0
0
I try to update existing DB in this way:
Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation( new JdbcConnection(
connection ) );
Liquibase liquibase = new Liquibase( "db.changelog.xml", new FileSystemResourceAccessor(), database );

liquibase.update( "" );
But it tries to apply all change sets  including those which have been already applied earlier.  What do I wrong? 





duplicate identifiers

$
0
0
Hi gurus,

I have been using liquibase for longer than a year now, and have a pretty large project organized into several databasechangelog files, which are later combined into a larger one by means of the include directive.

I have stumbled upon a problem with duplicate identifiers when I add a new databasechangelog to my master file.
I know where the error comes from, I have two different files included which happen to have changsets with the same ids. However, that was done on purpose. It shouldn't be a problem so long as liquibase has a proper databasechangelog db table. 

My question is, is there a configuration setting, or workaround to force liquibase to skip duplicate identifier validation?

I know about this bug https://liquibase.jira.com/browse/CORE-1332 , but it is unrelated

Mine looks more like what somebody described here long ago.  https://www.mail-archive.com/liquibase-user@lists.sourceforge.net/msg01282.html

Any comments, or pointers will be highly appreciated.

Re : duplicate identifiers

$
0
0
There is not a configuration setting or workaround that I know of. 

I'm curious though why you would want this behavior. If you have two things with duplicate identifiers, how should the system decide which one to use? Are you referring to just the changeset id, or do you have things that have all three parts duplicated? (the changesetid, the author, and the path)

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

Re : duplicate identifiers

$
0
0
Thanks for your answer Steve. I am not quite sure if it was a good idea, but in order to allow "rebasing" in the future, we did something like this.

         base version x ( typical liquibase usage ). Base version x is always the same

               x  --->   x + 1 ---> x + 2

         base version y ( "rebasing" pattern). Base version y can be changed, and start creating upgrade scripts from a new base version at any time.

Scenario A)

               y  --->   y + 1 ---> y + 2 

(our db scripts went out of hand and are too long to run, or just inefficient,  we decide to clean y + 2 scripts a little bit, and start from scratch again, but  also allowing to upgrade all the way from y to y + 4. This results in two different paths. One in which you started from y or y + 1 all the way to y +2, and a different one in which you started from y + 2)

Scenario B)

            y + 2  ---> y + 3 ---> y + 4 
         
In order to support this kind of scenarios, which we don't do often, we have y + 2 changesets which share the id, author and have logicalFilenamePath set to a predefined value, so they look the same. No matter which path you took, liquibase will know if the changeset for y + 2 has been run or not by lookin at his databasechangelog.

The down side is that you can't have the changesets from both scenario A and B combined in the same top level changelog, since y +2 changesets will cause a duplicate identifiers validation error.

There is an easy fix for this, just removing y + 2 upgrade changesets from the build, but at the cost of losing one shot upgrades from release y, or y + 1 all the way to y + 4.

I hope my explanation makes sense, it is somewhat difficult to explain without graphics.

Many thanks for your answer again

         

Liquibase liquibase-maven-plugin does not run Integration Tests in Apache Maven

$
0
0
Hi
 
I am using Liquibase. I want the database tables to be created before the Integration Tests. What I can see is that the Integration Tests are not being run and the liquibase-maven-plugin version 3.2.2 runs last in the build process of Apache Maven.
 
The code is located on GitHib: https://github.com/rajivj2/example2/
 
The EmployeeJpaDAOIT.java is the class that contains the test. All I want to do is have the tables created before the test actually starts.
 
Can you please help?

 

preConditions doesn't work

$
0
0
I was hoping that this was already fixed, but it seems that it wasn't: https://liquibase.jira.com/browse/CORE-1992

Is there any workaround for this? There are changesets I can only run if a table or column does or doesn't exist. preConditions would be perfect and crucual for my case.

Validation and Output

$
0
0
Hi,

In the old sql script we had a validation ( just check if there is any invalid object in the database ), and after the validation if there is any invalid object we were printing the result with the ones that are invalid. This was really useful when you are running the script.

I partially fixed the problem using a precondition, and if there is any invalid object i just finish the execution of the script and i print the error message. But I would like to list the invalid objects also. Any Idea or suggestion ??

Current code:
  1. <!-- Check invalid objects in the Data Base -->
    <changeSet id="DataBaseCheck" author="e-ballo" runAlways="true" >
    <preConditions onFailMessage="There are invalid objects in the database!!" 
    onFail="HALT" >
    <sqlCheck expectedResult="0">
    <![CDATA[
    SELECT count(1)
    FROM all_objects alo
    WHERE status = 'INVALID'
    AND alo.owner in
    ('CIN','NOPA','ORC','PRV','SEC','TIPI_OWNER','TT','ZON');
    ]]>
    </sqlCheck>
    </preConditions>
    <sql>
    <![CDATA[
    SELECT alo.owner
    , alo.object_name
    , alo.status
    , alo.last_ddl_time
    FROM all_objects alo
    WHERE status = 'INVALID'
    AND alo.owner in
    ('CIN','NOPA','ORC','PRV','SEC','TIPI_OWNER','TT','ZON');
    ]]>
    </sql>
    </changeSet>
Thanks in advance

Re : Informix issues

$
0
0
Hi Nathan,

I had some further issues with the Informix support and I decided the fastest way for us to be able to use Liquibase was to fix them myself.

I set up a pull request here: https://github.com/liquibase/liquibase/pull/314
It's my first time using GitHub and making a pull request, so if there's any issues please let me know on the thread here or via GitHub.

Re : Informix issues

$
0
0
I got your pull request, and thanks for doing the work. They are definitely the easiest way to get a fix in.

Nathan

Re : Liquibase liquibase-maven-plugin does not run Integration Tests in Apache Maven

$
0
0
What Maven goal do you run to cause this problem? This sounds like a configuration problem. You have the Liquibase plugin set to run in the pre-integration-test phase which means you will need to specifically need to target the integration-test goal for it to fire.

This didn't fire the Liquibase plugin: mvn test

This did fire the Liquibase plugin: mvn integration-test

Try using the integration-test goal.

Re : Liquibase liquibase-maven-plugin does not run Integration Tests in Apache Maven

$
0
0
I have run the mvn integration-test phase on the Command Prompt but still there are problems. It throws the following Exception:
 
Caused by: org.hibernate.HibernateException: Missing table: employee
 
I am specificing the following in the pom.xml:
 
  1. < plugins >
  2.   < plugin >
  3.   < groupId > org.apache.maven.plugins </ groupId >
  4.    < artifactId > maven -failsafe-plugin </ artifactId>
  1.    < version > 2.12.4 </ version >
  1. < configuration >
  2. < encoding > utf-8 </ encoding >
  3. </ configuration >
  4. < executions >
  5. < execution >
  6. < goals >
  7. < goal > integration-test </ goal >
  8. < goal > verify </ goal >
  9. </ goals >
  10. </ execution >
  11. </ executions >
  12. </ plugin >
  13. < plugin >
  14. < groupId > org.liquibase </ groupId >
  15. < artifactId > liquibase -maven-plugin </ artifactId >
  16. < version > 3.2.2 </ version >
  17. < configuration >
  18. < propertyFile > src/main/resources/server-internal2.properties </ propertyFile >
  19. < changeLogFile > src/main/resources/db-changelog-employee.xml </ changeLogFile >
  20. < promptOnNonLocalDatabase > false </ promptOnNonLocalDatabase >
  21. < logging > debug </ logging >
  22. </ configuration >
  23. < executions >
  24. < execution >
  25. < phase > pre -integration-test </ phase >
  26. < goals >
  27. < goal > update </ goal >
  28. </ goals >
  29. </ execution >
  30. </ executions >
  31. </ plugin >

The liquibase plugin is creating the tables but they can't be found. What is wrong? Could you please look at the example project: https://github.com/rajivj2/example2/ on GitHub.

Viewing all 2993 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>