Automate Policy Execution

  • Hello , I am trying to Schedule Recovery Model Policy in SQL Server 2014 instance , Current Automated Job was able to identify the Databases which are not in Simple Recovery mode. But the job was not executing the policy as instructed. i think i am missing something here not sure how to evaluate policy through automation.
    Can some one shed some light please.

    @JayMunnangi

  • JakDBA - Thursday, October 12, 2017 1:05 PM

    Hello , I am trying to Schedule Recovery Model Policy in SQL Server 2014 instance , Current Automated Job was able to identify the Databases which are not in Simple Recovery mode. But the job was not executing the policy as instructed. i think i am missing something here not sure how to evaluate policy through automation.
    Can some one shed some light please.

    Did the job not execute or was something else wrong?
    If nothing ran, Is the policy scheduled and enabled when you view the properties of the policy?
    Is Agent enabled and is the job enabled? The policy jobs are prefixed with "syspolicy_check_schedule"
    If something else was wrong, what didn't execute as expected and how is it defined?

    Sue

  • Hey Sue, i have automated the job but its just not applying the change... but simply evaluating and giving message in error log as below
    Executed as user: NT Service\SQLSERVERAGENT. ID Policy Name       Result Start Date   End Date    Messages       -- -----------       ------ ----------   --------    --------       1 CheckRecoveryModel     False 10/12/2017 2:54 PM 10/12/2017 2:54 PM. Process Exit Code 0. The step succeeded.

    @JayMunnangi

  • JakDBA - Thursday, October 12, 2017 1:50 PM

    Hey Sue, i have automated the job but its just not applying the change... but simply evaluating and giving message in error log as below
    Executed as user: NT Service\SQLSERVERAGENT. ID Policy Name       Result Start Date   End Date    Messages       -- -----------       ------ ----------   --------    --------       1 CheckRecoveryModel     False 10/12/2017 2:54 PM 10/12/2017 2:54 PM. Process Exit Code 0. The step succeeded.

    That would be correct. Policies have evaluation modes - that's the on demand, on schedule, on change prevent and on change log only. Most of those, including on schedule, are policy checks so that it goes out and checks the policy for you.
    The one that forces compliance with a policy is on change prevent - it rolls back a change if it violates the policy. And that mode isn't available for all policies.
    This article is old but explains it well and has a query you can use to find out which facets support which evaluation modes.
    Policy Evaluation Modes

    Sue

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply