The pg_dump and pg_dumpall Utilities
PostgreSQL has two similar utilities to help with backups: pg_dump and pg_dumpall. The first is used to create a backup of a single database while the later is used to backup all of the databases on the server. Both utilities create files that you can move to other PostgreSQL database servers and load data into them. You have the option of creating a compressed file if space is a concern or you can create SQL files that you view and edit before running the files to load data into the new database.Tutorial for pg_dump and pg_dumpall
Filesystem Backup
PostgreSQL stores data in regular operating system files and so you can use regular backup tools that you may already have running in your current server environment. Unfortunately the database will need to be shut down first unless you trust your filesystem to take consistent snapshots. For some environments, this isn't a problem. For others, it makes this backup method unusable.Tutorial for Filesystem Backup
Streaming Replication
PostgreSQL has a backup method called streaming replication or log-shipping standby servers that performs the same SQL commands executed on a master database to any number of slaves. The slave databases can then be used as read-only copies for reporting purposes. Should something go wrong with your primary database server, it is simply a matter of flipping a software switch and one of the slave database servers can take over as the primary and business can continue. Other backup options require lengthy restores that may not be possible for time-sensitive database applications.Tutorial for Streaming Replication
No comments:
Post a Comment