oracle 查询用户能查看的表
oracle 查询用户能查看的表单纯的查询user_tables 不能看到其他用户赋予查询权限的表select OWNER||'.'||TABLE_NAME from all_all_tables where owner='WANG'unionselect OWNER||'.'||TABLE_NAME from user_tab_privs where grantee='WANG'......
·
oracle 查询用户能查看的表
单纯的查询user_tables 不能看到其他用户赋予查询权限的表
select OWNER||'.'||TABLE_NAME from all_all_tables where owner='WANG'
union
select OWNER||'.'||TABLE_NAME from user_tab_privs where grantee='WANG'
后来又发现了一种赋权方式上面的语句取不到表
grant select any table to WANG;
这种时候 表既不属于你,也没有单独授权给你查询,所以没有记录。上面的语句就有问题 取不到表名了。
只能查询 select OWNER||'.'||TABLE_NAME from all_all_tables 这样子查询出来的表过多,最好自己能指定取哪个用户下的表。
更多推荐
已为社区贡献1条内容
所有评论(0)