简体   繁体   中英

How to get the size of a materialized view in oracle?

I would like to know how can I get the size of a materialized view I created in oracle and also the cost of creating the materialized view if possible.

For example how to get the size of this view (storage used by this view), the name of the database is studentDB.

create materialized view mv_name
as
select * from student;

You can use the DBA_SEGMENTS or USER_SEGMENTS dictionary view as follows:

SELECT SEGMENT_NAME,
       SEGMENT_TYPE,
       BYTES / 1024 / 1024 MB
  FROM DBA_SEGMENTS
 WHERE SEGMENT_TYPE = 'TABLE'
   AND SEGMENT_NAME = '<yourviewname>';

Materialized view creates the table with the same name as the Materialized view name.

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