Code Monkey home page Code Monkey logo

mssql-jobs-hadr's Introduction

SQL Server Jobs & HA/DR

This repository contains solutions to properly control and maintain scheduled jobs on SQL Servers with either Availability Groups or Database Mirroring.

Cover Image

Using this solution, you can automatically control which SQL Agent jobs would be executed on which replica, based on several possible criteria (PRIMARY / SECONDARY database role, job name, job category, etc.).

After implementing this solution:

  • No longer will you be needing to manually implement an HA/DR role check in each new job or job step that you create.
  • Jobs would no longer be executing without actually doing anything because a database's role wasn't the right one.
  • No more jobs would fail because they were executed on a secondary/read-only/unreadable database.
  • MSDB job history tables would not be needlessly bloated.

This solution is an improved version of the scripts provided at the blog post Automatically Enable or Disable Jobs Based on HADR Role.

Availability Groups

This solution is available for AlwaysOn Availability Groups for SQL Server 2012 and later. Click here for more details, or download below:

Database Mirroring

This solution is available for Database Mirroring for SQL Server 2008 and later. Click here for more details, or download below:

Classic Version

This repository also contains the "classic" versions of the scripts. Click here for more details, or download below:

License

This solution is released under the MIT License, and is provided "as-is", as a free contribution to the professional SQL Server community.

Contribution

This is an open-source solution. Please feel free to [create issues]({{ site.github.repository_url }}/issues) if you want to submit bug reports or feature requests.

You may also fork the solution to your account and submit pull requests if you want to contribute!

See Also

Tell your friends! Share this link: bit.ly/HADRMyJobs

mssql-jobs-hadr's People

Contributors

eitanblumin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.