简体   繁体   English

PostgreSQL 和 Oracle 数据库之间的远程链接

[英]Remote Link between PostgreSQL and Oracle database

how to create a synonym for a table of a schema in postgresql database on a server into a schema of oracle database on another server?如何将服务器上的 postgresql 数据库中的模式表的同义词创建到另一台服务器上的 oracle 数据库的模式中?

I have a schema on oracle database on a server and want to create a synonym a table present in a schema of postgresql database on another server.我在服务器上的 oracle 数据库上有一个模式,并希望在另一台服务器上的 postgresql 数据库的模式中创建一个表的同义词。

To create the synonym, we need to have database remote link between these two databases present on two different servers.要创建同义词,我们需要在两个不同服务器上的这两个数据库之间建立数据库远程链接。

How can we do this?我们应该怎么做? Please provide me one solution.请给我一个解决方案。

Just to clarify, I believe the question is trying to figure out how to get PostgreSQL data to appear as a table inside of Oracle.澄清一下,我相信问题是试图弄清楚如何让 PostgreSQL 数据显示为 Oracle 内部的一个表。 (The existing comments seem to be reading it the other way around, in which case, yes, an FDW would be the solution, but in this case that will not work). (现有的评论似乎是相反的,在这种情况下,是的,FDW 将是解决方案,但在这种情况下,这将不起作用)。

In the past (on older versions of Oracle) when we needed this we were forced to build custom replication scripts to transfer data from Postgres into Oracle systems.过去(在旧版本的 Oracle 上)当我们需要这个时,我们被迫构建自定义复制脚本来将数据从 Postgres 传输到 Oracle 系统。 For a single table, it is pretty straightforward to do with something like Perl & DBI... feel free to substitute that with your favorite scripting language.对于单个表,使用 Perl 和 DBI 之类的东西非常简单……随意用您最喜欢的脚本语言替换它。

On newer Oracle systems, I believe you can use Oracle Database Gateway to accomplish this.在较新的 Oracle 系统上,我相信您可以使用 Oracle Database Gateway 来完成此任务。 I am not sure if they support Postgres directly, but they do support ODBC (and I think JDBC) which should work.我不确定他们是否直接支持 Postgres,但他们确实支持应该可以工作的 ODBC(我认为是 JDBC)。 Here is an example blog post setting this up with MSSQL ( http://oracle-help.com/oracle-database/installation-oracle-database-gateway/ ), the process should be similar for Postgres.这是使用 MSSQL ( http://oracle-help.com/oracle-database/installation-oracle-database-gateway/ ) 设置的示例博客文章,Postgres 的过程应该类似。

Hope this helps!希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM