Note
This view is introduced since OceanBase Database V4.1.0.
Purpose
The DBA_OB_USER_DEFINED_RULES view displays the rules for customizing SQL statements.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| DB_NAME | VARCHAR2(128) | NO | The database name specified when the rule is defined. |
| RULE_NAME | VARCHAR2(256) | NO | The name of the rule. |
| RULE_ID | NUMBER | NO | The ID of the rule. |
| PATTERN | CLOB | NO | The pattern to which the rule matches. |
| REPLACEMENT | CLOB | NO | Indicates how to rewrite a statement template that matches a pattern. |
| NORMALIZED_PATTERN | CLOB | NO | The pattern after parameterization. |
| STATUS | VARCHAR2(8) | NO | Indicates whether the current rule takes effect. Valid values:
|
| VERSION | NUMBER | NO | The version number of the rule. |
| PATTERN_DIGEST | NUMBER | NO | The HASH value of NORMALIZED_PATTERN. |
Sample query
Query the custom rewrite SQL rules in the current tenant.
obclient [SYS]> SELECT * FROM SYS.DBA_OB_USER_DEFINED_RULES;
Here is the query result:
+---------+-----------+---------+--------------------+------------------------+--------------------+--------+---------+---------------------+
| 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