如何查看授予其他用户架构的特权 [英] How to see what privileges are granted to schema of another user
问题描述
考虑这种情况:在一个数据库中,我有两个用户A和B及其对应的架构.
Consider the case : In a database , I have two users A and B and their corresponding schema.
我想知道,我如何获取信息:模式B中的用户A有哪些权限.
I want to know , How can I get the information : what permissions are there for USER A in Schema B .
考虑这种情况:我们有两个用户及其关联的方案.我们有用户A和用户B.在A中,我们有TB1 TB2,在B中,我们有TBa,TBb.现在,我想知道如何找到用户A对模式B拥有的特权.
Consider the case : We have two users and their associated scehmas. We have user A and user B. In A, say we have TB1 TB2, in B,say we have TBa, TBb. Now I want to know how can I find what privileges User A has on Schema B.
例如:用户A正在写:select * from B.TBb
这表示用户A正在访问用户B的表,因此,它表明他具有SELECT特权.我想知道用户A在模式B上拥有什么特权.
For example : User A is writing : select * from B.TBb
This means USER A is accessing User B's table so , it shows he has SELECT Privilege. I want to know what all privileges User A has on Schema B.
应执行哪个查询以获取用户A在模式B上拥有的特权的列表.
Which query shall be executed to get the list of privileges that User A has on Schema B.
推荐答案
您可以使用以下查询:
select * from all_tab_privs;
select * from dba_sys_privs;
select * from dba_role_privs;
每个表都有一个grantee
列,您可以在where条件中对此进行过滤:
Each of these tables have a grantee
column, you can filter on that in the where criteria:
where grantee = 'A'
要查询其他模式中对象(例如表)的特权,我建议首先all_tab_privs
,它也有一个table_schema
列.
To query privileges on objects (e.g. tables) in other schema I propose first of all all_tab_privs
, it also has a table_schema
column.
如果使用要查询其特权的同一用户登录,则可以使用user_tab_privs
,user_sys_privs
,user_role_privs
.普通非dba用户可以查询它们.
If you are logged in with the same user whose privileges you want to query, you can use user_tab_privs
, user_sys_privs
, user_role_privs
. They can be queried by a normal non-dba user.
这篇关于如何查看授予其他用户架构的特权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!