Monday, November 26, 2012

Steps to rebuild capture process in oracle 10g/11g Streams
==========================================================
Generate the Dictionary build SCN :-
-----------------------------------
set serveroutput on
declare
scn number;
begin
dbms_capture_adm.build(
first_scn => scn);
dbms_output.put_line('First SCN Value = ' || scn);   Note this SCN
end;
/


Loging with user strmadmin on source

exec dbms_capture_adm.stop_capture('CAPTURE_FOR_CR11');
exec dbms_capture_adm.drop_capture('CAPTURE_FOR_CS12');

exec dbms_capture_adm.prepare_schema_instantiation('APPSNOW'); 

From below query find out the ruleset name,ruleset owner,negative_rule_set_name running it on Source DB
------------------------------------------------------------------------------------------------------------
select queue_name, capture_name, rule_set_name, rule_set_owner,source_database,negative_rule_set_name, negative_rule_set_owner, checkpoint_retention_time from dba_capture where CAPTURE_NAME = 'CAPTURE_FOR_CR11' and queue_owner = 'STRMADMIN';

Building capture process with SCN on Source DB
-----------------------------------------------
begin
dbms_capture_adm.create_capture(
queue_name => 'STRMADMIN.CAPTURE_FOR_CS12_Q0',
capture_name => 'CAPTURE_FOR_CS12',
rule_set_name => 'RULESET$_144',
negative_rule_set_name => 'RULESET$_152',
first_scn => 459412546);
end;
/

Run below command on TARGET DATABASE
--------------------------------------------------
Login with user strmadmin on target DB 
        
BEGIN
DBMS_APPLY_ADM.SET_SCHEMA_INSTANTIATION_SCN(
source_schema_name    => 'APPS',
source_database_name  => 'CS11.GES.SYMANTEC.COM',
instantiation_scn     => 459412546,
recursive             => true);
END;
/

----------------  END -----------------------

No comments:

Post a Comment