Quantcast
Channel: SQL Server Replication forum
Viewing all articles
Browse latest Browse all 4054

Minimizing Downtime in SQLServer 2012 Standard Edition

$
0
0
Hello,

I am using SQLServer 2012 Standard Edition SP3. I am trying to avoid the downtime which is almost 5 hours per day from 12 to 5 AM. During this down time I am archiving data older than x days to an OLAP database and then deleting it from the OLTP database and then rebuilding the indexes in OLTP. Since this is standard edition I cannot rebuild indexes online. Besides while I am doing deletes there are table locks as well.

So I wanted to test if this downtime can be avoided by switching the applications every night from one server to another server. My approach  is to set up bidirectional transaction replication between Server 1 and Server 2 and have apps point to one server and one database at any given point of time. 

By bidirectional replication I don't mean the exact architecture but a little customized one. I am setting up transaction replication between server 1 and server 2 and also between server 2 and server 1 on the same database but at any given point of time only one set of replication jobs are up an running and the other server's replication jobs will be stopped and disabled. Also when I am configuring transaction replication from server 2 to server 1, I am not using snapshot because it will throw errors as the database is participating in replication. Also the distribution databases are sitting on their own servers.

1. On Day 1 at 12:00 AM Server 1 Database 1 is in Sync with Server 2 Database 2. (data matches).
2. On Server 2 replication jobs are stopped and disabled. Apps point to Server 1 and maintenance jobs run in server 2 and not on server 1
3. On Day 2 at 12:00 AM I will make sure data is all synced up between server 1 and server 2 and at 12:00 AM I am going to stop the replication jobs  from Server 1 to Server 2 and then disable them 
4. I will then enable the replication jobs from Server 2 to Server 1 and make sure I will seed the identity columns in all tables to match the max value 
5. on this day The maintenance jobs will run in Server 1 and replication is from Server 2 to Server 1
6. I will make sure data is synced up between two servers by 12:00 AM and repeat the same process the next day.

This reduces my downtime from 5 hours to probably less than 5 mins a day. So far I havent seen any issue other than seeding the identity column values which can be fixed through an agent job or a script.

Experts I need your valuable inputs on this. I have only tested it out on a dummy database with 5 tables. Do you see any issues with this kind of set up?

Thanks a ton.

Viewing all articles
Browse latest Browse all 4054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>