You can translate the question and the replies:

Inactivate data source connection during a specific time daily

Is there any possibility to inactivate a data source connection automatically during certain times daily?
user
17-07-2023 20:51:49 -0400
code

1 Answer

Hi, I see different solutions: 1. You can use [Resource Manager](https://community.denodo.com/docs/html/browse/8.0/en/vdp/administration/resource_manager/resource_manager) to set a Restriction Plan. The Plan will stop queries in specific time intervals. For example, with a *Stop query always* plan you can use this rule `(gethour(CURRENT_TIMESTAMP) >= 10 OR gethour(CURRENT_TIMESTAMP) < 11)` to apply the restriction to the incoming requests only between 10 and 11 a.m. However the Rule does not allow to apply a plan to a specific view. If your have your view in a separate virtual database you can limit the queries directed to your database. You can find the list of available fields to Evaluate a Rule [here](https://community.denodo.com/docs/html/browse/8.0/en/vdp/administration/appendix/resource_manager_available_fields_to_evaluate_a_rule/resource_manager_available_fields_to_evaluate_a_rule#resource-manager-available-fields-to-evaluate-a-rule). A second option with Resource Manager, could be using the plan to set some environment variable and use that variable to stop the view from returing results (have a look at the bottom of [Defining a Plan](https://community.denodo.com/docs/html/browse/8.0/en/vdp/administration/resource_manager/defining_a_plan/defining_a_plan)). 2. Create a [Custom View Policies](https://community.denodo.com/docs/html/browse/8.0/en/vdp/developer/custom_policies/custom_policies), a Java class that define a behavior to be adopted before a query is being executed. It allows you tu reject or limit its results under some condition. Finally: > You can assign the same custom policy over: > * Several views for a user or a role. > * Use them in a global security policy so you can easily apply them to many/all the views, to all the users, etc. This section can be useful: [Creating a Global Security Policy](https://community.denodo.com/docs/html/browse/8.0/en/vdp/administration/global_security_policies/global_security_policies#creating-a-global-security-policy) 3. Use Denodo Scheduler to ALTER the views on you Data Source and make them return an error or no rows. You will have to create two VDP jobs: one that enable the views and one that stops them. They will be scheduled at the beginning and at the end of your timeframe. User guide page: [Creating and Scheduling Jobs](https://community.denodo.com/docs/html/browse/8.0/en/scheduler/administration/creating_and_scheduling_jobs/creating_and_scheduling_jobs). Hope this helps.
Denodo Team
19-07-2023 06:21:11 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here