oracle 12015,ORA-12015:无法从复杂查询创建快速刷新物化视图

我使用下面的查询来构建物化视图 .

CREATE MATERIALIZED VIEW gcms_business_profile_mview

BUILD IMMEDIATE

REFRESH FAST

WITH PRIMARY KEY

START WITH SYSDATE

NEXT (TRUNC (SYSDATE + 1) + 20 / 96)

AS

SELECT DISTINCT obp.bp_id,

obp.bp_typ_cd,

os.spcl_desc,

obpi.frs_nm,

obpi.mdl_nm,

NVL (rep_lst_nm.lst_nm, othr_lst_nm.lst_nm) last_name,

NVL (rep_lst_nm.lst_nm_typ_id, othr_lst_nm.lst_nm_typ_id)

last_name_type_id

FROM tr_ods.ods_business_parties obp

LEFT JOIN ( SELECT bp_id,

speciality_id,

updtd_dt,

ROW_NUMBER ()

OVER (PARTITION BY bp_id ORDER BY updtd_dt DESC)

AS spec_rn

FROM tr_ods.ods_bp_specialty

WHERE updtd_dt IS NOT NULL

) obs

ON obs.bp_id = obp.bp_id

AND obs.spec_rn =1

LEFT JOIN tr_ods.ods_specialty os

ON os.speciality_id = latest_spec.speciality_id

AND os.delete_flag = 'N'

LEFT JOIN tr_ods.ods_business_party_individuals obpi

ON obpi.bp_id = obp.bp_id

LEFT JOIN (SELECT obpln1.bp_id,

obpln1.lst_nm,

obpln1.lst_nm_typ_id,

ROW_NUMBER ()

OVER (PARTITION BY obpln1.bp_id ORDER BY updtd_dt DESC)

AS lst_rn_22

FROM tr_ods.ods_business_party_last_names obpln1

WHERE lst_nm_typ_id = 22

AND updtd_dt =

(SELECT MAX (obpln2.updtd_dt)

FROM tr_ods.ods_business_party_last_names obpln2

WHERE obpln2.bp_id = obpln1.bp_id

AND obpln2.lst_nm_typ_id = 22)) rep_lst_nm

ON (rep_lst_nm.bp_id = obp.bp_id AND rep_lst_nm.lst_rn_22 = 1)

LEFT JOIN (SELECT obpln1.bp_id,

obpln1.lst_nm,

obpln1.lst_nm_typ_id,

ROW_NUMBER ()

OVER (PARTITION BY obpln1.bp_id ORDER BY updtd_dt DESC)

AS lst_rn

FROM tr_ods.ods_business_party_last_names obpln1

WHERE lst_nm_typ_id IN (21, 23)

AND updtd_dt =

(SELECT MAX (obpln2.updtd_dt)

FROM tr_ods.ods_business_party_last_names obpln2

WHERE obpln2.bp_id = obpln1.bp_id

AND obpln2.lst_nm_typ_id IN (21, 23))) othr_lst_nm

ON (othr_lst_nm.bp_id = obp.bp_id AND othr_lst_nm.lst_rn = 1)

我正进入(状态

ORA-12015:无法从复杂的查询错误消息创建快速刷新物化视图 .

我已经为所有表创建了物化视图日志 . 任何人都可以帮我解决这个问题吗?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值