Leveraging Oracle’s schema only user (18c+) and heres the LB properties file :
url=jdbc:oracle:thin:least_priv_user/@0.0.0.0:1521/XEPDB1
username: liquibase_admin
password: liquibase_admin123
Pre-Steps ( outside of the liquibase )
grant create session to liquibase_admin;
alter user least_priv_user grant connect through liquibase_admin;
Question : Upon doing an liquibase update
- why does this work only if GRANT ALL PRIVILEGES to liquibase_admin;
- db change logs tables gets created in both schemas - Not sure why
If a GRANT ALL PRIVILEGES to liquibase_admin privileges is not given :
The below error occurs :
Unexpected error running Liquibase: ORA-01031: insufficient privileges
[Failed SQL: (1031) CREATE TABLE LIQUIBASE_ADMIN.DATABASECHANGELOGLOCK (ID INTEGER NOT NULL, LOCKED NUMBER(1) NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR2(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID))]
- If the lb_admin is only given create TABLE privileges then the below error occurs when processing changelog :
Reason: liquibase.exception.DatabaseException: ORA-01031: insufficient privileges
…