Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Materialized view with synonym

jorge pesqueraDec 5 2012 — edited Dec 11 2012
HI,

I created a materialized view that is based on a synonym, depending on the table you want to modify using the synonym to point to another table, but to cool it still uses the original referenced table synonym.

Is there a way, without deleting the materialized view, that the refresh will change the definition?

Example Post

CREATE OR REPLACE SYNONYM DWH.SYN_CCBCON4 FOR DWHADC.CCBCON4D;

CREATE MATERIALIZED VIEW DWH.VWM_CTO_INFO_0 (CONTRATO,FCH_ENTRADA)
TABLESPACE TS_DWH_01
NOCACHE
LOGGING
NOCOMPRESS
NOPARALLEL
BUILD IMMEDIATE
USING INDEX
REFRESH COMPLETE ON DEMAND
WITH PRIMARY KEY
AS
SELECT contrato contrato, MIN (fch_entrada) fch_entrada
FROM syn_ccbcon4
WHERE NVL (fecha_modificacion, TO_DATE (fch_entrada, 'YYYYMMDD')) >=
f_calc_max_fch_modif ('CTO_INFO', 'FCH_MODIF', '0')
AND posic_actual NOT IN ('030', '050')
GROUP BY contrato;

--> REFRESH MV

Change SYNONYM

CREATE OR REPLACE SYNONYM DWH.SYN_CCBCON4 FOR DWHADC.CCBCON5D;

--> REFRESH MV

But the data is of the table CCBCON4D.

thankx

Jorge.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 8 2013
Added on Dec 5 2012
2 comments
692 views