X

Shay Shmeltzer's Oracle Development Tools Tips

Automating DevOps for the Oracle Database with Developer Cloud Service and SQLcl

Shay Shmeltzer
Director of Product Management - Oracle

In the previous blog entry I showed how you can leverage Oracle Developer Cloud Service (DevCS) to manage the lifecycle of your database creation scripts (version management, branching, code reviews etc).

But how do you make sure that your actual database is in synch with the changes that you make in your scripts?

This is another place where DevCS can come to the rescue with the built-in continuous integration functionality it provides. Specifically with the new features for database integration including secure DB connection specification, and leveraging the powerful SQL Command Line (SQLcl) - the new command line interface to the Oracle DB - which is built-in in the DevCS build servers.

In the video below I go through a process where a check-in of SQL script code change automatically initiate a build process that modifies a running database.

A few points to note:

 

  • For the sake of simplicity, the demo doesn't follow the recommended step of a code review before merging changes into the master branch (you can see how to do that here).
  • The demo automates running the build whenever a change to the scripts is done. You could also define a scenario where the build runs at a specific time every day - for example at 1am - and synch the DB to today's scripts.
  • You can further extend the scenario shown here of dropping and re-creating objects to add steps to populate the DB with new data and even run tests on the new database.

As you can see Developer Cloud Service can be a very powerful engine for your database DevOps - and it is included for free with your Oracle Database Cloud Services - so give it a try

DB Build

 

Related blog entries:

Join the discussion

Comments ( 2 )
  • Christoph Ruepprich Tuesday, October 17, 2017
    Shay,
    thanks for the tutorial. I do have an issue when running a sql script that calls other sql scripts. My git repo has a directory named "install". Inside install I have two scripts: build.sql and test.sql.
    Build.sql simply calls test.sql like this:
    @test.sql

    I configured the build with a sqlcl step that calls the build.sql file.

    When I build, I get an error that test.sql cannot be found.
    I tried "install/test.sql", but that didn't work either. How can I reference other scripts in the script that I call?

    Thanks a bunch!
    C
  • shay Tuesday, October 17, 2017
    Christoph, this is a known limitation that we are fixing in an upcoming version. In the meantime you can use inline SQLcl command to change to the build directory.
    (something like: cd ~/hudson/workspace/developer....)
    And then execute your source script @install
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.