Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Liquibase Export Data from Oracle Database - generateChangeLog

Tags:

liquibase

I am trying to export data from an Oracle (ojdbc7) database using liquibase.

My property file has below options:

  • driver: oracle.jdbc.driver.OracleDriver
  • url: jdbc:oracle:thin:@localhost:1521:XE
  • username: user
  • password: user
  • outputChangeLogFile:src/main/resources/output.xml
  • defaultSchemaName: USERS

In STS I used below command to generate the changelog liquibase:generateChangeLog -DdiffTypes="data"

and through command prompt I used: mvn liquibase:generateChangeLog -DdiffTypes="data"

But nothing works, I got only crateTable commands not the insert queries.

Please guide.

like image 869
Vasudevan Nair R Avatar asked Jan 13 '17 04:01

Vasudevan Nair R


2 Answers

mvn liquibase:generateChangeLog -Dliquibase.diffTypes=data

should work

like image 174
xLatency Avatar answered Dec 01 '22 15:12

xLatency


I would suggest try to export data via CLI liquibase version. Download it here, unpack, put ojdbc7.jar into liquibase folder:

liquibase --driver=oracle.jdbc.OracleDriver \
      --classpath=\path\to\classes:ojdbc7.jar \
      --changeLogFile=db.changelog.xml \
      --url="jdbc:oracle:thin:@localhost:1521:XE" \
      --username=user \
      --password=user \
      --diffTypes="data" generateChangeLog

If everything will work fine we can move to the next step - try to migrate data via maven.

like image 30
Vladislav Kysliy Avatar answered Dec 01 '22 17:12

Vladislav Kysliy