Shay Shmeltzer's Oracle Development Tools Tips

Versioning Oracle Database Objects & CI/CD with Liquibase - An Update

Shay Shmeltzer
Director of Product Management - Oracle

Back in 2017 I wrote a blog entry with a demo video showing how to manage the development lifecycle of database objects in a database with Liquibase and Oracle Developer Cloud Service. That post, which also acted as a brief intro to Liquibase concepts, has been quite popular, and it's time for an update that will reflect a couple of new features Oracle added that makes life even simpler.

Liquibase as Part of SQLcl

Oracle has been investing resources at building better support for the Oracle database into Liquibase, contributing enhancements back to the community. In parallel, support for Liquibase commands has been added to the SQLcl utility - detailed doc here. These new features allow you to issue direct Liquibase commands as part of your work with an Oracle database. These changes further contributed to the adoption of Liquibase as a framework for managing database objects lifecycle across instances of Oracle DBs.

Visual Builder Studio

Another change is that Oracle transitioned Developer Cloud Service to a new name - Oracle Visual Builder Studio - adding many new features to the service. One update is the inclusion of the latest version of SQLcl utility in the list of software you can configure for build machines. Which makes it easier to incorporate Liquibase commands into your CI/CD pipelines (no need to leverage maven or include the jar files in your build process). You can simply write the Liquibase commands as part of the SQLcl script you are running in your build.

Let's see how these two enhancement make the lifecycle simpler

Lifecycle Demo

The video below aims to show a simple approach to replicating structure of database schemas across multiple databases in a consistent and automated way. 

In the video below I show the following flow:

  • Start with a new project in Visual Builder Studio that includes a git repo
  • Clone the git into your local machine
  • Use SQLcl on your machine to create a controller file with the lb gencontrolfile command
  • Use the command "lb genobject table" to generate object definition file for a table in your local DB
  • Add a reference to that file to your controller.xml file
  • Push the changes into the git repository in Visual Builder Studio
  • Define a build job that is hooked to your Git repo, connects to a DB, and update that DB schema with the objects definitions from our git repo
  • Execute the job

Then we go through a change management flow:

  • Create a new table in your local DB
  • Generate a Liquibase definition file for the new table
  • Modify the controller.xml file to include a pointer to the new file
  • Push the additions and changes into the Git repo
  • The change automatically starts a CI/CD pipeline that deploys the changes to another database instance - in this case an Oracle ATP database in the Oracle cloud. This is done with the lb update (and lb status) SQLcl commands.

With this type of flow it is easy to keep multiple database instances with the same structure of objects. Useful for synching your dev/test/prod environments in a consistent way.

Try It Out

As a quick reminder - any customer of Oracle Cloud can spin up an instance of Oracle Visual Builder Studio and get the free git repos (along with issue tracking, wiki, agile and sprint management features and more). You will only need to pay if you execute CI/CD pipeline for the time that the build compute instance is up and running.

Give it a go and see how we can help streamline your DB DevOps.

Join the discussion

Comments ( 3 )
  • Jun Wednesday, July 29, 2020
    Great tutorial of integrating liquibase with VB studio.

    If I have an atp in a private subnet of a vcn, is the above integration could still be used to do db migration? Is there more prerequisite steps required?
  • Shay Shmeltzer Thursday, July 30, 2020
    Jun - the build VM that VBS runs can be configured to run as part of your VCN - and should be able to access and deploy on your ATP behind that VCN. See the doc - https://docs.oracle.com/en/cloud/paas/visual-builder/visualbuilder-administration/service-setup.html#GUID-519D6C85-9CFE-4082-A489-7FB9FCA6AC04
  • Johannes Michler Saturday, February 20, 2021
    Hi Shay,

    Thanks for this excellent blog post and video. Is there any best practice on how to combine this with an E-business Suite environment?

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.