Below are the steps to create a rule that prevents a user named
thomas_cook from seeing more than 5 rows when the user runs a query on a published table
/services/databases/examples/ViewOrder.
1. Go the the TDV (TIBCO Data Virtualization) Web Manager, and click on
Configuration >>
Workload Management.
2. Click the
Add Rule button, and enter a name for the rule.
3. From the drop-down menu next to
Rule Type, select the Row Limit option. Type 5 into the
Maximum Row Count field. This will limit the user to seeing a maximum of 5 rows.
4. In the
Users/Groups section, click the green "+" button to add a new entry. Configure the new entry as follows:
----------------------
Domain : composite (change this if another domain is being used)
Member Type : User
Name : thomas_cook
----------------------
5. In the
Resources section, section, click the green "+" button to add a new entry. Add the full pathname of the published table
Example: /services/databases/examples/ViewOrder
6. To get a written confirmation in the logs that the rule was executed, select Log Server Event as the
Action, and enter the following in the
Log Server Event Body text box:
WARNING: The results of this query will be limited to 5 rows, as the system has a rule in place for limiting rows. If you want to increase the limit, please contact your TDV (TIBCO Data Virtualization) administrator
TDV will write this warning to
cs_server_events.log whenever this rule has been used.
The screenshot below shows the completed configuration.
To Test the rule:
1. Connect to the TDV server as
thomas_cook using any client application (e.g. DB Visualizer)
2. Run a query on the published table
Example: select * from ViewOrder;
3. The client application should display a maximum of 5 rows as shown below.
4. Open <TDV_INSTALL_DIR>/logs/
cs_server_events.log with any text editor. The log should contain a warning message as shown below.
----------------------
2020-08-05 14:30:57.048 -0700 INFO WorkloadRuleViolation
Workload rule violated : Workload rule 'FirstRule'. Request exceeded 5 row(s). WARNING: The results of this query will be limited to 5 rows, as the system has a rule in place for limiting rows. If you want to increase the limit, please contact your TDV (TIBCO Data Virtualization) administrator 22
thomas_cook composite 22101 6386652228193 6386652228193 Workload rule 'FirstRule'.
Request exceeded 5 row(s). WARNING: The results of this query will be limited to 5 rows, as the system has a rule in place for limiting rows. If you want to increase the limit, please contact your TDV (TIBCO Data Virtualization) administrator
----------------------