SQL> create user pyb1 identified by pyb1pyb1;

grant connect,resource to pyb1;

使用 pyb1 登录系统

SQL> select * from v$mystat;
select * from v$mystat
              *
ERROR at line 1:
ORA-00942: table or view does not exist


SQL> select * from v$session;
select * from v$session
              *
ERROR at line 1:
ORA-00942: table or view does not exist

授权(即时生效)

grant select on v_$mystat to pyb1;
grant select on v_$session to pyb1;

或者授权(需要重新登录)

grant select_catalog_role to pyb1;

感觉 select_catalog_role 权限有点过大
在这里插入图片描述

https://docs.oracle.com/en/database/oracle/oracle-database/21/dbseg/configuring-privilege-and-role-authorization.html#GUID-F4BE7D94-B60E-42CE-9AFA-2D0C0443C31F

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐