简体   繁体   English

如何将postgresql转储还原到SQL Server实例?

[英]How can I restore a postgresql dump to a SQL Server instance?

I've got a production app running on Postgres, and I'm taking nightly dumps to a tar.gz file. 我有一个在Postgres上运行的生产应用程序,我正在将每晚转储到tar.gz文件。 I'd like to restore this dump to a separate SQL Server database instance. 我想将此转储还原到单独的SQL Server数据库实例。 Are there any direct (or indirect) ways to do this in an automated fashion? 是否有任何直接(或间接)方式以自动方式执行此操作?

If all you wanted to do is replay the DML statements that may work just fine assuming you have the tables in the target in place. 如果您想要做的就是重放可能正常工作的DML语句,假设您已将目标放在目标中。 But if you want the script to create tables and the other objects the vast majority of those statements will fail without you manually going in and updating them to work on SQL Server. 但是,如果您希望脚本创建表和其他对象,那么绝大多数这些语句都会失败而您无需手动进入并更新它们以在SQL Server上运行。 You may find some company that has a tool that tries to do this and in some cases they can be ok for all the easy conversions but will fail on all the complicated stuff. 你可能会发现某个公司有一个试图做到这一点的工具,在某些情况下,它们可以适用于所有简单的转换,但在所有复杂的东西上都会失败。 Overall SQL Server and PostgreSQL are two different beasts when you get into the details so doing this automatically will be hard without writing some conversion tool or trying to buy one that will probably only get you 60 to 80 percent were you want.. 当你进入细节时,整体SQL Server和PostgreSQL是两种不同的动物,所以如果不编写一些转换工具或试图购买可能只能让你获得60%到80%的转换工具,这样做会很难。

Yes, you can create a DTS job to import from the dump on timely basis. 是的,您可以创建一个DTS作业,以便及时从转储中导入。

http://msdn.microsoft.com/en-us/library/cc917688.aspx http://msdn.microsoft.com/en-us/library/cc917688.aspx

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

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