Database Mirroring and Maintenance Jobs

  • Hi,

    We have a situation where in the DB needs to be 24 * 7 through out the entire week, there by eliminating the window for any maintenance tasks. The Web Application has been configured in such a way that if the response doesnt come back from the DB server in 60 sec(s), the application will time out.

    I was planning to set up

    1) DB Mirroring between the Primary and the Mirror

    2) Swap the roles between the Mirror and the Primary using the SET PARTNER FAILOVER command

    3) Can i schedule my Maintenance jobs on the original Primary DB (which at this moment will be the secondary) and once the Manitenance jobs is completed swap it back to the original state.

    Is this a feasible solution or is there any other better way to do this. Currently the system is not 24 * 7 and I have scheduled the Maintenance Jobs to run during the offpeak hours. The entire Maintenance jobs currently takes close to 40 mins.

    Please share your thoughts

    Thanks in advance

    Wisenut

  • You cannot do what you are suggesting. With database mirroring, only one database can accessed at a time. When you failover, the database that was the primary will not be accessible - so your maintenance job would fail. Remember - mirroring is apply the changes made to your primary database to the secondary/mirror database. If you are updating (by doing database maintenance), you would be attempting to make changes to both databases.

    If your maintenance is things like defragmenting indexes (such as you would do with a SQL Server database maintenance plan), I suggest that you have a search for scripts that target indexes that are fragmented. You should be able to find some in the "Scripts" section of this web site.

Viewing 2 posts - 1 through 1 (of 1 total)

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