Use native executors with Oracle Database

Last updated: July 14, 2025

This page describes how to use Liquibase with the SQL Plus native executor on an Oracle database.

Before you begin

  • Download and install Liquibase (version 3.10.0+).

  • Add SQL Plus to your PATH environment variable. Alternatively, pass its location in the liquibase.sqlplus.conf file or from the command prompt during runtime.

  • To use Liquibase and SQLCMD with Windows Integrated Security, follow the steps from Using Liquibase and MSSQL Server with Windows Integrated Security.

Procedure

1

Setup

Liquibase searches the executor location in the following order: runtime arguments, .conf file values, and then your PATH.

Add the runWith attribute to the needed changesets in the changelog:

  1. SQL: runWith:sqlplus

  2. XML: runWith="sqlplus"

  3. YAML: runWith: sqlplus

  4. JSON: "runWith": "sqlplus"

2

Specify the SQL Plus integration arguments in one of the following ways

Specify the SQL Plus integration arguments in one of the following ways:

  • Pass the values at runtime on the command line.

  • Add the values to liquibase.sqlplus.conf or the Liquibase properties file.

  • Set the values as environment variables.

  • Run the values as Java system properties (JAVA_OPTS) along with any command at the command prompt.

Setup examples

set JAVA_OPTS=-Dliquibase.sqlplus.<option>=<value> && liquibase <command> --changelog-file=my_script.sql

3

Run a Liquibase command

Any Liquibase command will work. You can use.

liquibase status --changelog-file=my_script.sql

Note: If the command fails, you will receive an error message. However, if you add a property that is not used in Liquibase to the liquibase.sqlplus.conf file, no error occurs. Liquibase only ignores it.

Examples

--liquibase formatted sql

--changeset myauthorname:2314 runWith:sqlplus

    DECLARE l_emp_name VARCHAR2(250);
    l_emp_no NUMBER;
    l_salary NUMBER;

    l_manager VARCHAR2(250);
    BEGIN
    INSERT INTO emp(emp_name,emp_no,salary,manager) VALUES('BBB',1000,25000,'AAA');

    ...
    END;
    /