You may enable many different rules for various users, user accounts, or applications. DBQL checks for rules to apply in the following order:
- All users under a specific application name
- Specific user, specific account
- Specific user, all accounts
- All users, specific accounts
- All users, all accounts
To create exceptions to the rules, use the WITH NONE option. You can create a rule to exclude certain sessions from a broader rule by using the WITH NONE option. For example, if you want to create a rule that enables logging for all users logging on under a specific application except for user1, you could create a rule to log all users for that application and create another rule using the WITH NONE option for user1 to disable logging just for user1. (See the example under Scenarios of Logging Accounts.)
As each user logs on, DBQL first searches the rule cache for a rule, and if no rule is found, it searches the DBQLRuleTbl table. The searches are based on the order of this best fit rule hierarchy.