Hi i have a scenario where 2 different merge statements has to run on the same table on 2 different data sets. the merge or update should happen without any locks.
i tried the isolation level 'SERIALIZABLE' but couldn't achieve the results.
can anyone help me out with this?
create table date_test ( MIS_DATE date not null, runskey integer not null);
date run
30/09/2016 1
29/09/2016 2
create table test_RP ( MIS_DATE date not null, runskey integer not null, acct_no number not null, band number, entity varchar2(10));
the above table has data for 2 different dates
date run cnt 30/09/2016 1 3000000 29/09/2016 2 3000000
i am running 2 merges on the table to modify the band column. For the data under 30/09, the band should be 1 and 2 for 29/09.
merge into test_rp a using (select mis_date,runskey from DATE_TEST where mis_Date='30-sep-2016') b on (a.mis_date=b.mis_Date) when matched then update set band=1;
merge into test_rp a using (select mis_date,runskey from DATE_TEST where mis_Date='29-sep-2016') b on (a.mis_date=b.mis_Date) when matched then update set band=1;
when both these updates are running in parallel on the same table, only when the changes of one of the merges are committed, the other one starts.
is there any way that both the merges run independently and modify the data.