question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
liquibotcommented, May 6, 2020

➤ 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

1reaction
molivasdatcommented, Jul 27, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to grant v_$Session to a normal user, If we do not have
Can we grant specific privileges from system user to application user so that a user can use v$session in plsql. Right now we...
Read more >
Oracle 21c: select permission on v_$session
In Oracle 11g, I was able to issue this sql: GRANT select FROM v$session to <user>. I use this in my Triggers since...
Read more >
How to Create Users, Grant Them Privileges, and Remove ...
The problem is you haven't given the user any permissions! By default a database user has no privileges. Not even to connect.
Read more >
Grants to Users - Ask TOM
Grants to Users I have an application which has its backend data on one schema in the database. Should I use the same...
Read more >
Session information using sys_context don't show own session
Hello, I want to offer a method for users to view their sessions information (status, logon_time, last activity...). Users normally don't ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found