如何将 postgresql 转储恢复到 SQL Server 实例?
我有一个在 Postgres 上运行的生产应用程序,并且每晚都会转储到 tar.gz 文件。我想将此转储恢复到单独的 SQL Server 数据库实例。是否有任何直接(或间接)的方法可以自动完成此操作?
I've got a production app running on Postgres, and I'm taking nightly dumps to a tar.gz file. I'd like to restore this dump to a separate SQL Server database instance. Are there any direct (or indirect) ways to do this in an automated fashion?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您只想重放 DML 语句,假设目标中的表已就位,那么该语句可能会正常工作。但是,如果您希望脚本创建表和其他对象,那么如果您不手动进入并更新它们以在 SQL Server 上运行,那么绝大多数语句都会失败。您可能会发现一些公司拥有尝试执行此操作的工具,在某些情况下,它们可以完成所有简单的转换,但无法完成所有复杂的转换。总的来说,当你深入了解细节时,SQL Server 和 PostgreSQL 是两种不同的野兽,因此如果不编写一些转换工具或尝试购买一个可能只能获得你想要的 60% 到 80% 的转换工具,自动执行此操作将会很困难。
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. 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. 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..
是的,您可以创建 DTS 作业以及时从转储中导入。
http://msdn.microsoft.com/en-us/library/cc917688.aspx
Yes, you can create a DTS job to import from the dump on timely basis.
http://msdn.microsoft.com/en-us/library/cc917688.aspx