Note
This view is available starting with V4.1.0.
Purpose
This view records the rules for rewriting SQL statements in the current tenant.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| DB_NAME | VARCHAR2(128) | NO | The DB_NAME specified when the rule was defined. |
| RULE_NAME | VARCHAR2(256) | NO | The name of the rule. |
| RULE_ID | NUMBER | NO | The ID of the rule. |
| PATTERN | CLOB | NO | The template of the statement that matches the rule. |
| REPLACEMENT | CLOB | NO | The template that specifies how to rewrite statements that match the pattern. |
| NORMALIZED_PATTERN | CLOB | NO | The parameterized pattern. |
| STATUS | VARCHAR2(8) | NO |
|
| VERSION | NUMBER | NO | The version number of the rule. |
| PATTERN_DIGEST | NUMBER | NO | The hash value of the normalized pattern. |
Sample query
Query the rules for rewriting SQL statements in the current tenant.
obclient [SYS]> SELECT * FROM SYS.DBA_OB_USER_DEFINED_RULES;
The query result is as follows:
+---------+-----------+---------+--------------------+------------------------+--------------------+--------+---------+---------------------+
| DB_NAME | RULE_NAME | RULE_ID | PATTERN | REPLACEMENT | NORMALIZED_PATTERN | STATUS | VERSION | PATTERN_DIGEST |
+---------+-----------+---------+--------------------+------------------------+--------------------+--------+---------+---------------------+
| SYS | rule1 | 500025 | select ? from dual | select ? + 1 from dual | select ? from dual | ENABLE | 2 | 2647993221679348756 |
+---------+-----------+---------+--------------------+------------------------+--------------------+--------+---------+---------------------+
1 row in set
