Solved

how to keep 2 vary large tables in sync

Posted on 2010-08-17
6
770 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
Comment Utility
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
Comment Utility
0
 
LVL 3

Expert Comment

by:mnachu
Comment Utility
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 1

Author Comment

by:sqlagent007
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

I have written a PowerShell script to "walk" the security structure of each SQL instance to find:         Each Login (Windows or SQL)             * Its Server Roles             * Every database to which the login is mapped             * The associated "Database User" for this …
After restoring a Microsoft SQL Server database (.bak) from backup or attaching .mdf file, you may run into "Error '15023' User or role already exists in the current database" when you use the "User Mapping" SQL Management Studio functionality to al…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now