Don't use v$session in Oracle as the SELECT grant on this view is not usually available to any user
See original GitHub issueDescription
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:
- Created 3 years ago
- Comments:16 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub 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.