Is it possible to replicate 2 SQL Servers on table level? (I want to replicate only few tables, not all DB). Both SQL Servers work on different physical servers and should synchronize a few tables.
If it is possible, how to avoid conflicts?
Thanks!
Yes you can use MERGE Replication provided both source and destination table names should be same.I guess transactional replication might support if table names are different.
Related
I have two databases, one is on SQL Server and the other is on PostgreSQL. Is there a way to join tables from these two database, or, if not possible, is there a way to pull from both databases and put the result in a temp table?
Thanks!
Foreign Data Wrapper
PostgreSQL supports Foreign Data Wrappers, per the SQL standard. See the wiki.
The easy way, use FDW for SQL Server and see remote SQL Server table like a local table.
You could create link server, see below link for more details:
https://learn.microsoft.com/en-us/sql/relational-databases/linked-servers/create-linked-servers-sql-server-database-engine?view=sql-server-ver15
I'm looking for the best (best practice) option for one way replication between two databases. I would like to keep this purely SQL but, can write something in C# or use an ETL tool if there are no other good options.
Current setup:
DB1 - There are three instances of this database. It is a large relational database, the schema is the same for each but, they are separate data pots (no replication). Two databases on a 2012 server and one on a 2014 server
DB2 - There are two instances of this database on seperate servers (Europe, Americas) and the data is merge replicated between the two. The publisher is the 2014 server.
The Goal:
DB2 is tied to some reports. It has one table and a small application attached to that table. Users from many different countries enter data via a small application into DB2 and generate reports out of the application.
DB1 is a relational database that has a very large application on top of it but with fewer users. If users are using the application for DB1 then they should not need to duplicate their records into DB2.
There should be one-way replication from the multiple seperate DB1s into DB2. How quickly this happens is not too important.
The important things are:
No backwards replication occurs from DB2s > DB1s (Data only flows from DB1s into one of the DB2s)
Create, Update, and Delete actions should occur in DB2 based on the results
of a comparisson with DB1 (the one way replication)
Current Approach:
I currently have a flat sql view on each DB1 database that has the same schema as the table in the DB2 db's that the data needs to go into.
The servers are also joined as linked servers.
My though was to do a sort of manually written replication script on one of the DB2 databases that calls the views from the DB1s and does the CUD actions on a timed basis.
It seems to me that there should be an easier way though!?
Any thoughts on how to do this would be very much appreciated.
Keep in mind that since several of the DB1s exist on a SQL 2012 server that there may be some issues as 2012 might not be allowed to be a publisher for replication to a 2014 server.
I need to migrate about 700 Oracle partitioned tables (RANGE and LIST partitioning) to SQL Server.
Turns out the SSMA (SQL Server Migration Assistant) does not handle Oracle partitioned tables (this is the official answer I got from Microsoft).
Any tool / script / other suggestion to automate this process?
Thanks!
They are correct:
Tried to do this for a project last year for work and found out the same thing:
Tried doing a little research on google to see if things have changed but found out the following:
Migration of Oracle Partitioned Tables is not supported by SSMA. Partitioned tables are migrated as a Non-partitioned simple tables.
Partitioning of the these Tables in SQL server is required to be done manually as per the physical database architecture planning and logical drives of the server system.
Any partition maintenance (adding or dropping or truncating the partitions) related code need to be re-rewritten in SQL Server."
I have a big database about 4.5Tb. Is it possible to partition it and move the half of it to another raid?
Thanks Arman.
PS.
I use Windows Server 2008 Standard with Microsoft SQL Server 2008.
You can set up multiple secondary files with in enterprise manager, if you machine can see multiple logical disks you can provide storage space on a number of disks
See
Understanding Files and Filegroups MS-SQL
Using Files and Filegroups MS-SQL
Once you have created filegroups you can assign tables to specific filegroups. File groups can be made up of files from different disks(or different RAID clusters). So you can spread your database and individual tables over multiple logical disk.
As this question is tagged with Sql-server I am assuming we are talking about Microsoft SQL Server.
Some more reading
Resources for Database Sharding and Partitioning
Sharding
Partitioning
Data Dependent Routing
I'm looking at SQLServer replication. When I replicate, obviously the entire database can be replicated. However, is it possible to limit the replication to a specific set of tables or schemas?
Thanks!
Yes--this is pretty straight-forward. Just go into the publish properties of your replication definition and unselect the tables you do not want replicated.