liquibase: Don't use v$session in Oracle as the SELECT grant on this view is not usually available to any user

Description In Oracle multiuser and multitenant environments the SELECT grant on v$session is usually not available for any user. To do a SELECT from this view is usually enabled by granting SELECT_CATALOG_ROLE to the user. However, in more restricted environments this is not done due to security and privacy concerns.

There is a solution, to call DBMS_UTILITY.DB_VERSION stored procedure. The DBMS_UTILITY package, by default, can be executed by PUBLIC.

To Reproduce

  • Create an Oracle user without SELECT_CATALOG_ROLE
  • Execute a Liquibase migration for this user and its schema
  • Observe in the logs that
2020-04-05 21:26:00 [main] [INFO ] [l.database.core.OracleDatabase] Could not set check compatibility mode on OracleDatabase, assuming not running in any sort of compatibility mode: Cannot read from v$parameter: ORA-00942: table or view does not exist

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (4 by maintainers)

Commits related to this issue

Most upvoted comments

➤ Erzsebet Carmean commented:

@RockyMM, I echo @ro-rah’s comment - thank you for working on this issue. I’ve added time for Datical internal QA to review the fix.

-erz

Thanks @RockyMM. We are looking to see which version we will be able to test this change in. Stay tuned.

Hey @ro-rah nice to hear that! Looking forward to 4.0 beta 😃

➤ Mario Champion commented:

hey internal reviewers, the linked PR is against master, so i moved this ticket into 4.0 beta 2 release as well.

@RockyMM perfect! I’ll continue to comment on the PR moving forward.

@RockyMM that’s great! Thanks for being vocal, bringing a solution, and of course being a part of our Liquibase community.