Re: invalid views

  • From: Tim Gorman <tim@xxxxxxxxx>
  • To: Brian.Zelli@xxxxxxxxxxxxxxx
  • Date: Wed, 24 Nov 2010 12:54:28 -0700

Invalidated views don't affect the execution plan, because parsing stops at the invalidated object.  If you are using one of the Oracle OCI drivers, then your session will automagically attempt to recompile the invalidated object transparently, then proceed with the parse operation.  Some of the older, less-capable JDBC "thin" drivers will not perform the automagic recompile and will just return an error message.

Here is a simple test to run in SQL*Plus to illustrate...

create table xxxt (n1 number);
insert into xxxt values (1);
insert into xxxt values (2);
commit;
create view xxxv as select * from xxxt;
select * from xxxt;
select * from xxxv;
alter table xxxt add (n2 number);
select status from user_objects where object_name = 'XXXV';
select * from xxxv;
select status from user_objects where object_name = 'XXXV';


Hope this helps...
Tim Gorman
consultant -> Evergreen Database Technologies, Inc.
postal     => 13087 West Cedar Drive #225, Lakewood CO 80228
website    => http://www.EvDBT.com/
email      => Tim@xxxxxxxxx
mobile     => +1-303-885-4526
fax        => +1-303-484-3608
Lost Data? => http://www.ora600.be/ for info about DUDE...

On 11/24/2010 12:42 PM, Zelli, Brian wrote:
So for some reason, one of our applications invalidates views.  If the view becomes invalid, how does the app get the data then?  Full table scans?  
 

ciao,

Brian

 


This email message may contain legally privileged and/or confidential information. If you are not the intended recipient(s), or the employee or agent responsible for the delivery of this message to the intended recipient(s), you are hereby notified that any disclosure, copying, distribution, or use of this email message is prohibited. If you have received this message in error, please notify the sender immediately by e-mail and delete this email message from your computer. Thank you.
-- //www.freelists.org/webpage/oracle-l

Other related posts: