PostgreSQL 9.0.13执行pg_restore但没有证据表明正在使用磁盘空间

PostgreSQL 9.0.13执行pg_restore但没有证据表明正在使用磁盘空间,第1张

概述我正在尝试从另一台服务器恢复使用此命令获取的pg_dump. sudo -u postgres pg_dump --verbose --format=custom --file=pg-backup.sql -U postgres salesDB 复制pg-backup.sql文件后,我试图用这个命令恢复 sudo -u postgres pg_restore --verbose --jobs=`n 我正在尝试从另一台服务器恢复使用此命令获取的pg_dump.
sudo -u postgres pg_dump --verbose --format=custom --file=pg-backup.sql -U postgres salesDB

复制pg-backup.sql文件后,我试图用这个命令恢复

sudo -u postgres pg_restore --verbose --jobs=`nproc` -f pg-backup.sql

pg-backup.sql文件是13GB.
pg-restore已经运行了4个小时,一直在我的屏幕上滚动数据.没有错误.

但是当我从psql会话中执行此语句时

SELECT pg_size_pretty(pg_database_size('salesDB'));

我的大小为5377 kB.什么?它现在至少应该是1GB.
我完全迷失了.所有这些数据都在我的屏幕上滚动,我无法证明它会在任何地方.没有磁盘使用.

救命

在pg_restore命令中没有“-f”标志的情况下尝试它.此外,您可能想尝试创建空的salesdb数据库并传入“-d salesdb”.请注意,除非在双引号内创建,否则db名称将折叠为小写.

添加了示例步骤,以显示在还原运行时数据库的大小增加

-- sample pg_dump commandpg_dump -f testdb.out -Fc src_test_db-- create the db to restore intocreatedb sometestdb-- restore with 4 parallel jobs,from the "testdb.out" file,into the db "sometestdb"time pg_restore --dbname=sometestdb --jobs=4 testdb.out-- In another window,every few seconds,you can see the db growingpsql -d postgres -c "select pg_size_pretty(pg_database_size('sometestdb'))" pg_size_pretty ---------------- 4920 MBpsql -d postgres -c "select pg_size_pretty(pg_database_size('sometestdb'))" pg_size_pretty ---------------- 4920 MBpsql -d postgres -c "select pg_size_pretty(pg_database_size('sometestdb'))" pg_size_pretty ---------------- 5028 MBpsql -d postgres -c "select pg_size_pretty(pg_database_size('sometestdb'))" pg_size_pretty ---------------- 5371 MB
总结

以上是内存溢出为你收集整理的PostgreSQL 9.0.13执行pg_restore但没有证据表明正在使用磁盘空间全部内容,希望文章能够帮你解决PostgreSQL 9.0.13执行pg_restore但没有证据表明正在使用磁盘空间所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/sjk/1164786.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-01
下一篇 2022-06-01

发表评论

登录后才能评论

评论列表(0条)

保存