replication between SQL Server and MySQL server - replication

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.

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

Running SQL Server queries against sqlite or plain files?

I have a website developed using a SQL Server database. But I need to port it to a new web server that doesn't have access to a database.
I therefore need an alternative solution, preferably without rewriting all the database queries. I would prefer being able to run the same queries against a sqlite file or just a plain textfile.
As far as storage goes it won't be storing large amounts of data, so performance won't be an issue.
Thanks for your time!,
Kind regards
Solved it by using Sql Server Compact Edition (see comments in OP).

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

How to Convert SQL server to Oracle?

I have a SQL server database (Tables, Views, SP...). I need to convert this database to Oracle 10g. How can I do it?
Transferring the data will be easy; SQL Server integration services can do that, or Oracle's SQL Developer.
However, views and stored procedures are different between Oracle and SQL Server. SQL Server uses T-SQL, Oracle uses PL/SQL. These are not very compatible and I don't know a tool can automatically convert between the two. If your database relies on specific T-SQL features, you will need a developer to do the conversion.
Get the jTDS jdbc driver from sourceforge.
Add it to Oracle SQL Developer.
Tools > Migration > Migrate
Create a migration repository in your new Oracle database.
Create a new migration project.
Point it to your SQL Server database.
Convert it - mind the data types.
Migrate the data:
online row-by-row inserts over JDBC. Fine for SMALL/test boxes.
offline - use micrsosoft's unload utility to pull the sql server down to flat files. SQL Developer will create SQL*Loader scripts to put them over into Oracle.
If you have GoldenGate licensed, use that to move the data over and to synch changes from one system to the other in case you need to keep both up and going.
Start looking at the migrated T-SQL procs and functions. SQL Developer will leave comments for code blocks it wasn't able to translate...but you will need to TEST and VERIFY every single translation. Customers can see upwards to 80-90% translation rates for their T-SQL, but it could be as low as 50%...it just depends on the nature of your code.
The entire process is described here.
I wrote a white paper, with Sybase ASE as the example source platform, here. The process is identical for SQL Server. It has step-by-step guidance with screenshots.
If you have an Oracle account manager, reach out for help. We have specialists that deal exclusively with migrations such as yours. They have lots of practical advice and can recommend 3rd party partners if you lack the expertise.
sql developer can help. You can download it here , it is free. http://www.oracle.com/technology/software/products/sql/index.html
There is step by step documentation including videos on how to migrate SQL Server to Oracle DB. You find it here:
Migrating from Microsoft SQL Server to Oracle
Or you can use a tool to do the job for you like Ispirer - Migrate Microsoft SQL Server to Oracle
You basicaly setup an Oracle Server, once its ready you migrate your tables using a software made for that. I guess this script can do the job:
m2o

Any good SQL Anywhere database schema comparison tools?

Are there any good database schema comparison tools out there that support Sybase SQL Anywhere version 10? I've seen a litany of them for SQL Server, a few for MySQL and Oracle, but nothing that supports SQL Anywhere correctly.
I tried using DB Solo, but it turned all my non-unique indexes into unique ones, and I didn't see any options to change that.
If you are willing to download SQL Anywhere Version 11, and Compare It!, check out the comparison technique shown here:
http://sqlanywhere.blogspot.com/2008/08/comparing-database-schemas.html
You don't have to upgrade your SQL Anywhere Version 10 database.
The new kid on the block is Qwerybuilder. It supports SQL Server, Sybase ASE, Sybase SQL Anywhere and Oracle. I've used it successfully with SQL Anywhere to track schema changes.
Two I've come across that support SQL Anywhere:
Upscene Database Workbench - http://www.upscene.com/products.dbw.sqlanywhere.php
Aquafold - http://www.aquafold.com/index-sybaseany.html
Each one appears has a schema comparison tool, however I have not used either to compare schemas.
SQLDelta is awesome. It is for SQL Server. I've used it with SQL 2000 and 2005. It will compare stored procedures, tables, views, permissions, indexes, etc. It can also compare data between tables I believe. You can sync the changes or generate SQL Scripts for later use. I use it often to script out db changes in development to production.
Ah...missed the Sybase remark. Not sure if SQLDelta can talk to it..but I'd probably give it a shot since Sybase is similar.
Try erwin (CA AllFusion ERwin Data Modeler). It supports quite a lot of different DBs, including SQL Anywhere, and is quite good in reverse/forward engineering and schema comparison. However, you may find it a bit too complex to use for the comparison...
I use SQL Data Compare from Red Gate along with SQL Compare the data compare allows you to Compare the contents of two databases and Automatically synchronize your data.
SQL compare allows you to do the same but with the database tables. Nice GUI on each and very easy setup. they also work on a remote database.
There not cheap but each has a 30 trail so you can get a feel if you like it or not.
Sybase PowerDesigner can also Compare or Merge your Database Schema.
It can also Load the Schema from various Databases by ODBC if you have Schema generation Scripts you can also load them into a Model.
Its an expensive tool but great to document and develop you schema changes IMHO.
Breck Carter's idea is a good one. For quick scans, I have an old product that is called DBDelta. I have it installed on an old Windows 2000 machine because the install I have will not work on an XP machine. It's a very small app that compares two SQL Anywhere databases across an ODBC connection.
I've done some searches to try and find a later copy, but have not been able to. The developer was Charles Butcher. I think he supported it for a while and then stopped back in 2002 or so.
I'll continue to look for a link. If I find something I will post it here.
QweryBuilder 5.5.0 will allow you to compare all procedures, functions, views, tables and triggers in one shot. This release is scheduled for mid May, 2010.
It hasn't been finalized yet but we are also looking at adding an option to turn the diff results into a script that can be executed on a target database.