0

我对大约 8 个主表有一个直接的物化视图。

create materialized view MV
REFRESH FAST ON COMMIT as
  SELECT...

我也在运行这个查询来关注物化日志的大小。

select segment_name, SUM ( (BYTES) / (1024 * 1024)) "Allocated(MB)" from dba_segments where (segment_name, owner) IN (
  select log_table, log_owner from dba_mview_logs where log_owner = 'XXX')
and segment_type = 'TABLE' GROUP BY segment_name;

由于我对提交感到耳目一新,我不希望这些日志有机会增长。一旦我写入表,我希望视图刷新并清除日志。

但是,我的大部分日志都是 0.0625mb,一个是 27mb,另一个是 2mb。如何调查较大尺寸的原因?这两个表都具有较大的日志,其中包含可能包含大数据的 blob 列。但我在基本层面上不明白为什么这些日志> 0。

4

1 回答 1

1

The table data segment does not shrink when data is deleted from it, and the segment size also depends on the size increments in which it grows (based on the tablespace settings).

What you see there is just the maximum size that the segmenbt has grown to, not the amount of data that it is holding -- it could well be empty when you query it. Just count the number of rows in the MV log table.

You can look at all of the MViews dependent on the table to see what their last refresh time was, and compare to the set of SNAPTIME$$'s in the mview log. If the MViews are all definitely refreshed after the snaptime$$, have a look at mview.purge_log to remove the rows.

于 2013-07-01T14:11:20.967 回答