Grant
appropriate privileges to the Objects / schema for which the apply
rules have been setup, to apply the DDL or DML changes.
If DEMO.DEPT and DEMO.EMP already
exist in DEMO@remote.world then grant
SELECT, INSERT and UPDATE privileges to the Streams administrator. Otherwise,
with respect to this example, export the tables from the source database as
specified in step 9.
Set
up the instantiation SCNs for the tables.
In addition to using supplied
PL/SQL packages, you can also use Export/Import Oracle utility to set up
Instantiation SCNs for database objects.
NOTE:
In Oracle streams the tables identified for capturing and applying
changes should have primary keys defined on them.
Now to start the
processes at the respective databases.
/* Start Apply process at the destination database.
Login to STRMADMIN@REMOTE.WORLD*/
DECLARE
v_started number;
BEGIN
SELECT decode(status, 'ENABLED', 1, 0) INTO v_started
FROM DBA_APPLY WHERE APPLY_NAME = 'STRMADMIN_LOCAL';
if (v_started = 0) then
DBMS_APPLY_ADM.START_APPLY(apply_name => 'STRMADMIN_LOCAL');
end if;
END;
/
/* Start Capture process at the destination database
Login to STRMADMIN@LOCAL.WORLD */
DECLARE
v_started number;
BEGIN
SELECT decode(status, 'ENABLED', 1, 0) INTO v_started
FROM DBA_CAPTURE WHERE CAPTURE_NAME = 'STRMADMIN_CAPTURE';
if (v_started = 0) then
DBMS_CAPTURE_ADM.START_CAPTURE(capture_name => 'STRMADMIN_CAPTURE');
end if;
END;
/