script to rebuild all materialized views
Mi name is Juan.Please, I need a script for rebuild all materialized views.
Sorry for my English.
select 'create snapshot "&1"."'||a.name||'" tablespace '||b.tablespace_name||
' storage(initial '||b.INITIAL_EXTENT||
' maxextents '||b.MAX_EXTENTS||
' )using index tablespace '||c.tablespace_name||
' storage(initial '||c.INITIAL_EXTENT||
' maxextents '||c.MAX_EXTENTS||
' )refresh fast with primary key as '
from user_snapshots a, user_tables b, user_indexes c
where a.name = b.table_name
and c.index_name = ( select d.constraint_name from user_constraints d where
d.table_name = a.table_name and d.constraint_type = 'P')
order by a.name;
you can edit this according to ur needs
Last edited by adewri; 01-08-2003 at 11:12 AM.
"There is a difference between knowing the path and walking the path."
Thanks, for your Help.
I doubt very much if that works for all MVs
what version of oracle? if 9i look at dbms_metadata.get_ddl
I'm stmontgo and I approve of this message
yea well he has to get all the where conditions, the query etc etc
Click Here to Expand Forum to Full Width