Oracle系列:(21)访问其他用户下的对象[授权]
发布时间:2020-12-12 15:59:51 所属栏目:百科 来源:网络整理
导读:声明:scott或hr叫用户名/方案名/空间名 scott--tiger hr-----lion 查询当前用户是谁 showuser; 650) this.width=650;" src="http://img.jb51.cc/vcimg/static/loading.png" title="004.jpg" alt="wKiom1fUF4jBIjRCAAAPoOM61GI926.jpg" src="http://s3.51cto
声明:scott或hr叫用户名/方案名/空间名 scott--tiger hr-----lion
查询当前用户是谁 showuser; 查询scott自己表空间下的所有对象时,可加,或不加用户名select * from emp; select*fromemp; 或 select*fromscott.emp; 以sysdba身份解锁hr普通帐户 alteruserhraccountunlock; 以sysdba身份设置hr普通帐户的密码 alteruserhridentifiedbylion; 当scott查询hr表空间下的所有表时,必须得加用户名 select*fromhr.jobs; 在默认情况下,每个用户只能查询自已空间下的对象的权限,不能查询其它用户空间下的对象 以sysdba身份角色,授予scott用户查询所有用户空间下的对象权限 grantselectanytabletoscott; 以sysdba身份,撤销scott用户查询所有用户空间下的对象权限 revokeselectanytablefromscott; scott自已查看自己所拥有的权限 select*fromuser_sys_privs; 从scott用户空间导航到sysdba用户空间 conn/assysdba; 从sysdba用户空间导航到scott用户空间 connscott/tiger; 从scott用户空间导航到hr用户空间 connhr/lion; 查询hr用户空间中的所有对象 select*fromtab; 从hr用户空间导航到scott用户空间 connscott/tiger; 在scott用户空间下,查询hr用户空间下的jobs表,必须加上hr用户空间名 select*fromhr.jobs; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |