如果表没有主键,则为最佳复制 [英] Best replication if the table don't have primary key

查看:97
本文介绍了如果表没有主键,则为最佳复制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi there,

Please help me.

If we don't have pk and uk in a table for the replication and we need to reduce the latency while loading a report at a particular period of time n my application. Please suggest the best way to do it? Which replication is better? or do we have any alternative other than replication?

Please help

THank you





我曾尝试过:



1.我们知道,在特定时期,我们无法查看该报告。这是主要问题。我们正在使用快照复制,因为复制所涉及的表没有主键。

2.浏览复制类型,例如

a。快照复制:

b。合并复制

c。交易复制

d。双向交易复制

e。点对点复制

3.如果我们使用这些复制中的任何一个,我们可以更改列,例如添加或删除列或多列等。

4.我们知道此复制涉及的表没有任何密钥(既不是主密钥也不是唯一密钥)。分析每种复制类型以选择最适合我们情况的复制。

5.根据分析,快照和合并复制甚至可以支持表没有主键,而对于事务,双向事务处理和对等复制表必须具有主键或唯一键才能使用它们。

6.为了克服顶部指定的问题,快照复制是不好的选择,其中数据在大多数时间是静态的。

7.由于我们的数据经常变化,我们可以进行事务复制或双向复制。问题是关联的表必须具有主键。

8.通过称为数据镜像和日志传送的旧备份技术概念,这不像复制那样直接概念。



What I have tried:

1. We know that, at a particular period of time, we cannot able to view the report. This is the major issue. We are using Snapshot replication since the tables involved for the replication which doesn’t have a primary key.
2. Went through the types of Replication such as
a. Snapshot replication:
b. Merge replication
c. Transactional replication
d. Bi directional transaction replication
e. Peer to peer replication
3. If we work with any one of these replications, we can alter a column such as adding or dropping a column or multiple columns, etc.
4. We know that the tables which are involved for this replication does not have any keys (neither primary key nor a unique key). Analysed every replication type to pick the best replication which helps in our case.
5. As per the analysis, Snapshot and Merge replication can support even the tables don’t have primary key whereas for the Transaction, Bi direction transactional and Peer to peer replications the tables must have primary key or unique key to work with them.
6. To overcome the issue specified at the top, the snapshot replication is the bad option where is the data will be static most of the time.
7. Since our data is changing very often, we can go for Transaction replication or bi directional replication. The issue is the tables which are associated must have primary key on them.
8. Gone through the old back up technique concepts called ‘Data Mirroring’ and ‘Log Shipping’ which is not straight forward concepts as replication does.

推荐答案

你可以使用Merge复制,它不需要主键,如果它不存在,它会自动创建一个rowguid列。

不幸的是,你会有性能损失如果使用合并复制。

如果您只需要使用复制进行报告,并且您不需要数据与发布者上的数据完全相同,那么您可以考虑快照复制。 />


或者请看一下这个链接:复制没有主键的表格
You could use Merge replication, that doesn't require a primary key, and it automatically creates a rowguid column if it doesn't exist.
Unfortunately, you will have a performance penalty if using merge replication.
If you need to use replication for reporting only, and you don't need the data to be exactly the same as on the publisher, then you could consider snapshot replication.

Or please take a look at this link as well: Replicate tables without primary keys


这篇关于如果表没有主键,则为最佳复制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆