简体   繁体   中英

how to convert materialized view into normal view

I am using Oracle 11g EE and created one Materialized view for a complex query. But as customer is using Standard edition and it doesn't support Materialized view. So I need to convert materialized view into a normal view. Along with this conversion I also need to make sure performance of a query. When I treid to execute a query for the view independently, it takes around 20 mins which is too much time. All my tables are indexed.

Any sort of help would be appreciated !!

I don't currently have access to an oracle database to test this, but if you get the DDL of the mview, and remove the word materialized along with the mview related options:

select dbms_metadata.get_ddl('MATERIALIZED_VIEW', 'MVIEW_NAME') from dual;

You should be able to create a normal view from the resulting modified statement.

As for performance, make sure you are indexing the right things, and using the right type of indexes. Make sure statistics are up to date, and finally run explain plan on the view query. The topic of interpreting and optimizing execution plans is deep - start here:

https://docs.oracle.com/cd/B10501_01/server.920/a96533/ex_plan.htm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM