PostgreSQL数据库的单表备份与恢复;pg_dump;psql

基本信息

数据库用户名:postgres

数据库:tenant_101

表名称:pl_dictionary_bak20200729

表备份输出的文件:/home/pgbackupfiles/pl_dictionary_bak20200729.sql

备份:

pg_dump -U postgres tenant_101 -t pl_dictionary_bak20200729 -f /home/pgbackupfiles/pl_dictionary_bak20200729.sql

./pg_dump -h 12.16.2.41 -p 5432 -U postgres --dbname=“tenant_101” -t pl_dictionary_bak20200729 -f “/home/pgbackupfiles/pl_dictionary_bak20200729.sql”

恢复:

psql -U postgres -d tenant_101 < /home/software/apdb/pl_dictionary_bak20200729.sql

psql -U postgres -d tenant_101 -h 12.16.2.41 -p 5432

你可能感兴趣的:(数据库,系统运维,PostgreSQL,数据库,postgresql,sql)