设为首页 收藏本站
查看: 589|回复: 0

[经验分享] oracle 谨慎授予用户dba权限

[复制链接]

尚未签到

发表于 2016-7-30 21:40:08 | 显示全部楼层 |阅读模式
  //我们来看下面这个授权的二叉树,实际中肯定是个图(复杂的图):sys/     /test001(dba)  test002(dba)/   /          /  t1  t2          t3--//如上二叉树所示,假设test001和test002都被授予了dba权限,//test001和test002又各自创建了用户t1,t2,t3;//拥有了dba权限的用户,权限是无限大的,就和sys一样的;//下面来看一个实例:Connected as SYS//创建两个用户test001和test002,并授予dba权限:create user test001 identified by test001 default tablespace users;grant resource,connect,dba to test001;create user test002 identified by test002 default tablespace users;grant resource,connect,dba to test002;//在test001用户下面创建普通用户t1,t2,并在test001用户下面建立一张表:Connected as test001create user t1 identified by t1;grant resource,connect to t1;--create user t2 identified by t2;grant resource,connect to t2;--create table t_temp(col_1 number(5),col_2 date default sysdate,col_3 varchar2(30));--insert into t_tempselect 1001,to_date('2011-01-01','yyyy-mm-dd'),'begin of 2011' from dual union allselect 1002,to_date('2011-04-30','yyyy-mm-dd'),'end of april' from dual;//用户t1登陆,并创建一张表:Connected as t1create table t(id number(2),name varchar2(20),addr varchar2(30));insert into tselect 12,'James','shanghai' from dual union allselect 13,'Thomas','changchun' from dual union allselect 25,'Smith','beijing' from dual;//因为test002用户具有dba权限,那么他就能够访问任何用户下的对象(table,view,procedure...)//并且可以任意操作其他用户下的对象:Connected as test002select * from test001.t_temp;COL_1 COL_2       COL_3------ ----------- ------------------------------1001 2011-01-01  begin of 20111002 2011-04-30  end of april--select * from t1.t;ID NAME                 ADDR--- -------------------- ------------------------------12 James                shanghai13 Thomas               changchun25 Smith                beijing--drop table t1.t;commit;Connected as t1select * from t1ORA-00942: table or view does not exist--Connected as test002drop table test001.t_temp;--Connected as test001select * from t_tempORA-00942: table or view does not exist//从这里,你可以知道拥有dba权限的用户的权利是多大了吧!//所以在实际应用中,一定要谨慎的给予用户dba权限.//不具备dba权限的用户,在没有被授权访问的情况下,不能访问其他用户下的对象。Connected as test002grant resource,connect to t3;Connected as t3create table t3_temp(col_1 varchar2(10),col_2 number(5),col_3 varchar2(5));--select * from t1.tORA-00942: table or view does not existdrop table t1.tORA-00942: table or view does not exist//这里并没有提示ORA-01031:insufficient privileges,//而是告诉当前用户ORA-00942: table or view does not exist,//其实用户t3并不知道用户t1的存在.//但是我们可以通过授权机制,实现不同用户之间的相互访问,//前提是该普通用户具有授权的权限Connected as t1grant select on t to t3;Connected as t3select * from t1.t;ID NAME                 ADDR--- -------------------- ------------------------------12 James                shanghai13 Thomas               changchun25 Smith                beijing
  原帖:http://topic.csdn.net/u/20110430/11/cce8abe1-fb23-4d1f-b257-e05b1db4f53c.html?99867
  参考:
  [1]oracle 创建用户:http://database.iyunv.com/art/200911/160283.htm

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-251411-1-1.html 上篇帖子: Oracle数据库LONG类型移植 下篇帖子: 关于Oracle去除重复的问题
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表