Use SQL Plus and Oracle proxy user

Last updated: July 14, 2025

You can use the SQL Plus proxy user feature with Liquibase Pro 4.4.1 and later versions if multiple users share the same schema and do not want to provide the schema credentials to each user.

When using a proxy user to connect to a schema, you do not need to share the password, only the username. A proxy user is a user who connects to the database on behalf of another user, usually a client user. A proxy user connects with the username and password set for them without knowing the client user's password.

Note: For more information about the Oracle proxy user setup, see Proxy Authentication.

With Liquibase Pro, you can use the runwith:sqlplus attribute and connect to the environment that requires a proxy user. You can set URL properties that contain your proxy user configuration to deploy SQL Plus changesets to a database.

Procedure

1

Add an SQL Plus changeset to your changelog file.

--liquibase formatted sql
--changeset user:45679-runWith_sqlplus-example runwith:sqlplus
CREATE TABLE mytable (
  id NUMBER NOT NULL,
  description VARCHAR2 (50) NOT NULL
);
2

Set proxy values as your username in the Liquibase properties file, environment variables, or on the command line at runtime.

url: jdbc:oracle:thin:proxy_user[client_user]/@host:port/servicename
username: proxy_username[client_username]
password: proxyuserpass

Note: The proxy_user is the user that will initiate the connection and emulate the client_user. The client_user is the user whose privileges, schema, objects will be available for the session.

3

Run the update command to apply changes.

liquibase update --changelog-file changelog.sql

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;
    /

Use SQL Plus and Oracle proxy user - Liquibase