Solved

how to keep 2 vary large tables in sync

Posted on 2010-08-17
6
774 Views
Last Modified: 2012-06-22
I am running SQL 2008 standard edition on Windows Server 2008 standard edition. I have a very large table that I need to keep in sync across data centers(ID and AZ). The table is using a column data type [TEXT] to store CLOB\BLOB data. In the past I have tried to use SQL server replication, but replication chokes on the [TEXT] column. I have been using the primary key value to insert into the stand by data center tables (ID). Basically taking the max value in the stand by server(ID) and then inserting everything greater than that value from AZ to ID. However now the customer is failing the application back and forth between data centers AZ and ID, and then reseeding the identity columns, so even though the data in the Idaho DC is newer than Arizona the PK value in Idaho is less than the last PK value written to Arizona. So the insert into where PK value > max(PKID) does not work. I tried using the date column, but then when they fail back, records end up missing data from the fail over. So in this case I will do a left join, to find the PKIDs missing, but I need to find a way to automate this……Any ideas experts?
0
Comment
Question by:sqlagent007
  • 3
  • 2
6 Comments
 
LVL 3

Expert Comment

by:mamalik00
ID: 33461784
Database mirroring is what you are looking for. Please have a look at the following URL and google SQL mirroring for more details.

http://technet.microsoft.com/en-us/library/ms189852.as

it will sync all the tables in a mirrored database.

Hope it helps.
0
 
LVL 3

Accepted Solution

by:
mamalik00 earned 500 total points
ID: 33461802
0
 
LVL 3

Expert Comment

by:mnachu
ID: 33465368
Is the data updated on both servers? If then I guess mirroring may not work.

If u want 2 SQL server to send data back and forth with high reliability and transactional then u could use Service Broker search for it in google.

Regards,
Nachi
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 1

Author Comment

by:sqlagent007
ID: 33465397
There is only 1 primary at a time. If Arizona is the primary today, then Idaho will be the slave, however the customer will fail over to using Idaho as the primary without warning. Once this happens all the writes are done to the ID server and none to the AZ server. Mirroring may work, but I am looking for a way to keep a read only copy available at the standby site. I will look for service broker as well.
0
 
LVL 1

Author Comment

by:sqlagent007
ID: 33465546
Since the DB mirroring option relies on the transaction log, how hard is it to keep the logs to a reasonable size? Will I be able to truncate the log on the "mirrored" database?

We have tried log shipping in the past, but the issue was the the TLOG on the "stand by" copy would grow and grow and we had no way to shrink it. The other issue is that in order to update the DDL on the "stand by" database, we had to recovery the DB and then start the process all over again.
0
 
LVL 1

Author Closing Comment

by:sqlagent007
ID: 33872179
Thanks!
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question