Shadow

    Notes

    • Duplicate cannot be created
    • storageUnitMapping specifies the mapping relationship between the source database and the shadow library. You need to use the storage unit managed by RDL, please refer to
    • shadowAlgorithmType currently supports VALUE_MATCH, REGEX_MATCH and SIMPLE_HINT
    • When executing ALTER SHADOW RULE, the corresponding shadowAlgorithm will not be removed
    • When creating shadow rule, algorithmName will be automatically generated according to ruleName, tableName, and algorithm collection index. The default name is default_shadow_algorithm.

    Example

    1. CREATE SHADOW RULE shadow_rule(
    2. SHADOW=demo_ds_shadow,
    3. t_order(TYPE(NAME="SIMPLE_HINT", PROPERTIES("shadow"=true, "foo"="bar")),TYPE(NAME="REGEX_MATCH", PROPERTIES("operation"="insert","column"="user_id", "regex"='[1]'))),
    4. t_order_item(TYPE(NAME="VALUE_MATCH", PROPERTIES("operation"="insert","column"="user_id", "value"=1))));
    5. ALTER SHADOW RULE shadow_rule(
    6. SOURCE=demo_ds,
    7. SHADOW=demo_ds_shadow,
    8. t_order(TYPE(NAME="SIMPLE_HINT", PROPERTIES("shadow"=true, "foo"="bar")),TYPE(NAME="REGEX_MATCH", PROPERTIES("operation"="insert","column"="user_id", "regex"='[1]'))),
    9. DROP SHADOW ALGORITHM simple_hint_algorithm;
    10. CREATE DEFAULT SHADOW ALGORITHM TYPE(NAME="SIMPLE_HINT", PROPERTIES("shadow"=true, "foo"="bar"));
    11. ALTER DEFAULT SHADOW ALGORITHM TYPE(NAME="SIMPLE_HINT", PROPERTIES("shadow"=false, "foo"="bar"));
    12. SHOW DEFAULT SHADOW ALGORITHM;