How can we do Data Replication on SQL Server 2012 . For detail please read below - replication

I have a database Now what I want If in any case my database server
has failed then it automatically gets data from another server. I want
to know how can we do Data Replication/Mirroring.
Can anybody share an idea how we can do this?
I have searched a lot in the Google but doesn't get exact link for the
Data Replication on SQL Server 2012. I really appreciate your
suggestions.

For failover type scenarios, you want to use either Mirroring or Always on, not replication.
Details on Mirroring are available here:
Database Mirroring
Details on Always On are available here:
SQL 2012 Always On
Both of these solutions are able to provide automatic failover for applications to a separate copy of the database if the primary server fails, AlwaysOn is the better solution (and mirroring is now apparently deprecated as of SQL 2012) but has some more complex requirements such as a dependency on windows clustering.

Documentation for SQL Server Replication can be found in Books Online for SQL Server 2012 - SQL Server Replication.

Related

How to transfer local database table's data to remote database tables using vb.net with SQL Server

I have a local SQL Server database with many tables. I need to transfer data to a remote SQL Server database using vb.net, and task should be run every 2 hr from application. How is it possible to do this? Please suggest the best way for this.
I think the better way is replication. i don't know the possibilities in SQL Server but it works great in mysql. if you enables the replication in two database(Master- Slave) what ever be the changes you have made in the master will simultaneously in the slave. there is possibilities for Bi-Directional Replication in MySQL.
SQL Server provides various types of replication to extend the possibilities. this article helps you to establish replication in Sql Server

SQL Server 2008 R2 Developer and SQL Server 2008 Express Edition, Replication

I was looking for some advise on a current task and sifting though on the net I am not finding anything direct. I have full SQL Server 2008 in my central location and then 5 remote sites that use SQL Server 2008 Express for the database services. I am looking for a way to synch or replicate the databases in the 2008 Express instances back to my central 2008 developer edition instance.
What is blocking me is the editions and what is possible, I have been told log shipping and mirroring will not work with Express editions of SQL Server.
One thought was SSIS maybe from the central location pulling from the express instance, but again I don't know if this is possible.
Any ideas however big or small would be really appreciated!
Thanks!
Neither log shipping nor mirroring are replication solutions. They are high availability/disaster recovery solutions which allow you to have the same database in two (or more with log-sipping) locations. Only the source location can update the database.
What you want is replication, see Replicating Data to SQL Server Express. Merge Replication will allow you to update data at the periphery (on the SQL Express instances).
Note that all scenarios require static and available SQL Express instances. Replication will not work with if the SQL express instances are mobile (show up on the network with different names/IPs, think a laptop being moved around) or occasionally available (again, think a laptop that appears on and off the network as the user opens it in the corp WiFi or at home). For mobile/occasionally connected scenarios the right approach is Sync Framework.
One thought was SSIS maybe from the central location pulling from the express instance, but again I don't know if this is possible.
No, is not possible in practice, because of the impossibility of detecting changes ('what records need to be pulled?') and the lack of support for update conflict resolution.
Another approach, which I did see it deployed with success, is to use Service Broker since is freely available in Express. But it only solves the problem of transport (delivery the changes), and does not address detecting changes (usually solved via either app specific logic or via triggers) and applying the changes (this is not hard to solve though). Update conflicts are hard to handle.

Sharding mechanism (like SQL Azure Federations) in SQL Server 2012

I'd like to ask if there exist any sharding mechanism (like SQL Azure Federations in Cloud) but in SQL Server 2012 .
I've searched a lot but I couldn't find any appropriate solution that resembles Federations. There is AlwaysOn but it's not the same.
Thanks
No, this feature is not in the boxed product in SQL Server 2012. There are many ways to scale reads but merge replication and distributed partitioned views seem to still be the only viable out-of-the-box solutions for scaling writes. Note that the latter doesn't seem to be officially documented separately in SQL Server 2012 - it has all been condensed into the CREATE VIEW topic.

replication between SQL Server and MySQL server

I want to setup replication between SQL Server and MySQL, in which SQL Server is the primary database server and MySQL is the slave server (on linux).
Is there a way to setup such scenario? Help me .
My answer might be coming too late, but still for future reference ...
You can use one of the heterogeneous replication solutions like SymmetricDS: http://www.symmetricds.org/. It can replicate data between any SQL database to any SQL database, altough the overhead is higher than using a native replication solution.
of course you can replicate MSSQL database to MYSQL
By using Linked Server in MSSQL.
for that you need to download ODBC drivers. and you can further search regarding how to create Linked server on SQL SERVER.
This option is very easy and Totally free. You can use OPEN QUERY FOR THIS.
By using SSIS Packages.
for that you need the Business Intelligence service of SQL SERVER. you can create SSIS Packages on Visual Studio and run them for replication.
No. At least not without doing a lot of dirty, bad things. MSSQL and MySQL speak different replication protocols, so you won't be able to set it up natively (which is the way you'd want to handle it). At best, you could hack together some sort of proxy that forwards insert/update/delete/create/alter, etc. queries from one to the other. This is a terrible idea as they don't speak the same SQL except in the most common case. Even database dumps which wouldn't really be replication are generally incompatible between vendors.
Don't do it. If you must use different OSes on your servers, standardize the database to something that runs on both.
These two databases are from two different vendors. While I cannot say for sure, it is unlikely Microsoft has any interest in allowing replication to a different vendor's database server.
I work with Informix and MySQL. Both those databases have commands that dump the entire database to an ascii file format. You would need to see how that is done on MS SQL Server; ftp the dump to the server hosting the MySQL server; and then convert the dump into something MySQL can import.

Sync two SQL Server databases

I have two databases: the source is a database from SQL Server Express by client and the target is a database from SQL Server 2005 database as backup initially. What I need is to sync the source to the target db if there is any difference between them and the sync is one-way from source to target.
I am not sure what tools are available. I tried to google this issue and found MS VS Team Edition (2005) has a tool to sync database, which can generate T-SQL scripts as well. Not sure if this one is good or not. Can I use the script as a scheduled job on SQL Server (target server)? By the way, I don't have Team Edition right now but I do have VS 2005 Prof. Any suggestions?
IMHO by far the easiest and fastest way to sync the two databases one-way (A to B) is to backup database on A and restore it on B. This could be done via T-SQL, let me know if you would like me to post SQL statements
Ideally you would set up Transactional Replication from your source to your target(s). However, since your source is Express edition and Replication does not work with Express as a publisher (source) but only as a subscriber (target), you cannot use it.
The best solution would be to upgrade your Express edition to SKU that supports Replication publishing (ie. Standard Edition).
Log shipping, or manual backup/restore, will not work because it will create an absolutely identical copy of the source db at the target, overwritting any changes made by the target (you mention 'some differences' may exist). Same goes for File/Copy.
SQL Compare tools are OK for a one time manual operation, but they fail at automated operations because they always compare the two databases from scratch, ei. are not capable of synching just what changed. As soon as data grows to a sufficient size, the comparison approach is doomed as it has to ship over the entire database for purpose of comparison alone.
Other solutions are to set up pro-active real-time ETL, but the time/cost investment into this is prohibitive compared with the cost of a SE license and deploying Replication.
Pay to play:
http://www.red-gate.com/products/SQL_Compare/index.htm
Free, open source:
http://www.codeplex.com/OpenDBiff
You should into the SQL Server tools produced by Red-Gate. I've found them to be the best around.
If you have SQL Server 05, you can use replication services(this comes with SQL Server). If you open up your management studio, under your server folders you should see one titled "Replication". From here you can setup subscriptions or publications with push or pull syncs.
Here's MSDN's take: http://msdn.microsoft.com/en-us/library/ms151198.aspx
If this is a one time / once-in-a-while thing, you can use SnapShot Replication.
If you need the databases to be in sync all the time, you can use Transactional Replication.
http://msdn.microsoft.com/en-us/library/ms151847.aspx
In addition to Red Gate tools you can try DB Ghost as well http://www.innovartis.co.uk/. It's most useful as a automated build tool, but does also have an user interface to diff and sync databases. It costs ~$350.00
USing microsoft sync framerok
http://msdn.microsoft.com/en-us/library/ee819079.aspx
http://msdn.microsoft.com/en-us/library/ff928525.aspx