X

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.

Be the first to comment

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