在远程计算机上还原转储

编程入门 行业动态 更新时间:2024-10-25 22:30:54
本文介绍了在远程计算机上还原转储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有自己的带有postgres dmp文件的计算机,我想在网络中的远程虚拟机(例如ip为192.168.0.190且postgres端口为5432)上还原该文件。是否可以使用pg_restore还原此转储而不将转储复制到远程计算机?因为转储的大小约为12GB,而虚拟机上的磁盘空间为20GB。 谢谢

I've got my own machine with postgres dmp file, which I want to restore on the remote virtual machine (e.g. ip is 192.168.0.190 and postgres port is 5432) in my network. Is it possible to restore this dump using pg_restore without copying dump to remote machine? Because the size of dump about 12GB and the disk space on the virtual machine is 20GB. Thanks

推荐答案

您可以通过网络运行还原,而无需将转储复制到远程主机。

You can run a restore over the network without copying the dump to the remote host.

只需使用 -h< hostname> 和 -p< port> (也可能是 -U< username> 来认证为其他用户)您获得转储文件的主机,例如:

Just invoke pg_restore with -h <hostname> and -p <port> (and probably -U <username> to authenticate as different user) on the host you got the dump file, for example:

pg_restore -h 192.168.0.190 -p 5432 -d databasename -U myuser mydump.dump

参考文献:

  • pg_restore文档
  • pg_restore documentation

更多推荐

在远程计算机上还原转储

本文发布于:2023-10-15 01:16:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1492814.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:机上

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!