色综合图-色综合图片-色综合图片二区150p-色综合图区-玖玖国产精品视频-玖玖香蕉视频

您的位置:首頁技術文章
文章詳情頁

Oracle 10g分區表維護中的兩個注意事項

瀏覽:90日期:2023-11-28 11:03:52
Oracle 10g分區表維護中的兩個注意事項:

1.全局索引

SQL> alter table analyse_content truncate subpartition DATA0712_DEYANG;

Table truncated

truncate分區后,修改或者插入數據報錯:

ORA-01502: index 'phs.pk' or partition of such index is in unusable state

這個時候只能rebuild index

SQL> alter index phs.pk rebuild;

Index altered

執行以后恢復正常,或者使用如下語句:

SQL> alter table analyse_content truncate subpartition DATA0712_ZIGONG UPDATE

GLOBAL INDEXES;

Table truncated

這樣它會自動恢復索引。

2.物化視圖

對于已經建有fast refresh view的分區表來說,truncate和drop分區/表會導致物化視圖出錯。

SQL> alter table analyse_content drop subpartition DATA0712_MIANYANG;

Table altered

SQL> alter table analyse_content truncate subpartition DATA0712_LUZHOU;

Table truncated

再次查詢物化視圖,這個兩個分區的數據仍然存在,說明物化視圖不能對這種DDL語句進行更新。

嘗試在基礎表插入數據,報錯:

ORA-32313: REFRESH FAST of ' ' unsupported after PMOPs

這時候必須手工刷新MV

SQL> exec dbms_mview.refresh('mv_analyse_content','f');

begin dbms_mview.refresh('mv_analyse_content','f'); end;

ORA-32313: PMOP 之后不支持 'PHS'.'MV_ANALYSE_CONTENT' 的 REFRESH FAST

ORA-06512: 在 'SYS.DBMS_SNAPSHOT', line 2255

ORA-06512: 在 'SYS.DBMS_SNAPSHOT', line 2461

ORA-06512: 在 'SYS.DBMS_SNAPSHOT', line 2430

ORA-06512: 在 line 1

看來快速刷新'f'是不行,還是得完全刷新'c'

SQL> exec dbms_mview.refresh('mv_analyse_content','c');

PL/SQL procedure successfully completed

執行完后,MV里面的數據恢復正常,基表不再報錯。

實際10g里面,truncate分區后,某些物化視圖可以執行fast refresh,具體有很多限制,

要查詢doc,反正select * from table這種視圖肯定可以'f',不過卻沒有什么意義。

---2008 04 22 在doc上找到了PCT特性的限制,如下:

At least one of the detail tables referenced by the materialized view must be

partitioned.

Partitioned tables must use either range, list or composite partitioning.

The top level partition key must consist of only a single column.

The materialized view must contain either the partition key column or a partition

marker or ROWID or join dependent expression of the detail table. See Oracle

Database PL/SQL Packages and Types Reference for details regarding the DBMS_

MVIEW.PMARKER function.

If you use a GROUP BY clause, the partition key column or the partition marker or

ROWID or join dependent expression must be present in the GROUP BY clause.

If you use an analytic window function or the MODEL clause, the partition key

column or the partition marker or ROWID or join dependent expression must be

present in their respective PARTITION BY subclauses.

Data modifications can only occur on the partitioned table. If PCT refresh is being

done for a table which has join dependent expression in the materialized view,

then data modifications should not have occurred in any of the join dependent

tables.

The COMPATIBILITY initialization parameter must be a minimum of 9.0.0.0.0.

PCT is not supported for a materialized view that refers to views, remote tables, or

outer joins.

PCT-based refresh is not supported for UNION ALL materialized views.

對于海量數據庫,如果不能使用DROP分區,則delete相當慢。

如果使用了,又會導致完全刷新MV,同樣慢。

在物化視圖的時候要認真考慮PCT特性。

對于分區表 已經相關索引,快照的維護,建議還是參考Oracle的DOC,在admin guide和

dataware house guide里有非常完善描述。雖然沒有涉及internal,但完全可以滿足應用。

標簽: Oracle 數據庫
主站蜘蛛池模板: 在线综合亚洲欧美自拍 | 国产人成午夜免费噼啪视频 | 国产a精品三级 | 亚洲久草在线 | 日本丶国产丶欧美色综合 | 亚洲精品在线免费 | 国产成人精品一区二区免费视频 | 国产在线精品一区二区不卡 | 在线视频中文 | 国产视频久久久久 | 99九九成人免费视频精品 | 97视频在线视频 | 亚洲影院手机版777点击进入影院 | 久久久久国产成人精品 | 99久久亚洲综合精品网站 | 国产看片一区二区三区 | 精品国产v | 中文字幕在线观看亚洲日韩 | 日韩欧美精品综合一区二区三区 | 亚洲字幕波多野结衣作品 | 午夜在线社区视频 | 亚洲欧美卡通成人制服动漫 | 男女午夜| 99久久久国产精品免费播放器 | 看a网站| 成年人三级黄色片 | 国产成人精品午夜 | 黄色香蕉视频 | 亚洲影院中文字幕 | 性刺激久久久久久久久 | 亚洲国产精品91 | 欧美精品一区二区三区四区 | 欧美亚洲不卡 | 国产自产21区 | 欧美一级毛片免费观看视频 | 成人免费视频软件网站 | 欧美毛片在线观看 | 久久福利资源国产精品999 | 在线播放 亚洲 | 亚洲高清无在码在线无弹窗 | 久久伊人精品热在75 |