我想創建物化視圖(mv),請參閱下面的SQL查詢。當我嘗試創建實體化視圖時,我的臨時表空間完全被使用並給出錯誤 SQL錯誤:ORA-12801:錯誤信號並行查詢服務器P007 ORA-01652:無法將臨時段擴展64表空間TEMP1 12801. 00000 - 「錯誤信號並行查詢服務器%s」創建填充完整臨時空間的物化視圖
然後我檢查了它使用的並行度爲8度的OEM。所以我使用alter語句禁用了並行(ALTER SESSION DISABLE PARALLEL QUERY)。然後MV跑了很長時間,花了幾個小時才得以創建。請建議是否有任何方法來創建它,而不使用太多的空間臨時空間。該MV的選擇查詢的計數大約爲5500萬行。任何建議真的很感激。
DB:甲骨文11gR2的
CREATE MATERIALIZED VIEW TEST NOLOGGING REFRESH FORCE ON DEMAND ENABLE QUERY REWRITE AS 選擇 table4.num爲 「數字」,table4.num爲 「SNUM」, 表4。狀態爲 「S_STATUS」, '打開' 爲 「NLP」, create_table2.fmonth爲 「SMN」, table6.wgrp爲 「SOW」, (table2.end_dt - create_table2.dt)爲 「ELP」,表6 .d_c爲「SDC」, create_table2.fiscal_quarter_name爲「SQN」 , 'TS'as「SSL」, table3.table3_id as「SR Owner CEC ID」, table4.sev as「ssev」, SUBSTR(table8.stech,1,INSTR(table8.stech,'=>' )-1)as「srtech」, SUBSTR(table8.stech,INSTR(table8.stech,'=>')+ 2)as「srstech」, table5.sr_type as「SR Type」, table5.problem_code as 「SR問題代碼」, --null爲 「SR入口通道」, --null爲 「狀態SR時間(天)」, table6.center, table6.th1col, table6.master_theater, 表6。 rol_3, table7.center hier_17_center, table7.rol_1 table7.rol_2, table7.rol_3 WG, table2.dt爲 「SBD」, table2.wk_n爲 「SBFW」, table2.fmonth爲 「SBFM」,因爲 「有缺陷」 table3.defect_indicator, table2.sofw, 表2 .sofm 甲表1 從 加入乙表2上(table1.date_id = table2.dw_date_key) 加入第C表3(table1.date_id = table3.date_id和table1.incident_id = table3.incident_id) 加入上(表3表4 d .incident_id = table4.incident_id和table4.key_d < = table3.date_id和table3.table3_id = table4.current_owner_table3_id) 在table4.incident_id上加入E table5 .incident_id (table1.creation_dw_date_key = create_table2.dw_date_key) join F table6 on(table1.objectnumber = table6.DW_WORKGROUP_KEY) join G table7 on(table1.objectnumber = table7.DW_WORKGROUP_KEY) left outer JOIN H table8 ON(table8 .natural_key = table5.UPDATED_COT_TECH_KEY) 其中 table4.bl_incident_key在從d b (選擇最大值(bl_incident_key)其中b.incident_id = table3.incident_id和b.key_d < = table3.date_id和b.current_owner_table3_id = table3.table3_id) 和table2。fiscal_year_name在( '2013財年', '年度2014年度')
感謝您的回覆。是的,有一張表有超過5500萬條記錄。我已經嘗試在表上創建索引,但它沒有太大的影響,因爲我們從這些表中檢索更多數據。我會嘗試2/4平行提示,看看它是否有效。 – user3171342