Free SQL Server Learning - Making the most out of SQL Server Agent
solving sql server problems for millions of dbas and developers since 2006


SQL Server DBA Tips SQL Server Developer Tips SQL Server Business Intelligence Tips SQL Server Career Tips SQL Server Tip Categories SQL Server Tutorials SQL Server Webcasts SQL Server Whitepapers SQL Server Tools SQL Server Questions and Answers MSSQLTips Authors About MSSQLTips SQL Server User Groups SQL Server Events I am MSSQLTips MSSQLTips Advertising Options

MSSQLTips Facebook Page MSSQLTips LinkedIn Page MSSQLTips RSS Feed MSSQLTips Pinterest Page MSSQLTips Twitter Page MSSQLTips Google+ Page






















SQL Product Highlight

Idera - SQL diagnostic manager

Identify and resolve SQL Server problems before they happen

  • Monitor and manage SQL Servers enterprise-wide
  • Find and fix performance bottlenecks
  • Analyze performance over time

Learn more!

























Identify SQL Server Databases Not in Full Recovery Model

By:   |   Read Comments   |   Related Tips: More > Policy Based Management

Problem

You need to periodically ascertain if there are any databases in your production environment which are not using the Full Recovery Model. In this tip we cover the step by step process for setting up a policy to identify databases that are not using the full recovery model.

Solution

Database Administrator can use the Policy Based Management (PBM) to identify databases which are not in Full Recovery Model. You can follow the below mentioned steps to create and evaluate the policy which can be used to identify the list of all the production databases which are not using full recovery model.

If you are not familiar with Policy Based Management (PBM) then you can start with the following tip: Using Policy-Based Management in SQL Server 2008.


1. Connect to a SQL Server 2008 Instance using SQL Server 2008 Management Studio and expand Management -> Policy Management and then right click Policies and select New Policy... as shown in the snippet below.

 the step by step process for setting up a policy to identify databases that are not using the full recovery model

2. In Create New Policy window provide the name of the policy as "Identify Databases Not in Full Recovery Model". In Check condition you need to click the New condition.... option to open up the Create New Condition window.

Connect to a SQL Server 2008 Instance using SQL Server 2008 Management Studio and expand Management

3. In Create New Condition window you need to provide the name of the condition as "Databases Not in Full Recovery Model" and then select the Facet "Database Maintenance". Under Expression select Field value as @RecoveryModel and choose operator value as ' = ' and then value as Full as shown in the below snippet. Click OK to save the condition and to return to the parent Create New Policy window.

provide the name of the condition as "Databases Not in Full Recovery Model"

4. In Create New Policy, by default "Every Database" option under “Against targets” will be checked as shown in the below snippet. Click OK to create the policy.

by default "Every Database" option under “Against targets” will be checked

5. Once your policy is created, the next step will be to evaluate the policy. Right click the policy and select the Evaluate option from the drop down list as shown in the below snippet.

select the Evaluate option

6. The below snippet shows the result set returned by the policy. We can see that most of the databases failed the policy.

see that most of the databases failed the policy

7. When you click a "View…" link under details, you will be able to see a detailed result for a particular database. For this database the expected value was Full, however the current recovery model used by the database is Simple.

you will be able to see a detailed result for a particular database

8. If you want to change the recovery model for databases that are not set to Full, check the target databases and click the Apply button. This action will pop up a Policy Evaluation Warning as shown in the below snippet. Click Yes to change the recovery model of all the databases to Full that were selected.

This action will pop up a Policy Evaluation Warning

9. Once the policy suggestion is applied you will be able to see the below screen that shows all are in compliance now. Click Close to exit.

Once the policy suggestion is applied you will be able to see the below screen that shows all are in compliance now

Next Steps

  • Review a href="http://www.mssqltips.com/sqlservertip/1492/using-policy-based-management-in-sql-server-2008/"> Using Policy-Based Management in SQL Server 2008
  • Read more tips on Policy Based Management
  • Read all my previous tips


Last Update: 7/12/2010

About the author

Ashish has been contributing to the MSSQLTips.com community since 2009 with over 60 tips.

View all my tips


Print  
Become a paid author


Comments and Feedback:


Post a Comment or Question

Keep it clean and stay on the subject or we may delete your comment.
Your email address is not published. Required fields are marked with an asterisk (*)

*Name   *Email Notify for updates

Signup for our newsletter


Comments
*Enter Code refresh code


 
Sponsor Information
"Amazing, Amazing, Amazing! SQL doctor is truly one of the most powerful tools I have seen."

Get your SQL Server database under version control now! Find out why...

Need SQL Server help and not sure where to turn? Reach out to expert consultants in the USA for a Health Check.

The COMPLETE Performance Solution for SQL Server - SQL Sentry

SQL Server Data Tools - Got questions? Get the answers here!


Copyright (c) 2006-2013 Edgewood Solutions, LLC All rights reserved
privacy | disclaimer | copyright | advertise | about
authors | contribute | feedback | giveaways | user groups
Some names and products listed are the registered trademarks of their respective owners.


Edgewood Solutions LLC | MSSharePointTips.com | MSSQLTips.com