JSSSTR> BEGIN
2 DBMS_RULE_ADM.CREATE_RULE_SET(
3 rule_set_name => ¨strmadmin.pro_to_bak_rules¨,
4 evaluation_context => ¨SYS.STREAMS$_EVALUATION_CONTEXT¨);
5 DBMS_RULE_ADM.CREATE_RULE(
6 rule_name => ¨strmadmin.dt_tbl1_dml_pro¨,
7 condition => ¨ :dml.get_object_owner() = ¨¨MEMBER¨¨ AND ¨ ||
8 ¨ :dml.get_object_name() = ¨¨DT_TBL1¨¨ AND ¨ ||
9 ¨ :dml.is_null_tag() = ¨¨Y¨¨ AND ¨ ||
10 ¨ :dml.get_source_database_name() = ¨¨JSSWEB.JSS.CN¨¨ ¨);
11 DBMS_RULE_ADM.CREATE_RULE(
12 rule_name => ¨strmadmin.dt_tbl1_ddl_pro¨,
13 condition => ¨ (:ddl.get_object_owner() = ¨¨MEMBER¨¨ OR ¨ ||
14 ¨ :ddl.get_base_table_owner() = ¨¨MEMBER¨¨) AND ¨ ||
15 ¨ :ddl.get_object_name() = ¨¨DT_TBL1¨¨ AND ¨ ||
16 ¨ :ddl.is_null_tag() = ¨¨Y¨¨ AND ¨ ||
17 ¨ :ddl.get_source_database_name() = ¨¨JSSWEB.JSS.CN¨¨ ¨);
18 DBMS_RULE_ADM.CREATE_RULE(
19 rule_name => ¨strmadmin.dt_tbl2_dml_pro¨,
20 condition => ¨ :dml.get_object_owner() = ¨¨MEMBER¨¨ AND ¨ ||
21 ¨ :dml.get_object_name() = ¨¨DT_TBL2¨¨ AND ¨ ||
22 ¨ :dml.is_null_tag() = ¨¨Y¨¨ AND ¨ ||
23 ¨ :dml.get_source_database_name() = ¨¨JSSWEB.JSS.CN¨¨ ¨);
24 DBMS_RULE_ADM.CREATE_RULE(
25 rule_name => ¨strmadmin.dt_tbl2_ddl_pro¨,
26 condition => ¨ (:ddl.get_object_owner() = ¨¨MEMBER¨¨ OR ¨ ||
27 ¨ :ddl.get_base_table_owner() = ¨¨MEMBER¨¨) AND ¨ ||
28 ¨ :ddl.get_object_name() = ¨¨DT_TBL2¨¨ AND ¨ ||
29 ¨ :ddl.is_null_tag() = ¨¨Y¨¨ AND ¨ ||
30 ¨ :ddl.get_source_database_name() = ¨¨JSSWEB.JSS.CN¨¨ ¨);
31 DBMS_RULE_ADM.CREATE_RULE(
32 rule_name => ¨strmadmin.dt_tmp_dml_pro¨,
33 condition => ¨ :dml.get_object_owner() = ¨¨MEMBER¨¨ AND ¨ ||
34 ¨ :dml.get_object_name() = ¨¨DT_TMP¨¨ AND ¨ ||
35 ¨ :dml.is_null_tag() = ¨¨Y¨¨ AND ¨ ||
36 ¨ :dml.get_source_database_name() = ¨¨JSSWEB.JSS.CN¨¨ ¨);
37 DBMS_RULE_ADM.CREATE_RULE(
38 rule_name => ¨strmadmin.dt_tmp_ddl_pro¨,
39 condition => ¨ (:ddl.get_object_owner() = ¨¨MEMBER¨¨ OR ¨ ||
40 ¨ :ddl.get_base_table_owner() = ¨¨MEMBER¨¨) AND ¨ ||
41 ¨ :ddl.get_object_name() = ¨¨DT_TMP¨¨ AND ¨ ||
42 ¨ :ddl.is_null_tag() = ¨¨Y¨¨ AND ¨ ||
43 ¨ :ddl.get_source_database_name() = ¨¨JSSWEB.JSS.CN¨¨ ¨);
44 DBMS_RULE_ADM.ADD_RULE(
45 rule_name => ¨strmadmin.dt_tbl1_dml_pro¨,
46 rule_set_name => ¨strmadmin.pro_to_bak_rules¨);
47 DBMS_RULE_ADM.ADD_RULE(
48 rule_name => ¨strmadmin.dt_tbl1_ddl_pro¨,
49 rule_set_name => ¨strmadmin.pro_to_bak_rules¨);
50 DBMS_RULE_ADM.ADD_RULE(
51 rule_name => ¨strmadmin.dt_tbl2_dml_pro¨,
52 rule_set_name => ¨strmadmin.pro_to_bak_rules¨);
53 DBMS_RULE_ADM.ADD_RULE(
54 rule_name => ¨strmadmin.dt_tbl2_ddl_pro¨,
55 rule_set_name => ¨strmadmin.pro_to_bak_rules¨);
56 DBMS_RULE_ADM.ADD_RULE(
57 rule_name => ¨strmadmin.dt_tmp_dml_pro¨,
58 rule_set_name => ¨strmadmin.pro_to_bak_rules¨);
59 DBMS_RULE_ADM.ADD_RULE(
60 rule_name => ¨strmadmin.dt_tmp_ddl_pro¨,
61 rule_set_name => ¨strmadmin.pro_to_bak_rules¨);
62 DBMS_PROPAGATION_ADM.CREATE_PROPAGATION(
63 propagation_name => ¨str_to_bak¨,
64 source_queue => ¨strmadmin.streams_queue¨,
65 destination_queue => ¨strmadmin.streams_queue¨,
66 destination_dblink => ¨jssbak.jss.cn¨,
67 rule_set_name => ¨strmadmin.pro_to_bak_rules¨);
68 END;
69 /
PL/SQL procedure successfully completed.