亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

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

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

瀏覽:108日期: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ù)正常,或者使用如下語句:

SQL> alter table analyse_content truncate subpartition DATA0712_ZIGONG UPDATE

GLOBAL INDEXES;

Table truncated

這樣它會自動恢復(fù)索引。

2.物化視圖

對于已經(jīng)建有fast refresh view的分區(qū)表來說,truncate和drop分區(qū)/表會導(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ù)仍然存在,說明物化視圖不能對這種DDL語句進(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.

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

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

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

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

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

標(biāo)簽: Oracle 數(shù)據(jù)庫
主站蜘蛛池模板: 男人粗大一出一进女人下面视频 | 77777五月色婷婷丁香视频 | 亚洲日本va在线观看 | 96精品专区国产在线观看高清 | 性短视频在线观看免费不卡流畅 | 国产婷婷色一区二区三区深爱网 | 最新国产成人综合在线观看 | 免费一级特黄特色大片在线观看看 | 欧美一级做一a做片性视频 欧美一级做一级爱a做片性 | 日韩欧美1区 | 成年人免费网址 | 日韩欧美在线观看视频 | free麻豆| 亚洲久草 | 国产91在线播放边 | 亚州一级毛片 | 亚洲国产日本 | 欧美高清在线精品一区二区不卡 | 天天综合天天色 | 在线精品国精品国产不卡 | 精品一区二区三区四区乱码90 | 亚洲国产综合视频 | 成人午夜在线观看国产 | 国产在线一区观看 | a级片免费在线观看 | 丝袜诱惑中文字幕 | zzijzzij亚洲日本护士 | 91精品国产三级在线观看 | 51激情精品视频在线观看 | 亚洲成a人v天堂网 | 国产成人高清精品免费观看 | 黄色的视频在线观看 | 18美女福利视频网站免费观看 | 日本成人影院 | 国产精品久久久天天影视香蕉 | 欧美一级v片 | 欧美精品二区 | 美国特级片 | 亚洲精品ai换脸一区二区三区 | 日韩 欧美 亚洲 国产 | 国产欧美在线观看一区 |