视图修改的学习

学习视图view

 

ALTER VIEW [schema.]view COMPILE;

 

   ALTER VIEW [schema.]view ADD out_of_line_constraint;

 

   ALTER VIEW [schema.]view MODIFY CONSTRAINT constraint {RELY | NORELY};

 

   ALTER VIEW [schema.]view DROP CONSTRAINT constraint;

 

   ALTER VIEW [schema.]view DROP PRIMARY KEY

 

   ALTER VIEW [schema.]view UNIQUE (column [,column,...])

不过还是建议 create  or replace

 

Use the ALTERVIEW statement to explicitly recompile a view that is invalid or to modify view constraints. Explicit recompilation lets you locate recompilation errors before run time. You may want to recompile a view explicitly after altering one of its base tables to ensure that the alteration does not affect the view or other objects that depend on it.You can also use ALTERVIEW to define, modify, or drop view constraints.You cannot use this statement to change the definition of an existing view. Further, if DDL changes to the view's base tables invalidate the view, then you cannot use this statement to compile the invalid view. In these cases, you must redefine the view using CREATEVIEW with the ORREPLACE keywords.When you issue an ALTERVIEW statement, Oracle Database recompiles the view regardless of whether it is valid or invalid. The database also invalidates any local objects that depend on the view.If you alter a view that is referenced by one or more materialized views, then those materialized views are invalidated. Invalid materialized views cannot be used by query rewrite and cannot be refreshed.

利用alter view,可以重新编译一个试图,或者修改一个试图的约束。如果要重新定义试图,则应使用create  or replace view  的命令。当视图失效时,可以重新编译视图。

 

2008-11-07 16:23

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值