Deploying changes to DB2 on z/OS using SQL scripts
Step 1: Create an SQL Folder
In the Liquibase project folder that you created, create an
sql_files folder. This is the folder in which you will place SQL scripts that Liquibase will track, version, and deploy.
The directory structure should look like this:
Step 2: Setup the Changelog
This is a one-time step to configure a change log to point to the
sql folder that will contain SQL scripts. Create and save a file in the Liquibase project directory you created (
$LB_HOME/db2_zos). The file should be named
The contents of
db2zosChangeLog.xml should be as follows:
Step 3: Add an SQL Script to the SQL Folder
liquibase.properties file from the Deploying Changes to DB2 on z/OS using SQL Scripts topic and the newly created
db2zosChangeLog.xml, we are now ready to start adding SQL scripts to the
sql_files folder. Liquibase will order the scripts in the folder alphanumerically.
Create a file named
001_create_person_table.sql with the following and save it in the
Step 4: Deploy your Change
We are now ready to deploy the script! Open a terminal and navigate to
$LB_HOME/liquibase update if on a UNIX system or
$LB_HOME\liquibase.bat update if on Windows.
You will see that your database now contains a table called PERSON.
Step 5: Check your Database
You will notice two other tables are created as well:
The DATABASECHANGELOG table contains a list of all the changes that have been run against the database. The DATABASECHANGELOGLOCK table is used to make sure two machines don’t attempt to modify the database at the same time.
Common Command Line Arguments
Use can use command line arguments to over-ride the default options at runtime. The following are common command line arguments:
|Command Line Argument||Action|
||Specify the XML changelog|
||Specify a database URL|
||Specify the properties file (default: ./liquibase.properties)|