Logging for myuser2 changes as rules are successively disabled by submitting END QUERY LOGGING requests.
(Rule 1) Summary logging for any user, any account:
BEGIN QUERY LOGGING LIMIT SUMMARY = 1,5,10 CPUTIME ON ALL ;
These requests create the following two new rules in DBC.DBQLRuleTbl:
- (Rule 2) Log default information and SQL for any user with specific account 'sales'
- (Rule 3) Do not log for myuser2 with specific account 'sales'
BEGIN QUERY LOGGING WITH SQL ON ALL ACCOUNT='sales'; BEGIN QUERY LOGGING WITH NONE ON myuser2 ACCOUNT = 'sales';
This request creates the following two additional new rules in DBC.DBQLRuleTbl:
- (Rule 4) Log default, SQL and objects for myuser2, any account
- (Rule 5) Log default, SQL and objects for myuser3, any account
BEGIN QUERY LOGGING WITH SQL, OBJECTS ON myuser2, myuser3;
The following query logging activity results from these rules:
- User myuser2 logs on with account 'sales', so Rule 3 applies and no logging occurs.
- This request removes Rule 2, but myuser2:'sales ' continues to use Rule 3:
END QUERY LOGGING on ALL ACCOUNT='sales';
- This request removes Rule 3, so myuser2:'sales' begins to log queries using Rule 1 with the summary log instead of using Rule 3 as before:
END QUERY LOGGING myuser2 ACCOUNT='sales';