Duplicates in Materialized view
Hi,
I have created a materialized view in Database B from 5 tables in DATABASE A. Each table has millions of records. The query for materialized view joins all these 5 tables and gets the data. If I do complete refresh it takes upto 4 hours. I want this materialized view refreshed every 3 hrs since that table will be used very often. So I decided to do fast refresh every 3 hrs. But when I created the materialized view first time there are no duplicates since it was a complete refresh. But after that each time the fast refresh happens I see different number of duplicates in the materialized view. Very rarely one or two times there is no duplicate. Why is this happens. If I add Unique index then there is an error message stating "Unique constraint Violated" (this is since the existing records are being inserted again instead of updated).
Any help is appreciated.
Thanks...
Yes. I have the materialized view logs for all the 5 tables in the remote database. First time when I created the materialized view it took around 4 hrs and there were no duplicates. I am doing the fast refresh every 6 hrs. After each fast refresh there are different number of duplicates. I don't have access to get the explain_mview to see the capabilities. I requested my DBAdmin to get that. In the meantime, if you have any other thoughts please let me know. I suspect whether the materialized view logs are not working as expected. But not sure.
Similar Messages
-
ORA-00957 Duplicate Column Name Materialized View ( UPDATED: Not answered)
Hello all. I am getting this error when trying to create a Materialized View. I have many other MV I created without problem, but I cannot find the catch up here, can anyone help?. I cannot find any duplicates. The only duplicate I though was the Pipeline_Code column that was entered into the function and the one being being called out as a column. To check, I renamed the latter and still am getting this issue.
Any help would be greatly appreciated.
Thanks!
The query is below:
CREATE MATERIALIZED VIEW MV_TEST_STATION
REFRESH COMPLETE
START WITH TO_DATE('20-SEP-2013 00:00:00','dd-mon-yyyy hh24:mi:ss')
NEXT (SYSDATE +12/24)
AS
SELECT T.TEST_STATION_ID,
--(SELECT TEST_STATION_TYPE.DESCRIPTION
-- FROM TEST_STATION_TYPE
-- WHERE TEST_STATION.TEST_STATION_TYPE =
-- TEST_STATION_TYPE.TEST_STATION_TYPE)
--AS TEST_STATION_TYPE,
TST.DESCRIPTION AS TEST_STATION_TYPE,
T.SURVEY,
T.STATUS,
T.STATION,
F_TRUESTATION2 (
T.STATION,
T.PIPELINE_CODE,
F_REROUTE_CODE (T.STATION,
T.PIPELINE_CODE))
AS TRUE_STATION,
T.REQUIRED,
-- (SELECT PIPELINE_CODES.PIPELINE_CODE_DESCRIPTION
-- FROM PIPELINE_CODES
-- WHERE TEST_STATION.PIPELINE_CODE = PIPELINE_CODES.PIPELINE_CODE)
-- AS PIPELINE_CODE,
PC.PIPELINE_CODE_DESCRIPTION AS PC_PIPELINE_CODE,
T.INSTALL_DATE,
T.FUNCTIONAL COMMENTS,
TSR.TEST_STATION_READING_ID,
TSR.TEST_DATE,
TSR.SURVEYOR,
TSR.ON_VOLTS,
TSR.ON_BG,
TSR.ON_AG,
TSR.METER_UTC,
TSR.METER_ID,
TSR.IO_BG,
TSR.IO_AG,
TSR.INSTANT_OFF_VOLTS,
TSR.FUNCTIONAL_DAMAGE_OUT,
TSR.FUNCTIONAL_DAMAGE_IN,
TSR.COSEMETIC_DAMAGE_OUT,
TSR.COSEMETIC_DAMAGE_IN,
TSR.COMMENTS,
TSR.CASING_ON,
TSR.CASING_OFF,
TSR.CASING,
TSR.CALIBRATION_DUE_DATE,
TSR.ANODE_AMPS_ON,
TSR.ANODE_AMPS_OFF,
TSR.ANODE
FROM TEST_STATION T
INNER JOIN TEST_STATION_TYPE TST ON T.TEST_STATION_TYPE = TST.TEST_STATION_TYPE
INNER JOIN PIPELINE_CODES PC ON T.PIPELINE_CODE = PC.PIPELINE_CODE
INNER JOIN TEST_STATION_READING TSR ON T.TEST_STATION_ID = TSR.TEST_STATION_ID
WHERE T.TEST_STATION_ID = TSR.TEST_STATION_IDsince we don't have your tables or data, we can not run, test, fix or improve posted code
How do I ask a question on the forums?
https://forums.oracle.com/message/9362002#9362002 -
Refresh time for Materialized View
Hi,
I have created a materialized view and set it to refresh everyday at 4 am . When I check the status of the job , it shows the refresh timing between 20 mins to 4 hours . That means , some times it takes 20 mins to refresh , some times 40 , some time 2 hours and some times up to 4 hours. Any reason for the wide range ? Here is the query for the view.
CREATE MATERIALIZED VIEW BDS_COST_CATEGORY_MV
ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "USERS"
BUILD IMMEDIATE
USING INDEX
REFRESH COMPLETE ON DEMAND START WITH sysdate+0 NEXT ROUND(SYSDATE + 1) + 4/24
USING DEFAULT LOCAL ROLLBACK SEGMENT
DISABLE QUERY REWRITE
AS SELECT AC.ACCOUNT_MANAGER, AC.ACCOUNT_NUMBER,
AC.ACCOUNT_NAME, DIV.DIVISION_NUMBER, ITEM.CODE_ID,
ITEM.CODE_NAME COST_CATEGORY_ITEM,
TO_NUMBER(TO_CHAR(AP.FIRST_DAY,'YYYY')) PERIOD_YEAR,
AP.FIRST_DAY PERIOD,
SUM(NVL(AD.CURRENT_EXPENSE,0)) EXPENSE
FROM ACCOUNTS AC, PERSONNEL AC_MGR, DIVISIONS DIV, ASR_HEADERS AH , ASR_DETAILS AD, CODES ITEM, CODES COSTCAT, ALL_PERIODS AP,
CODES COST_ELEMENT, ACCOUNTING_BASE_GROUP ABG
WHERE AC.ACCOUNT_MANAGER = AC_MGR.PERSONNEL_ID
AND AC_MGR.DIVISION_ID = DIV.DIVISION_ID (+)
AND AC.ACCOUNT_ID = AH.ACCOUNT_ID
AND AH.ASR_HEADER_ID = AD.ASR_HEADER_ID
AND AH.PERIOD_ASR = AP.FISCAL_SYSTEM_PERIOD_CAL_YR_EQ||', '|| AP.FISCAL_YEAR
AND ABG.COST_ELEMENT_CAT_ITEM_ID = ITEM.CODE_ID
AND COST_ELEMENT.CODE_ID = ABG.COST_ELEMENT_ID
AND AD.OBJECT_CODE = COST_ELEMENT.CODE_VALUE
AND ITEM.CODE_PARENT_ID = COSTCAT.CODE_ID
AND ( COSTCAT.CODE_NAME = 'BDS' OR ( COSTCAT.CODE_NAME = 'Base' AND ITEM.CODE_NAME = 'MTDC'))
GROUP BY AC.ACCOUNT_MANAGER,AC.ACCOUNT_NUMBER, AC.ACCOUNT_NAME,
DIV.DIVISION_NUMBER, ITEM.CODE_ID, ITEM.CODE_NAME,
TO_NUMBER(TO_CHAR(AP.FIRST_DAY,'YYYY')), AP.FIRST_DAYThis appears to be a duplicate of Refreshing Materilized view. I replied on the other thread.
Justin -
Materialized view to ensure data integrity over multiple tables
Hello,
I have a problem and I am not able to solve it. Partially, It is because of my poor SQL skills. I have three tables and I am using one sequence to enter data into them.
What I am tying to do is to create a materialized view ( complete or fast, whichever) with refresh on commit option to check that each table contains unique data in comparison to other.
I am posting code so you can get along:
CREATE TABLE table_1 (
ID NUMBER PRIMARY KEY
CREATE TABLE table_2 (
ID NUMBER PRIMARY KEY
CREATE TABLE table_3 (
ID NUMBER PRIMARY KEY
INSERT INTO table_1 VALUES (1);
INSERT INTO table_1 VALUES (2);
INSERT INTO table_2 VALUES (3);
INSERT INTO table_2 VALUES (4);
INSERT INTO table_3 VALUES (5);
INSERT INTO table_3 VALUES (6); I want to write create a materialized view that will give me output only in case that there are same values in two different tables. I got this far.
CREATE MATERIALIZED view mv_test
REFRESH COMPLETE ON COMMIT
AS
SELECT count(1) ROW_COUNT
FROM dual
WHERE EXISTS (
SELECT a.id
FROM table_1 a
WHERE a.id IN(
SELECT b.id
FROM table_2 b))
OR EXISTS (
SELECT a.id
FROM table_1 a
WHERE a.id IN
(SELECT c.id
FROM table_3 c))
OR EXISTS (
SELECT b.id
FROM table_2 b
WHERE b.id IN
(SELECT c.id
FROM table_3 c));
ALTER MATERIALIZED VIEW mv_test
ADD CONSTRAINT cs_mv_test
CHECK (row_count = 0) DEFERRABLE; This sql statement itself returns no rows if my logic is correct. And in case there were some duplicate rows in two different table, it would return 1 and constraint would throw an error.
However, I cannot create this with ON COMMIT option. When I try to compile I get:
ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view I went through documentation, tried creating mat_view logs etc.
I know that one of the mistakes is that I am referencing dual table and I am not sure if I can use EXISTS.
Unfortunately, my SQL wisdom ends here. I need help rewriting the sql, so it would work in materialized view with refresh on commit option. Please, help!!!
I know that since I am using a sequence there is little chance that same value will get into two different tables, but I would like to perform somekind of check.
Thank you in advance.>
I know that since I am using a sequence there is little chance that same value will get into two different tables, but I would like to perform somekind of check.If you are certain that you control all the inputs to the table and you are definitely using one sequence to insert into all three tables then there is physically no possible way you will get duplicate values across tables.
Writing something to check if this is the case would almost be like writing something to verify that 1+1 really does equal 2 in 100% of cases.
if you must, however. consider something similar to the following which may be more performant:
select *
from table_1 t1
full outer join table_2 t2 on (t1.id = t2.id)
full outer join table_3 t3 on (t1.id = t2.id
or
t2.id = t3.id)
where t1.id+t2.id+t3.id not in (t1.id,t2.id,t3.id); -
hello experts
what does it mean by identification of duplicates in material master and how its done?
whether its applicable for all master records?
regardsHi,
The safety time / actual range of coverage ensures that the planned warehouse stock covers the requirements of a defined number of days. It therefore serves as a time float and thus works alongside the safety stock, which acts as quantity float.
The system simulates bringing the requirements forward by the specified number of days and the planning for the receipts, created for these requirements in the planning run, is also brought forward by this number of days.
Prerequisites
· You have set the Safety Time indicator in the material master record (MRP 2 View) to define whether the safety time is only to apply to independent requirements or to all requirements.
· In the material master record (MRP 2 View), in the Safety Time/Actual Range of Coverage field, you have entered the number of workdays by which the requirements are to be brought forward.
· If, in addition to this actual range of coverage, you also want to define a different number of workdays in certain periods or a safety time less than one day then, in Customizing for MRP in the activity Define Period Profile for Safety Time/Actual Range of Coverage you can define a period profile and assign it to the material in the material master record.
Regards,
Vijay -
Materialized views - query rewrite -- optional joins & dimensions
Hi,
I've implemented a number of materialized views that are accessible via query rewrite.
Most of these views make use of duplicate tables (DD_TIME table is joined via purchase, load, process, ... date columns)
I've also created a dimension to make Oracle aware of the time relation (month is child of year...)
The issue:
--> If I create the mat. view with inner joins, query rewrite works with the dimensions, but I need to provide ALL joined tables in the query
--> If I create the mat. view with outer joins, query rewrite works even with 1 joined table, but the dimension seems to be ignored
How can I create 'optional' joins in the Mat. View while making use of dimensions for rollup?
(the limitations on materialized view delta joins mentioned on [oracle docs|http://docs.oracle.com/cd/B28359_01/server.111/b28313/qradv.htm#autoId16] kinda has me worried)
Example Mat. View:
CREATE MATERIALIZED VIEW DA_REPOSITORY_MERCHANT_MM
... ENABLE QUERY REWRITE
AS SELECT
DDFPC.YEAR_NO,
DDFPC.YEAR_MONTH,
DDPUR.YEAR_NO,
DDPUR.YEAR_MONTH,
SUM( DF.TRANSACTION_AMOUNT )
FROM DF_REP DF,
DD_TIME DDFPC,
DD_TIME DDPUR
WHERE DF.FPC_DTE = DDFPC.DAY_DATE(+)
AND DF.PUR_DTE = DDPUR.DAY_DATE(+)
GROUP BY
DDFPC.YEAR_NO,
DDFPC.YEAR_MONTH,
DDPUR.YEAR_NO,
DDPUR.YEAR_MONTH
Example query launched:
SELECT
DDFPC.YEAR_NO,
SUM( DF.TRANSACTION_AMOUNT )
FROM DF_REP DF,
DD_TIME DDFPC
WHERE DF.FPC_DTE = DDFPC.DAY_DATE
GROUP BY
DDFPC.YEAR_NOThe problem was resolved by setting foreign keys in the fact table and making them not nullable + using inner joins.
--> this informs oracle there can be no difference between a query without the dimensions and a query with the dimensions.
As a result, the materialized view can contain 1 fact linked to 2 dimension tables, but the query rewrite will work for queries on the 1 fact joined with only 1 dimension -
Materialized View Refresh and I_SNAP$ Indexes issue
At the time of doing REFRESH of the Materialized View, we are getting error like -
SQL> EXECUTE DBMS_MVIEW.REFRESH('MV_TEST.MY_VIEW,'CF');
BEGIN DBMS_MVIEW.REFRESH('MV_TEST.MY_VIEW,'CF'); END;
ERROR at line 1:
ORA-12008: error in materialized view refresh path
ORA-00001: unique constraint (MV_TEST.I_SNAP$_FIN_RESULT_EXPENSE1) violated
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2545
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2751
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2720
ORA-06512: at line 1
I tried to drop and recreate the index I_SNAP$_FIN_RESULT_EXPENSE1 but it didn’t helped.
Later I dropped the index I_SNAP$_FIN_RESULT_EXPENSE1 and refreshed the materialized view and it was successful (obvious). But when I tried to recreate the index, I got the following error –
SYS_OP_MAP_NONNULL("FIN_MULT"), SYS_OP_MAP_NONNULL("FIN_CD"))
ERROR at line 8:
ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found
When I look at the value of SYS_OP_MAP_NONNULL('FIN_CD'), it seems to be unique.
SQL> select SYS_OP_MAP_NONNULL('FIN_CD') from dual;
SYS_OP_MAP_NONNULL('FIN_CD’)
46494E5F5650545F4C564C5F335F434400
My questions are:
1. Why are the indexes (I_SNAP$_*) automatically created for?
2. What is the purpose of these (I_SNAP$_*) indexes?
3. What harm can be there if we drop these (I_SNAP$_*) indexes?
4. Why it is complaining about the Duplicate records / Uniqueness?
5. How to know where exactly the problem is in this case?
6. What is the solution for this problem? How to recreate these indexes successfully?
Thanks!This forum is for the OLAP Option (which supports a cool featured called cube-organized materialized views). If this question if about table-based materialized views you should post it the General Oracle Database forum. Good luck.
-
Hi All
We are executing a materialized view fast refresh and go an error on the child view
SQL> execute DBMS_MVIEW.REFRESH('ADRN_MV', nested => TRUE, atomic_refresh=>false);
BEGIN DBMS_MVIEW.REFRESH('ADRN_MV', nested => TRUE, atomic_refresh=>false); END;
ERROR at line 1:
ORA-30439: refresh of 'ADRN_CH_MV' failed because of ORA-12008:
error in materialized view refresh path
ORA-00001: unique constraint (ADRN_CH_MV_PK) violated
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2254
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2454
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2429
ORA-06512: at line 1
I disabled the primary key and ran the fast refresh of the parent MV(ADRN_MV), the refresh got succeeded without any error. I also looked at the MV (ADRN_CH_MV) which was complaining of primary key but found there are no duplicates.
1. What might have happened here?
2. How can we trace which row threw an error for primary key violation?
3. How can we trace what is happening in "ADRN_MV"
Any help or pointers wold be appreciated.
Thanks
SBwhich was complaining of primary key but found there are no duplicates.I wonder how did you search for duplicate records??
2. How can we trace which row threw an error for primary key violation?http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:15258974323143
HTH. -
Materialized View and I_SNAP$ Indexes
Hello Everybody,
At the time of doing REFRESH of the Materialized View, we are getting error like -
SQL> EXECUTE DBMS_MVIEW.REFRESH('MV_TEST.MY_VIEW,'CF');
BEGIN DBMS_MVIEW.REFRESH('MV_TEST.MY_VIEW,'CF'); END;
ERROR at line 1:
ORA-12008: error in materialized view refresh path
ORA-00001: unique constraint (MV_TEST.I_SNAP$_FIN_RESULT_EXPENSE1) violated
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2545
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2751
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2720
ORA-06512: at line 1
I tried to drop and recreate the index I_SNAP$_FIN_RESULT_EXPENSE1 but it didn’t helped.
Later I dropped the index I_SNAP$_FIN_RESULT_EXPENSE1 and refreshed the materialized view and it was successful (obvious). But when I tried to recreate the index, I got the following error –
SYS_OP_MAP_NONNULL("FIN_MULT"), SYS_OP_MAP_NONNULL("FIN_CD"))
ERROR at line 8:
ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found
When I look at the value of SYS_OP_MAP_NONNULL('FIN_CD'), it seems to be unique.
SQL> select SYS_OP_MAP_NONNULL('FIN_CD') from dual;
SYS_OP_MAP_NONNULL('FIN_CD’)
46494E5F5650545F4C564C5F335F434400
My questions are:
1. Why are the indexes (I_SNAP$_*) automatically created for?
2. What is the purpose of these (I_SNAP$_*) indexes?
3. What harm can be there if we drop these (I_SNAP$_*) indexes?
4. Why it is complaining about the Duplicate records / Uniqueness?
5. How to know where exactly the problem is in this case?
6. What is the solution for this problem? How to recreate these indexes successfully?
Thanks!Hello Rafi,
I don't have any MLOG$_<table> in the database, After connecting as SYS -
SQL> select tname from tab where tname like '%MLOG%';
TNAME
MLOG_REFCOL$
MLOG$
C_MLOG#
SQL> select count(*) from mlog$;
COUNT(*)
0
I am not using Replication here -
SQL> select tname from tab where tname like '%RUPD%';
no rows selected
Why you think that granting SELECT access to MLOG$_* tables will solve this issue?
Thanks,
Roopesh -
CREATE MATERIALIZED VIEW ORA-00957
Hi
I have tried using this query to create a MVIEW and I get an ORA-00957 (duplicate column name)
select t.month
,t.year
,t.entity_code
,t.itemref_local
,t.qty
,t.revenue
,t.cogs
,t.ppv
,t.FD
,t.var_labor
,t.var_ovhd
,n.code entity_code
,n.name entity_name
,n.finance_responsible
,c.local_name
,c.emea_name
,c.segment
,c.country
,c.origin_entity
,c.icp_code
,c.type
,c.rmm
,c.sales_rep
,c.sales_leader
,c.emea_director
,c.nat_accounts
,o.code country_code
,o.NAME country_name
,o.REGION country_region
,e.ELIMINATED
,i.PART_NUMBER
,i.DESCRIPTION part_description
,i.PRODUCT_GROUP
,i.LINE
,i.CATEGORY
,i.FAMILY
,i.RANGE
,i.SUPPLIER
,i.PLM
FROM hsce_transactions T
, hsce_entity N
, hsce_customers C
, hsce_country O
, hsce_elim E
, HSCE_ITEMS I
, HSCE_MAPPING M
WHERE T.entity_code = N.code
AND T.customer_code = C.customer_code
AND C.ICP_CODE = E.ICP_CODE
AND C.country = O.code
AND T.ITEMREF_LOCAL = M.ITEM_REF
and M.PART_NUMBER = I.PART_NUMBERCan anyone point me to where I have gone wrong?
Thanks
AdamI'm getting the duplicate column name on my query as well; however the validate feature in Toad, validated the query. I can select and even try to tune the query. therefore, I don't understand the error.
CREATE MATERIALIZED VIEW SYSADM.BAHAR_MV
STORAGE (
BUFFER_POOL DEFAULT
NOCACHE
NOLOGGING
COMPRESS
NOPARALLEL
BUILD IMMEDIATE
USING INDEX
STORAGE (
BUFFER_POOL DEFAULT
REFRESH COMPLETE ON DEMAND
WITH ROWID
USING DEFAULT LOCAL ROLLBACK SEGMENT
AS
/* Formatted on 2009/02/12 13:55 (Formatter Plus v4.8.7) */
SELECT a.business_unit, a.deptid, a.jobcode, a.emplid, f.oth_hrs, f.oth_earns,
h.gl_expense, f.erncd, d.descr, b.descr, c.descr, g.NAME, c.setid,
c.effdt, b.setid, b.deptid, b.effdt, e.check_dt, a.pay_end_dt,
i.ah89_ldr_summary, i.ah89_ldr_summ_grp
FROM ps_pay_earnings_bk a,
ps_bus_unit_tbl_hr d,
ps_pay_calendar e,
ps_pay_oth_earns f,
ps_pay_check g,
ps_earnings_tbl h,
ps_jobcode_tbl c,
ps_job j,
ps_emplmt_srch_qry j1,
ps_dept_tbl b,
ps_ah89_ldr_mappng i
WHERE j.jobcode = a.jobcode
AND j.business_unit = d.business_unit
AND j.setid_dept = d.business_unit
AND j.jobcode = c.jobcode
AND j.emplid = a.emplid
AND j.emplid = j1.emplid
AND j.empl_rcd = j1.empl_rcd
AND j.effdt =
(SELECT MAX (j_ed.effdt)
FROM ps_job j_ed
WHERE j.emplid = j_ed.emplid
AND j.empl_rcd = j_ed.empl_rcd
AND j_ed.effdt <= a.pay_end_dt)
AND j.effseq =
(SELECT MAX (j_es.effseq)
FROM ps_job j_es
WHERE j.emplid = j_es.emplid
AND j.empl_rcd = j_es.empl_rcd
AND j.effdt = j_es.effdt)
AND j.setid_jobcode = c.setid
AND j1.oprid = 'RECPRCSS'
AND a.company = f.company
AND a.paygroup = f.paygroup
AND a.pay_end_dt = f.pay_end_dt
AND a.off_cycle = f.off_cycle
AND a.page_num = f.page_num
AND a.line_num = f.line_num
AND a.addl_nbr = f.addl_nbr
AND a.company = g.company
AND a.paygroup = g.paygroup
AND a.pay_end_dt = g.pay_end_dt
AND a.off_cycle = g.off_cycle
AND a.page_num = g.page_num
AND a.line_num = g.line_num
AND a.sepchk = g.sepchk
AND a.business_unit = b.setid
AND a.company = e.company
AND a.paygroup = e.paygroup
AND a.pay_end_dt = e.pay_end_dt
AND h.erncd = f.erncd
AND h.erncd = i.erncd
AND b.deptid = a.deptid
AND h.effdt = (SELECT MAX (h_ed.effdt)
FROM ps_earnings_tbl h_ed
WHERE h.erncd = h_ed.erncd AND h_ed.effdt <= a.pay_end_dt)
AND c.effdt =
(SELECT MAX (c_ed.effdt)
FROM ps_jobcode_tbl c_ed
WHERE c.setid = c_ed.setid
AND c.jobcode = c_ed.jobcode
AND c_ed.effdt <= SYSDATE)
AND b.effdt =
(SELECT MAX (b_ed.effdt)
FROM ps_dept_tbl b_ed
WHERE b.setid = b_ed.setid
AND b.deptid = b_ed.deptid
AND b_ed.effdt <= SYSDATE)
AND EXISTS (SELECT i.rowsecclass
FROM ps_scrty_tbl_dept i
WHERE i.rowsecclass = 'DPALL' AND i.setid = a.business_unit); -
Data Replication Between Sqlserver and Oracle11g using materialized view.
I have Sqlserver 2005 as my source and oracle11g as my target.I need to populate the target daily with change data from source.
for that we have created a dblink between sqlserver and oracle and replicated that table as a Materialized view in Oracle.
problem we are getting here is Fast refresh option is not available.each day it will pick full data from the source.
is there any way to use Fast refresh in this scenario??
Thanks in advance.
Regards,
Balaram.Pl do not post duplicates - Data Replication Between Sqlserver and Oracle11g using materialized view.
-
Error: ORA-00905:Missing keyword while creating Materialized view
Hi Gurus,
I am trying to create a materialized view as :
1 CREATE MATERIALIZED VIEW AMREG.ClientData
2 TABLESPACE AMREG_DATA
3 COMPRESS
4 PARALLEL
5 NOLOGGING
6 BUILD IMMEDIATE
7 REFRESH COMPLETE
8 ON DEMAND
9 DISABLE QUERY REWRITE
10 REFRESH START WITH TRUNC( SYSDATE + 1 ) + 3/24 NEXT TRUNC( SYSDATE + 1 ) + 3/24
11 AS
12 SELECT
13 CHILD.CLIENT_SGK "Child SGK",
14 CHILD.CLIENT_NAME "Child Name",
15 CHILD.ARC_ACCT_CD "Child ARC Acct Code",
16 ULTIMATE.CLIENT_SGK "Ultimate Parent SGK",
17 ULTIMATE.CLIENT_NAME "Ultimate Parent Name",
18 ULTIMATE.ARC_ACCT_CD "Ultimate ARC Acct Code",
19 HIER.LVL_FROM_ANCESTOR ,
20 FROM [email protected] CHILD,
21 [email protected] HIER,
22 [email protected] ULTIMATE
23 WHERE HIER.DESCENDANT_CLIENT_SGK = CHILD.CLIENT_SGK
24* AND ULTIMATE.CLIENT_SGK = HIER.ANCESTOR_CLIENT_SGK;
SQL> /
REFRESH START WITH TRUNC( SYSDATE + 1 ) + 3/24 NEXT TRUNC( SYSDATE + 1 ) + 3/24
ERROR at line 10:
ORA-00905: missing keyword
DBLink name is : DNYCPH60.WORLD
Please guide me on this and help to resolve the issue.I provided the answer over at the duplicate post ...
ORA-00905: missing keyword error while creating a materialised view
Please, please, please ... please do not duplicate posts. Pick one. If you don't get an answer in a reasonable time - close it (edit the title) and THEN open in a different forum. -
[help] materialized view lost + duplicated data on remote - Fast Refresh
I created materialized view by "FAST REFRESH":
MASTER:
create SNAPSHOT log on XXX with rowid;
REMOTE:
create snapshot XXX
REFRESH fast START WITH SYSDATE NEXT SYSDATE + 1/86400 with rowid
as select * from XXX@DB_LINK;
-> I had many transactions insert/update/delete on MASTER.
Please help me any idea to protect data and fast replicate data.....=>
My Problem:
1. data duplicated on Remote server.
2. data lost on Remote server.I need to know anybody use materialized view log and found the problem like me.
I have changed script:
MASTER:
create SNAPSHOT log on XXX with primary key including new values;
REMOTE:
create snapshot XXX
REFRESH fast START WITH SYSDATE NEXT SYSDATE + 1/86400 with primary key
as select * from XXX@DB_LINK;
I'm sure new script to resolve duplicate, But not sure about data lose.
If you have some idea, Please inform me............... -
Materialized view Vs Streams - can you recommend one?
We have many materialized views (for change data capture) based on rowid as the source doesn’t have primary keys. The source DB will be upgraded to 10/11g (from 9). Because the data would be exported and imported back, the rowids will be changed at the source.
Consequently, the materialized views at the target need to be rebuilt. However, it is impossible to rebuild the materialized views timely due to huge volume.
We are thinking about using Oracle Streams instead of materialized views. Any advice would be greatly appreciated.
hbWith streams, primary are not require but your updates are not guarantee. If you have duplicates in your data, it will updates both which may or may not be what you want. BTW. Streams will not replicate table with rowid. I am assuming those rowid were required because you are outer joins with MVs.
If you want to stick with MVs, you can take exports of the tables, import after the upgrade and build the MVs with the prebuilt table option. It's a lot quicker then trying to recreate the MV or doing complete refresh over the WAN. -
Refresh/Update data in a materialized view
Hi,
I have question about the data in a materialized view and how it is refreshed. My mat view has all my dimension-ids and my (for my specialize needs) aggregated measures from my fact table. I used the mat view wizard to create my view - which works perfectly. But now I wonder if I have to create some sort of mapping(?) or some sort of trigger to refresh the data in the mat view. Or is the data automatically refreshed when I start my fact table mappings. I use OWB 11gR2
thxMVs have properties for refresh - you an refresh based on schedules or when dependent data is committed or manually.
Cheers
David
Maybe you are looking for
-
External hard drive music folder
While upgrading to iTunes 6.0.2 I must have done something wrong. iTunes kept giving me the message "The song "xxxxx..." could not be used because the original file could not be found". I have about 10,000 songs on my external HD. I followed the dire
-
Report to link invoices with attached documents
I am trying to spool a report from the oracle back end, for some senior staff at my organisation. The report would contain approved invoices along with their electronically attached documents. I have a similar query that works( see below) the problem
-
Word 2007 mail merge : problem with mixed portrait and landscape orientations
Hi there, I have a 3 pages document Word 2007 file This is a mail merge I want to export in PDF using Adobe Acrobat Printer, then send "big" PDF to printing. page 1 is PORTRAIT page 2 is PORTRAIT page 3 is LANDSCAPE In PDF pages 1 and 2 are perfectly
-
Problema extraño con Mac mini 2011
Hace 6 meses aproximadamente, compre mi mac mini, a los 2 dias de tenerla empeze a notar los defectos que aparecen en la imagen de muestra, cuadros de colores, las sobras de las ventanas con lineas negras, se ponia muy lenta al trabajar incluso al us
-
Trying to get broadband and youview installed
Since end of April, I have failed to get youview and infinity installed. I am now on my fourth attempt. Just before each installation BT cancels the order with no explanation. After the first it was suggested that I re-order and try again. After the