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

Oracle series: (21) access objects under other users [authorization]

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Statement: scott or hr called user name/scheme name/space name

scott--tiger

hr-----lion

Query who the current user is

show user;

When querying all objects in scott's own table space, you can add or leave the user name select * from emp;

select * from emp;

or

select * from scott.emp;

Unlock hr regular account as sysdba

alter user hr account unlock;

Set the password for the hrregular account as sysdba

alter user hr identified by lion;

When scott queries all tables in the hr table space, the user name must be added

select * from hr.jobs;

By default, each user can only query the permissions of objects in his own space, and cannot query objects in other user spaces.

Grant user scott permission to query objects in all user spaces as sysdba

grant select any table to scott;

As sysdba, revoke the scott user's permission to query objects in all user spaces

revoke select any table from scott;

Scott himself sees the privileges he has.

select * from user_sys_privs;

Navigating from scott user space to sysdba user space

conn / as sysdba;

Navigating from sysdba user space to scott user space

conn scott/tiger;

Navigating from scott user space to hr user space

conn hr/lion;

Query all objects in hruser space

select * from tab;

Navigating from hr user space to scott user space

conn scott/tiger;

In scott user space, query jobs table in hr user space, hr user space name must be added

select * from hr.jobs;

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