访问其它用户下的对象

Oracle数据库权限管理

访问其它用户下的对象

 

 

声明:scotthr叫用户名/方案名/空间名

      scott--tiger

      hr-----lion

      

1.查询当前用户是谁

show user;

 

2.查询scott自己表空间下的所有对象时,可加,或不加用户名select * from emp;

select * from emp;

select * from scott.emp;

 

3.sysdba身份解锁hr普通帐户

alter user hr account unlock;

 

4.sysdba身份设置hr普通帐户的密码

alter user hr identified by lion;

 

5.scott查询hr表空间下的所有表时,必须得加用户名

select * from hr.jobs;

 

在默认情况下,每个用户只能查询自已空间下的对象的权限,不能查询其它用户空间下的对象

 

6.sysdba身份角色,授予scott用户查询所有用户空间下的对象权限

grant select any table to scott;

 

7.sysdba身份,撤销scott用户查询所有用户空间下的对象权限

revoke select any table from scott;

 

8.scott自已查看自己所拥有的权限

select * from user_sys_privs;

 

9.scott用户空间导航到sysdba用户空间

conn / as sysdba;

 

10.sysdba用户空间导航到scott用户空间

conn scott/tiger;

 

11.scott用户空间导航到hr用户空间

conn hr/lion;

 

12.查询hr用户空间中的所有对象

select * from tab;

 

13.hr用户空间导航到scott用户空间

conn scott/tiger;

 

14.scott用户空间下,查询hr用户空间下的jobs表,必须加上hr用户空间名

select * from hr.jobs;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值