Sybase sql 在任何地方同步数据库视图(从统一拉到远程)?

发布于 2024-08-11 07:24:06 字数 202 浏览 6 评论 0原文

我正在尝试设置一个同步模型,以将我的统一 Oracle 数据库与远程 SQL Anywhere 数据库同步。我有几个关于统一 Oracle 数据库的视图,我想将它们作为表拉入 Sql Anywhere 数据库。我想把它们拉过来,因为它们涉及 4-5 个表(必须喜欢良好的标准化),并且只有 7-8 列我需要读取访问权限(即我永远不会尝试更新它们。我只需要从合并的到远程数据库)。我该怎么做?

I am trying to set up a synchronization model to sync my consolidated Oracle database with a remote SQL Anywhere database. I have a couple Views on the consolidated Oracle database that I want to pull into the Sql Anywhere database as tables. I want to pull them over as they touch 4-5 tables (gotta love good normalization) and only have 7-8 columns that I need read access to (i.e. I will never try to update them. I just need to pull from the consolidated to the remote db). How do I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心凉怎暖 2024-08-18 07:24:06

MobiLink 当然可以支持与视图同步,但这在同步模型中不受支持,因为视图没有主键(同步模型需要主键,如向导第一页所述),并且上载到视图需要可更新视图或“代替”触发器。

解决方法是临时定义一个与视图具有相同架构的表,并加上适当的主键定义。最简单的方法是对表使用相同的名称,但为此您需要使用不同的数据库。加载统一模式时选择该数据库/表,并将该表映射定义为仅下载。

然后您应该能够使用视图将该模型部署到 Oracle 数据库。如果必须对表使用与视图不同的名称,则应部署到文件并在生成的 SQL 文件中将表名称全局替换为视图名称。

MobiLink can certainly support synchronizing with views, but that isn't supported in synchronization models because views don't have primary keys (which sync models need, as outlined on the first page of the wizard), and uploading to views requires an updatable view or "instead of" triggers.

A workaround is to temporarily define a table with the same schema as the view, plus appropriate primary key definitions. It would be simplest to use the same name for the table, but for that you'd need to use a different database. Pick that database/table when loading the consolidated schema, and define that table mapping to be download only.

Then you should be able to deploy that model to the Oracle database with the view. If you had to use a different name for the table than for the view, you should deploy to file and globally replace the table name with the view name in the generated SQL file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文