Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does Oracle view the permissions or roles of the currently logged in user

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "Oracle how to view the permissions or roles of current login users". In daily operation, I believe that many people have doubts about how to view the permissions or roles of current login users in Oracle. The editor has consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "how to view the permissions or roles of current login users in Oracle". Next, please follow the editor to study!

Oracle to view the permissions or roles of the currently logged in user

View the role of the current user

SQL > select * from user_role_privs

SQL > select * from session_privs

View the system permissions and table-level permissions of the current user

SQL > select * from user_sys_privs

SQL > select * from user_tab_privs

Attached:

1. View users:

1. View the current user:

Select * from v$session

two。 View all users:

Select * from dba_users

Select * from all_users

Select * from user_users

2. View roles:

1. All roles activated by the current user

Select * from session_roles

two。 The role that the current user is granted

Select * from user_role_privs

two。 Roles granted to all users

Select * from dba_role_privs

3. View all roles:

Select * from dba_roles

4. Query the roles to which the current role is granted

Select GRANTED_ROLE from ROLE_ROLE_PRIVS where ROLE=&ROLE;-- such as role= 'DBA'

3. View permissions:

1. Basic permissions query:

Select * all permissions owned by the current user of from session_privs;--

Select * system permissions of the current user of from user_sys_privs;--

Select * Table-level permissions of the current user of from user_tab_privs;--

Select * from dba_sys_privs;-- queries the system permissions owned by a user

Select * from role_sys_privs;-- view the permissions contained in roles (you can only view roles owned by logged in users)

two。 View user object permissions:

Select * from dba_tab_privs

Select * from all_tab_privs

Select * from user_tab_privs

3. Check which users have sysdba or sysoper system permissions (appropriate permissions are required for query)

Select * from V$PWFILE_USERS

Note:

1. The following statement can view the system permissions provided by Oracle

Select name from sys.system_privilege_map

2. View all system permissions of a user (including system permissions of roles)

Sql code

Select privilege from dba_sys_privs where grantee='DATAUSER'

Union

Select privilege from dba_sys_privs where grantee in (select granted_role from dba_role_privs where grantee='DATAUSER')

At this point, the study on "how to view the permissions or roles of current login users by Oracle" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report