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

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

Oracle 10g分區(qū)表維護(hù)中的兩個(gè)注意事項(xiàng)

瀏覽:119日期:2023-11-28 11:03:52
Oracle 10g分區(qū)表維護(hù)中的兩個(gè)注意事項(xiàng):

1.全局索引

SQL> alter table analyse_content truncate subpartition DATA0712_DEYANG;

Table truncated

truncate分區(qū)后,修改或者插入數(shù)據(jù)報(bào)錯(cuò):

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

這個(gè)時(shí)候只能rebuild index

SQL> alter index phs.pk rebuild;

Index altered

執(zhí)行以后恢復(fù)正常,或者使用如下語(yǔ)句:

SQL> alter table analyse_content truncate subpartition DATA0712_ZIGONG UPDATE

GLOBAL INDEXES;

Table truncated

這樣它會(huì)自動(dòng)恢復(fù)索引。

2.物化視圖

對(duì)于已經(jīng)建有fast refresh view的分區(qū)表來說,truncate和drop分區(qū)/表會(huì)導(dǎo)致物化視圖出錯(cuò)。

SQL> alter table analyse_content drop subpartition DATA0712_MIANYANG;

Table altered

SQL> alter table analyse_content truncate subpartition DATA0712_LUZHOU;

Table truncated

再次查詢物化視圖,這個(gè)兩個(gè)分區(qū)的數(shù)據(jù)仍然存在,說明物化視圖不能對(duì)這種DDL語(yǔ)句進(jìn)行更新。

嘗試在基礎(chǔ)表插入數(shù)據(jù),報(bào)錯(cuò):

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

這時(shí)候必須手工刷新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

執(zhí)行完后,MV里面的數(shù)據(jù)恢復(fù)正常,基表不再報(bào)錯(cuò)。

實(shí)際10g里面,truncate分區(qū)后,某些物化視圖可以執(zhí)行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.

對(duì)于海量數(shù)據(jù)庫(kù),如果不能使用DROP分區(qū),則delete相當(dāng)慢。

如果使用了,又會(huì)導(dǎo)致完全刷新MV,同樣慢。

在物化視圖的時(shí)候要認(rèn)真考慮PCT特性。

對(duì)于分區(qū)表 已經(jīng)相關(guān)索引,快照的維護(hù),建議還是參考Oracle的DOC,在admin guide和

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

主站蜘蛛池模板: 男女视频在线观看免费高清观看 | 亚洲精品高清久久 | 欧美一级片在线免费观看 | 日韩欧美中文字幕在线观看 | 韩日一级片 | 伊人午夜| 婷婷的久久五月综合先锋影音 | 成年人在线观看网站 | 男女午夜爱爱久久无遮挡 | 国产永久在线视频 | 在线播放国产真实女同事 | 国产精品漂亮美女在线观看 | 日本xxxxx久色视频在线观看 | 天堂男人在线 | 亚洲理论欧美理论在线观看 | 欧美三级欧美成人高清www | 美女脱了内裤张开腿让男人桶网站 | 国产亚洲精彩视频 | 久久伊人精品热在75 | 国产日产欧产精品精品推荐小说 | 99热在线免费 | 日韩在线观看一区 | 亚洲综合资源 | 国产亚洲精品aaa大片 | 特级黄色毛片视频 | 国产精品三级国语在线看 | 久久99精品久久久久久综合 | 日本大臿亚洲香蕉大片 | 国产成人精品区在线观看 | 亚洲精品欧美精品 | 亚洲精品国产手机 | 日韩美女网站在线看 | 国产成人精品一区二区三在线观看 | 久99久精品视频免费观看v | 国产在线欧美精品 | 久久男人的天堂色偷偷 | 欧美一级毛片免费网站 | 国产在线观看免费人成小说 | 看真人一级毛片 | 国产欧美日韩一区 | 日本美女福利视频 |