Professional Documents
Culture Documents
1)
https://gssdba.wordpress.com/2011/04/20/steps-to-implement-schema-level-oracle-streams/
Query DBA_STREAMS_UNSUPPORTED to get the list of Tables and the reason why streams won’t support
STEP 1: ADD SUPPLEMENT LOGIN TO ALL THE TABLES WHICH ARE PART OF STREAMS REPLICATION
Add the supplement login for all the tables present in SANKARG schema at the source side
show user
alter database force logging;
alter table SANKARG.BOX ADD SUPPLEMENTAL LOG DATA (ALL,PRIMARY KEY,UNIQUE,FOREIGN KEY)
columns;
SHOW USER
– Restart DB
SHOW USER
– Restart DB
create user STRMADMIN identified by STRMADMIN default tablespace strepadm temporary tablespace temp;
execute DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE('STRMADMIN');
- Connect as the Streams Administrator, create the streams queue and the database link that will be used
- Add the target TNS ENTRY details in the tnsnames.ora file (add source entry in target also)
show user
create database link TARGET connect to STRMADMIN identified by STRMADMIN using 'TARGET';
show user
create user STRMADMIN identified by STRMADMIN default tablespace strepadm temporary tablespace temp;
execute DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE('STRMADMIN');
– IF SANKARG schema is not present in the target please create the same.
connect STRMADMIN@SOURCE
show user
BEGIN
DBMS_STREAMS_ADM.SET_UP_QUEUE(
END;
conn STRMADMIN@TARGET
show user
BEGIN
DBMS_STREAMS_ADM.SET_UP_QUEUE (
END;
conn strmadmin@SOURCE
SHOW USER
BEGIN
DBMS_STREAMS_ADM.ADD_SCHEMA_PROPAGATION_RULES(
END;
CONN strmadmin@SOURCE
show user
BEGIN
DBMS_STREAMS_ADM.ADD_SCHEMA_RULES(
END;
CONN STRMADMIN/STRMADMIN@TARGET
show user
BEGIN
DBMS_STREAMS_ADM.ADD_SCHEMA_RULES(
END;
STEP 12: CREATE NEGATIVE RULE AT SOURCE FOR UNSUPPORTED TABLES – SOURCE
Set negative rule for all the tables which are unsupported by streams (List you got from querying
DBA_STREAMS_UNSUPPORTED)
conn strmadmin@SOURCE
show user
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_RULES(
END;
SOURCE:
vi exp_streams.par
file=exp_streams.dmp
log=exp_streams.log
object_consistent=y
OWNER=SANKARG
STATISTICS=NONE
TARGET:
connect STRMADMIN@TARGET
show user
BEGIN
DBMS_APPLY_ADM.START_APPLY(
END;
—- Set stop_on_error to false so apply does not abort for every error; then, start the Apply process on the
destination
BEGIN
DBMS_APPLY_ADM.SET_PARAMETER(
END;
— Start Apply
BEGIN
DBMS_APPLY_ADM.START_APPLY(
END;
connect STRMADMIN@TARGET
show user
BEGIN
DBMS_CAPTURE_ADM.START_CAPTURE(
END;
Notes:
======
======================
APPLY_NAME = STREAM_APPLY_A1
CAPTURE_NAME = STREAM_CAPTURE_C1
PROPAGATION_NAME = STREAM_PROPAGATION_P1
Execute the below steps with streams administrator user only:
=============================================================
BEGIN
DBMS_APPLY_ADM.STOP_APPLY(
apply_name => 'STREAM_APPLY_A1');
END;
/
BEGIN
DBMS_PROPAGATION_ADM.STOP_PROPAGATION(
propagation_name => 'STREAM_PROPAGATION_P1');
END;
/
BEGIN
DBMS_CAPTURE_ADM.STOP_CAPTURE(
capture_name => 'STREAM_CAPTURE_C1');
END;
/
CAPTURE_NAME = STREAM_CAPTURE_C1
PROPAGATION_NAME = STREAM_PROPAGATION_P1
BEGIN
DBMS_APPLY_ADM.START_APPLY(
END;
BEGIN
DBMS_PROPAGATION_ADM.START_PROPAGATION(
END;
/
BEGIN
DBMS_CAPTURE_ADM.START_CAPTURE(
END;