How to create a Workload Management rule to limit the number of rows returned by a query run on a published TIBCO Data Virtualization table?

How to create a Workload Management rule to limit the number of rows returned by a query run on a published TIBCO Data Virtualization table?

book

Article ID: KB0074859

calendar_today

Updated On:

Products Versions
TIBCO Data Virtualization 8.2 and higher

Description

How to create a Workload Management rule to limit the number of rows returned by a query run on a published TDV (TIBCO Data Virtualization) table?

Resolution

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.

User-added image

2.   Click the Add Rule button, and enter a name for the rule.

User-added image

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.

              User-added image


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
     ----------------------

User-added image

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

User-added image

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.

User-added image

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.

User-added image

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
----------------------
User-added image
 

Issue/Introduction

How to create a Workload Management rule to limit the number of rows returned by a query run on a published TDV (TIBCO Data Virtualization) table