BackgroundPostgreSQL logical backup, refers to online backup database data, DDL output as SQL statements, data can be in the form of SQL statements or fixed separators (row format) output.
The backup does not affect the DML operation of the Backup
One: Command line Backup and recovery Postgres database①: First switch to Postgres userSu Postgres
②: Backing up a database named host to a temporary file Host.dumpPg_dump-w Host >/tmp/host.dump
③: Import data from backup file infile to database
Recently the company requested to back up the database, so we looked up the comparative information. Don't say much nonsense, into the subject.Objective: To regularly back up the Postgres database under Ubuntu, and to pack and upload to the
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,
Seven, Pg_dump:
Pg_dump is a tool for backing up the PostgreSQL database. It can even make a full, consistent backup when the database is being used concurrently, without blocking access to the database by other users. The dump format generated by
PostgreSQL Learning Notes (v) Backup and recovery1. Backup tools: Pg_dump and Pg_dumpallThe pg_dump can back up a specified databasePg_dumpall can back up all database data and system global data at once2. The Pg_dump and Pg_dumpall tools do not
Enter PostgreSQL1 Enter the database default installation will create Postgres users, using Postgres user, Psql command directly into the database: Bash code $ su postgres//psql user $ Psql//default direct access to $ psql-u posrgres-d dbname//Use
PostgreSQL provides three backup and recovery methods: SQL dump, file system replication, and online hot backup. Each backup method has its own advantages and disadvantages, which will be described in detail below.
9.1 SQL dumpThis backup method
Pg_dump implements automatic backup under the command line
This project uses the pg_dump.exe tool to back up the PostgreSQL database. The previous command is as follows:
Pg_dump -- Host localhost -- Port 5432 -- username
"S" -- format custom --
PostgreSQL is a very complex object-relational database management system (ORDBMS), and is currently the most powerful, feature richest and most complex free software database system.os:centos6.5 x64ip:192.168.85.130Hostname:vm2.lansgg.comPG Version:
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.