动态网站制作指南 [  QQ表情  ]
[ 投票调查 ]
[ 企业邮箱 ]
[ 网站空间 ]
网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
ASP源码 | .Net源码 | PHP源码 | JSP源码 | JAVA源码 | CGI源码 | VB源码 | C++源码 | Delphi源码 | PB源码 | VF源码 | 汇编 | 服务器
电脑书籍下载:程序设计书籍 | 数据库教程书籍 | 平面与多媒体书籍 | 网络通讯书籍 | 系统管理书籍 | 网络安全书籍 | 认证考试书籍
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > 数据库 > Oracle教程
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
数据库:数据库教程,数据库技巧,Oracle教程,MySQL教程,Sybase教程,Access教程,DB2教程,数据库安全,数据库文摘
文章搜索服务
邮件订阅
输入你的邮件地址,
你将不会错过任何关于:
[ Oracle教程 ]的信息



本月文章推荐
.常用数据库 JDBC 连接写法全攻略.
.sendmail出现“MX list for host.
.用Oracle TimesTen加速Oracle数据.
.从access到MS SQL SERVER数据导入.
.教你检测Oracle的可用性和表空间.
.快速实现基于 Linux 的 Intranet.
.全面介绍:Oracle数据库日期处理.
.通过使用Oracle商务智能保持住了.
.Oracle中优化SQL的原则.
.用Linux轻松建立内部“因特网”.
.Oracle 数据库系统使用经验.
.教你在Oracle中通过网络连接导入.
.如何选购Linux可以搭配的机器之整.
.数据文件SCN的一致性问题.
.使用Oracle 8.0数据库的几点经验.
.JAVA连接Oracle的代码.
.Oracle 的入门心得.
.从Oracle的FORM中调用REPORT的实.
.Oracle诊断案例----如何捕获问题.
.Oracle中对两个数据表交集查询简.

程序,任务与承认

发表日期:2008-2-9 |


  存储过程中需要显示的授予用于用户对象权限,而不是通过角色。全文为tom kyte的回答。   jeffli大虾http://jeffli73.china-pub.com/ 的理解:   刚工作时,编写Oracle的存储过程,就知道即使一个用户被授予了DBA,但其模式下的存储过程在引用其它用户模式下的数据对象(如表)时,仍需要显式授权。当时只是记住了这个结论,也没细想为什么,最近几年已基本不编程了,所以就更没进一步关心这个问题。最近又编了一个存储过程,碰到类似的情况,爱好使然就多查了一些资料,知道了这是与角色相关的问题。   在使用定义者权限的情况下,Oracle在编译存储过程时并不检查定义者拥有的角色,只是检查其被显式授予的权限,而DBA也是一种角色,所以即使是DBA,也需要显式授权。   Oracle之所以这样处理,主要是因为角色可能被授予多个用户,假如存储过程考虑角色权限,在角色权限变动时可能会引发大量存储过程失效或大量的检查工作,而角色又具有非默认性与密码保护,假如某用户在启用某非默认角色时编译了一个存储过程,那么当他注销该角色时该存储过程是否应该继续有效或被执行?假如另外一个用户更改了某角色的密码,那么其它依靠此角色的存储过程是否需要重新编译、是否还能执行?这些都是不好明确回答的问题。   另外,Oracle认为角色的设计目的是治理众多的最终用户,这些用户一般不应该创建数据对象。而拥有数据对象的用户应该只有少数几个,从安全性的角度,也应该明确、显式地说明其应有的权限,而应用角色将降低这种明确性,所以多做一些显式授权的工作是值得的。   See   http://osi.oracle.com/~tkyte/Misc/RolesAndProcedures.Html   You have no choice but to grant select on user1_table to user2 directly.  It is the only way to make it work.   Why is it that roles are not used during the compilation of a procedure?  It has to do with the dependency model.  Oracle is not storing exactly WHY you are allowed to Access T ?V only that you are (directly able to —— not via a role)。   Any change to your privileges that might cause access to T to go away will cause the procedure to become invalid and necessitate its recompilation.  Without roles ?V that means only ?§REVOKE SELECT ANY TABLE?¨ or ?§REVOKE SELECT ON T?¨ from the definers account or from PUBLIC.  With roles ?V it greatly eXPands the number of times we would invalidate this procedure.  If some role that was granted to some role that was granted to this user was modified, this procedure might go invalid, even if we did not rely on that privilege from that role.   ROLES are designed to be very fluid(不固定的,可改变的) when compared to GRANTS given to users as far as privilege sets go. For a minute, let?s say that roles did(虚拟语气;假设) give us privileges in stored objects.  Now, most any time anything was revoked from ANY   ROLE we had, or any role any role we have has (and so on —— roles can and are granted to roles) —— many of our objects would become invalid. Think about that
  —— REVOKE some privilege from a ROLE and suddenly your entire database must be recompiled!   Consider the impact of revoking some system privilege from a ROLE, it would be like doing that to PUBLIC now —— don't do it, just think about it (if you do revoke some powerful system privilege from PUBLIC, do it on a test database)。   Revoking SELECT ANY TABLE from PUBLIC for example would cause virtually every procedure in the database to go invalid.  If procedures relied on roles ?V virtually every procedure in the database would constantly become invalid due to small changes in permissions.  Since one of the major benefits of procedures is the ?§compile once, run many?¨ model ?V this would be disastrous for performance.   Also consider that roles may be   ?á Non-default: If I have a non-default role and I enable it and I compile a procedure that relies on those privileges, when I log out I no longer have that role —— should my procedure become invalid —— why? Why not? I could easily argue both sides.   ?á PassWord Protected: if someone changes the password on a ROLE, should everything that might need that role be recompiled?  I might be granted that role but not knowing the new password ?V I can no longer enable it. Should the privileges still be available?  Why or Why not?  Again, arguing either side of this is easy.  There are cases for and against each.   The bottom line with respect to roles in procedures with definers rights are:   ?á You have thousands or tens of thousands of end users. They don't create stored objects (they should not)。 We need roles to manage these people.  Roles are designed for these people (end users)。   ?á You have far fewer application schema's (things that hold stored objects)。   For these we want to be explicit as to exactly what privileges we need and why.   In security terms this is called the concept of 'least privileges' —— you want to specifically say what privilege you need and why you need it. If you inherit lots of privileges from roles you cannot do that effectively. We can manage to be explicit since the number of development schemas is SMALL (but the number of end users is large)……   ?á Having the direct relationship between the definer and the procedure makes for a mUCh more efficient database.  We recompile objects only when we need to,not when we might need to.  It is a large efficiency enhancement.tom每次都可以从设计的高度看问题。tune desing,not tune application
上一篇:由于控制文件计划不当而导致数据库停止 人气:355
下一篇:如何估计undo表空间大小 人气:406
浏览全部Oracle教程的内容 Dreamweaver插件下载 常用网页广告代码全集
  最新网站源码 最新软件下载
2008-7-25 WikyBlog v1.7.0.1 多国语言版
2008-7-25 乐彼网上开店系统(56770 Eshop)
2008-7-25 赛特网站管理系统sitecms v3.6.0
2008-7-25 Modoer多功能点评系统 v1.0.1 Bu
2008-7-25 Shangducms Teamsuit! v1.1.0 开
2008-7-25 幻影动漫网视频系统(Ppdong) v1.
2008-7-25 acteecompany企业网站建设系统 v
2008-7-25 恒浪整合管理系统 ims v4.1 ACCE
2008-7-25 艺术图库系统 v1.0 beta
2008-7-19 UltraEdit 简体中文增强版 14.10
2008-7-19 CentOS 5.2 i386 LiveCD
2008-7-19 Snapture多功能相机 v1.4
2008-7-19 iAcces中文输入法 v1.0Build016
2008-7-19 Cookbook烹饪秘籍 v2.5
2008-7-19 苹果专用DVD转换工具 v1.1.59汉化
2008-7-19 Modem修复软件ZiPhone修改版04.0
2008-7-19 AgileMessenger即时通讯工具美化
2008-7-19 Sketches画图软件 v0.7b6破解版


  发表评论
姓 名: 验证码:
内 容:
[ 汉字翻译拼音 ] [ 广告代码 ] [ 符号对照表 ] [ 进制转换 ] [ 经典小工具 ] [ 个税计算 ] [ 汉字简繁转换 ] [ 普通单位换算 ] [ 公制单位换算 ]
[ 生辰老黄历 ] [ 国内电话区号 ] [ 国家代码与域名缩写 ] [ 文字加密解密 ] [ 健康查询 ] [ 万年历 ] [ 手机号码查询 ] [ ip搜索 ] [ Google PR查询 ]
业务联系 | 广告刊登 | 频道合作 | 投稿荐稿 | 联系方式 | 加入收藏 | RSS订阅
Copyright © 2000-2008 www.knowsky.com All rights reserved | 网络实名:动态网站制作指南 | 沪ICP备05001343号
ホームページ制作 不動産検索システム 求人情報
防水工事·改修工事 フットサル大会 探偵