Discover how to restore postgres database in linux, include the articles, news, trends, analysis and practical advice about how to restore postgres database in linux on alibabacloud.com
Backup and restore are most important when you are transporting a database. Today, we tested backup and restore using Pg_dumpall.
Backup Restore method: Pg_dump and Pg_restore, first carefully explain these two commands
Back up the database,
Postgres Database backup:Pg_dump [OPTION] ... [DBNAME]/USR/PGSQL-9.4/BIN/PGdump-fc-h 127.0.0.1-upostgres database name >/var/pgsqlback/ruleplatform.sql. '/bin/date + '%Y %b%d%h%m "#pg_dump is to back up the database directives#-F Where to put the
0. Remove unnecessary tables and stored procedures from the 200 server Setup database
DROP TABLE "Sensorpressure";DROP FUNCTION hex_to_int (text);DROP FUNCTION "Pressuredatatosensorpressure" ();
1. Back up 200 of the SETUPD database,:p g_dump-d-H
first, the use of Pg_dump:Import and export of databases is one of the most commonly used features, each of which provides tools for this, such as Oracle's Exp/imp,informix Dbexp/dbimp,mysql mysqldump, and PostgreSQL provides a corresponding tool
first, the use of Pg_dump:Import and export of databases is one of the most commonly used features, each of which provides tools such as Oracle's Exp/imp,informix Dbexp/dbimp,mysql mysqldump, and PostgreSQL provides a corresponding tool for Pg_ Dump
first, the use of Pg_dump:Import and export of databases is one of the most commonly used features, each of which provides tools for this, such as Oracle's Exp/imp,informix Dbexp/dbimp,mysql mysqldump, and PostgreSQL provides a corresponding tool
A sample that can jump directly to the last face to view Really did not think, has been the user of PostgreSQL, suddenly need a library transplant has become the first trick! Originally it was quite different from the MySQL command line
Really did not think, has been the user of PostgreSQL, suddenly need a library transplant has become the first trick! Originally it was quite different from the MySQL command line operation.Don't be afraid, but be careful, because database operation
1. Experimental environmentOS: RedHat Linux enterprisedb 6.3db:postgresql 9.3PGHOME:/opt/postgresql/9.3pgdata:/opt/postgresql/9.3/ Data Archive directory:/opt/pg_archive base backup directory:/opt/base_archive--directories such as archives and data
---restore content starts---Installation method:1, can use the operating system comes with the installation source2, can use the official website to download the source to install3, you can use the compiled package into the. Run Format installation
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.