Privileges
Before we can go any further, we need some extra privileges. These privileges will come along with the CREATE JOB
privilege that we saw in the previous chapter. We need to be able to create rule sets, rules, and evaluation contexts. We can do this by using the DBMS_RULE_ADM
package to grant the user, MARVIN
, the required privileges:
--/ BEGIN DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE (DBMS_RULE_ADM.CREATE_RULE_OBJ, 'MARVIN'); DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE (DBMS_RULE_ADM.CREATE_RULE_SET_OBJ, 'MARVIN'); DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE (DBMS_RULE_ADM.CREATE_EVALUATION_CONTEXT_OBJ, 'MARVIN'); END; /
This tiny bit of code gives MARVIN
the privileges to create rule sets, rules, and evaluation contexts.
We discussed earlier in the chapter what a rule is. A rule set, on the other hand, is a collection of the rules that control the chain. Mostly, we will not deal with rule sets as individual items and we will not even need to assign a name to them (but we could do so if we wanted...