Use native executors with Oracle Database

Last updated: January 23, 2026

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

export 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.

SQL Plus integration arguments

Note: Syntax for each parameter is specified in kebab-case (CLI and flow file), camelCase (properties file and JAVA_OPTS), and MACRO_CASE (environment variable).

Syntax (--cli, propertiesFile, ENV_VAR)

Type

Description

--sqlplus-args liquibase.sqlplus.args LIQUIBASE_SQLPLUS_ARGS

String

Defines extra arguments to pass to the sqlplus executable. For more information, see SQL Plus documentation.

Note: The delimiter for arguments is a space " ". Do not use a comma "," or semicolon ";".

--sqlplus-create-spool liquibase.sqlplus.createSpool LIQUIBASE_SQLPLUS_CREATE_SPOOL

Boolean

If true, create an Oracle spool file which captures the SQLPlus output. Default: true. When create spool = false, the spool file does not generate.

--sqlplus-keep-temp liquibase.sqlplus.keep.temp LIQUIBASE_SQLPLUS_KEEP_TEMP

Boolean

Indicates whether or not to keep a temporary SQL file after the execution of SQL Plus. If true, the file is not deleted. This setting is not required to keep the temporary file, only create-spool is. Default: false.

--sqlplus-keep-temp-name liquibase.sqlplus.keep.temp.name LIQUIBASE_SQLPLUS_KEEP_TEMP_NAME

String

Indicates the name of a temporary SQL file after the execution of SQL Plus. If no file name is specified, a name is automatically generated. In Oracle, if no file extension is specified, the file is saved as .lst.

--sqlplus-keep-temp-overwrite liquibase.sqlplus.keep.temp.overwrite LIQUIBASE_SQLPLUS_KEEP_TEMP_OVERWRITE

Boolean

Overwrites any files in the specified directory with the same name. Default: true.

--sqlplus-keep-temp-path liquibase.sqlplus.keep.temp.path LIQUIBASE_SQLPLUS_KEEP_TEMP_PATH

String

Specify the path in which to store the temporary files after the execution of SQL Plus. If not specified, the files will be stored in the system's temp directory.

--sqlplus-password liquibase.sqlplus.password LIQUIBASE_SQLPLUS_PASSWORD

String

Liquibase 4.29.2+. Password to use with the native executor, such as the password for an account with SYSDBA privileges. Liquibase will attempt to use the password exactly as entered.

--sqlplus-path liquibase.sqlplus.path LIQUIBASE_SQLPLUS_PATH

String

Path to sqlplus executable. For example:

Linux:

/opt/oracle/product/19.0.0/client/bin/sqlplus

or

/u01/app/oracle/product/19.0.0/dbhome_1/bin/sqlplus

Windows:

C:\oracle\product\19.0.0\dbhome_1\bin\sqlplus.exe

--sqlplus-sqlerror liquibase.sqlplus.sqlerror LIQUIBASE_SQLPLUS_SQLERROR

String

Control the outcome when Liquibase returns a SQL error. The error clause is passed directly to Oracle. Default: WHENEVER SQLERROR EXIT FAILURE. Accepted values include:

WHENEVER SQLERROR EXIT FAILURE

WHENEVER SQLERROR EXIT ROLLBACK

WHENEVER SQLERROR EXIT ERROR

WHENEVER SQLERROR EXIT WARNING

WHENEVER SQLERROR EXIT SUCCESS

--sqlplus-timeout liquibase.sqlplus.timeout LIQUIBASE_SQLPLUS_TIMEOUT

Integer

Indicates seconds to wait for the sqlplus timeout. -1 disables the timeout. 0 returns an error. Default: 1800 (30 minutes).

--sqlplus-username liquibase.sqlplus.username LIQUIBASE_SQLPLUS_USERNAME

String

Liquibase 4.29.2+. Username to use with the native executor, such as account.username as sysdba to access Liquibase with an account that has SYSDBA privileges. Liquibase will attempt to use the name exactly as entered.

Examples

loading

loading

loading

loading

loading

loading