Using Liquibase with DB2 on z/OS
Step 1: Download and Extract Liquibase
- Download Liquibase. Visit the download page to get the latest binary.
- After downloading the *.zip or *.tar.gz, extract the contents into a folder.
Note: You may want to add this folder to your system PATH environment so that you can execute Liquibase from any directory.
For this tutorial, we will refer to that directory as
LB_HOME, and when executing the Liquibase shell script will use
LB_HOME\liquibase.bat as the example command.
Step 2: Install Java
- Java is a required dependency. Install Java if it is not already installed.
- Validate that you have a working Java version. On the command line, execute:
Ensure that it runs successfully and displays your installed Java version.
Step 3: Download the DB2JCC Driver and License File
The license JAR file is required when connecting to a mainframe DB2 database, which is not a free JAR file. You must purchase the DB2 Connect product. The license file is contained within the activation package for it. More information regarding the license file can be found here.
- Download the DB2JCC driver, which can be found here.
- Copy the
db2jcc_license_cisuz.jarfiles into the
libsubdirectory of the
LB_HOMEdirectory where you extracted the Liquibase archive.
Step 4: Setup the liquibase.properties File
While it is possible to pass all required parameters, such as the JDBC driver and database URL on the command line, it is much easier to configure a liquibase.properties file.
Pro Tip: Create multiple liquibase.properties files for your DEV, QA, and PROD environments. You can pass the specific properties file as a Liquibase command line argument.
Create a new directory for your first Liquibase project, and change into that directory. For this example, we named the directory db2_zos
Create a plain text file named liquibase.properties in the project directory you just created and add the following content to the file.
Note: Be sure to replace the
with the actual values for your system.
Ensure that you can execute Liquibase. At the command prompt, run one of the following commands, depending on your platform:
You should now see some help output, and you are ready to begin using Liquibase. That is the completion of this Setup Tutorial. You are now ready to continue with deployment.