网站大量收购独家精品文档,联系QQ:2885784924

Oracle数据库基础及应用第12章 视图索引的管理.ppt

Oracle数据库基础及应用第12章 视图索引的管理.ppt

  1. 1、本文档共77页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Oracle数据库基础及应用第12章 视图索引的管理

* Denying DML Operations You can ensure that no DML operations occur on your view by creating it with the WITH READ ONLY option. The example on the slide modifies the EMPVU10 view to prevent any DML operations on the view. Instructor Note (for pages 11-17) If the user does not supply a constraint name, the system assigns a name in the form SYS_Cn, where n is an integer that makes the constraint name unique within the system. * Using the WITH CHECK OPTION Clause It is possible to perform referential integrity checks through views. You can also enforce constraints at the database level. The view can be used to protect data integrity, but the use is very limited. The WITH CHECK OPTION clause specifies that INSERTs and UPDATEs performed through the view cannot create rows which the view cannot select, and therefore it allows integrity constraints and data validation checks to be enforced on data being inserted or updated. If there is an attempt to perform DML operations on rows that the view has not selected, an error is displayed, with the constraint name if that has been specified. UPDATE empvu20 SET department_id = 10 WHERE employee_id = 201; UPDATE empvu20 * ERROR at line 1: ORA-01402: view WITH CHECK OPTION where-clause violation Note: No rows are updated because if the department number were to change to 10, the view would no longer be able to see that employee. Therefore, with the WITH CHECK OPTION clause, the view can see only employees in department 20 and does not allow the department number for those employees to be changed through the view. create view v_emp_job_sal(job,avgsal,sumsal,maxsal,minsal) as select job,avg(sal),sum(sal),max(sal),min(sal) from emp group by job; * * 索引是一种可选的数据结构,在一个表上是否建立索引,不会对表的使用方式产生任何影响。但是如果在表中的某些字段上建立了索引,能够显著地提高对该表的查询速度,并且可以在很大程度上减少查询时的硬盘I/O操作。 索引与表一样,不仅需要在数据字典中保存索引的定义,还需要在表空间中为它分配实际的存储空间。当创建索引时,Oracle会自动在用户的默认表空间中或指定的表空间中创建一个索引段,为索引数据提供存储空间。与创建表的情况类似,在创建索引时,也可以为它设置存储参数。 为某个表创

文档评论(0)

yaocen + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档